Add support for 'imenu' and 'which-func' to 'nsis-mode'.
--- a/.emacs-my Sun Jun 19 17:05:50 2011 +0300
+++ b/.emacs-my Sun Jun 19 23:02:11 2011 +0300
@@ -1328,7 +1328,7 @@
(imenu-add-menubar-index)
(run-hooks 'menu-bar-update-hook)
) ))
- (delq 'nsis-mode-hook my-devel-mode-hook-list))
+ my-devel-mode-hook-list)
)
;;; ----------------------------------------------------------------
--- a/nsis-mode.el Sun Jun 19 17:05:50 2011 +0300
+++ b/nsis-mode.el Sun Jun 19 23:02:11 2011 +0300
@@ -72,6 +72,23 @@
)
)
+(setq nsis-imenu-generic-expression
+ '(
+ ("Defines" "^!define[[:blank:]]+\\([[:word:]]+\\)" 1)
+ ("Sections" "^Section[[:blank:]]+\\(-?[[:word:]]+\\)" 1)
+ ("Functions" "^Function[[:blank:]]+\\([[:word:]]+\\)" 1)
+ ))
+
+(add-hook
+ 'nsis-mode-hook
+ (lambda ()
+ (setq imenu-generic-expression nsis-imenu-generic-expression)
+ ) )
+
+(eval-after-load 'which-func
+ '(add-to-list 'which-func-modes 'nsis-mode)
+ )
+
(provide 'nsis-mode)
;;; nsis-mode.el ends here