Eliminate hook and add nsis-mode-set-comment-style.
--- a/nsis-mode.el Fri Jun 24 18:02:12 2011 +0300
+++ b/nsis-mode.el Fri Jun 24 18:06:06 2011 +0300
@@ -16,8 +16,18 @@
;;; Code:
+(defun nsis-mode-modify-syntax-entry ()
+ (modify-syntax-entry ?_ "w")
+ (modify-syntax-entry ?. "w")
+ )
+
+(defun nsis-mode-set-comment-style ()
+ (setq comment-start "; ")
+ (setq comment-end "")
+ )
+
;;;###autoload
-(define-generic-mode 'nsis-mode
+(define-generic-mode nsis-mode
(list ?\; ?\# '("/*" . "*/"))
'(
"Section" "SectionEnd" "SectionIn" "SectionGroup" "SectionGroupEnd" "Function" "FunctionEnd" "File"
@@ -60,17 +70,10 @@
("^[[:blank:]]*\\([[:alpha:].][[:alnum:]_.]*:\\)\\([^:]\\|$\\)" (1 'font-lock-function-name-face))
("^[[:blank:]]*\\(Function\\|Goto\\|Call\\)[[:blank:]]+\\([[:alnum:]_.]*\\)" (2 'font-lock-function-name-face))
)
- (list "\\.\\(nsi\\|nsh\\)$")
- nil
+ '("\\.nsi\\'" "\\.nsh\\'")
+ '(nsis-mode-modify-syntax-entry nsis-mode-set-comment-style)
"Generic mode for nsis files.")
-(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
'(
("Defines" "^!define[[:blank:]]+\\([[:word:]]+\\)" 1)