Move code from add-hook lambda to separate functions.
--- a/nsis-mode.el Sun Jun 19 23:02:11 2011 +0300
+++ b/nsis-mode.el Sun Jun 19 23:11:10 2011 +0300
@@ -64,13 +64,12 @@
nil
"Generic mode for nsis files.")
-(add-hook
- 'nsis-mode-hook
- (lambda ()
- (modify-syntax-entry ?_ "w")
- (modify-syntax-entry ?. "w")
- )
- )
+(defun nsis-mode-modify-syntax-entry ()
+ (modify-syntax-entry ?_ "w")
+ (modify-syntax-entry ?. "w")
+ )
+
+(add-hook 'nsis-mode-hook 'nsis-mode-modify-syntax-entry)
(setq nsis-imenu-generic-expression
'(
@@ -79,11 +78,11 @@
("Functions" "^Function[[:blank:]]+\\([[:word:]]+\\)" 1)
))
-(add-hook
- 'nsis-mode-hook
- (lambda ()
- (setq imenu-generic-expression nsis-imenu-generic-expression)
- ) )
+(defun nsis-set-imenu-generic-expression ()
+ (setq imenu-generic-expression nsis-imenu-generic-expression)
+ )
+
+(add-hook 'nsis-mode-hook 'nsis-set-imenu-generic-expression)
(eval-after-load 'which-func
'(add-to-list 'which-func-modes 'nsis-mode)