X-Git-Url: https://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=nagios-mode.el;h=6b2d1d12a3ded7159559539603d19aa6021f5cb6;hb=0d13c8616a48e66473c093ea8e5c5fd833fb6cfd;hp=291b0eb0c006f7e89f9134122043d691c2779f9f;hpb=ec7589a5032f9f156e46fbb77babaa9ac391a818;p=nagios-mode.git diff --git a/nagios-mode.el b/nagios-mode.el index 291b0eb..6b2d1d1 100644 --- a/nagios-mode.el +++ b/nagios-mode.el @@ -292,17 +292,25 @@ (kill-all-local-variables) (make-local-variable 'font-lock-defaults) (make-local-variable 'comment-start) + (make-local-variable 'comment-start-skip) (make-local-variable 'comment-end) (make-local-variable 'indent-line-function) + (make-local-variable 'syntax-begin-function) (set-syntax-table nagios-mode-syntax-table) - (setq mode-name "nagios" - major-mode 'nagios-mode - indent-line-function 'nagios-indent-line - font-lock-defaults '(nagios-font-lock-keywords) - comment-start "#" - comment-end "" + (setq mode-name "nagios" + major-mode 'nagios-mode + indent-line-function 'nagios-indent-line + font-lock-defaults '(nagios-font-lock-keywords) + comment-start "#" + comment-start-skip "#\|; +" + comment-end "" + + ;; Since comments and strings do not span multiple lines, + ;; the syntax parser can safely start parsing at the beginning + ;; of any line. + syntax-begin-function 'beginning-of-line ) ;; Keyboard Mapping