]> gitweb.michael.orlitzky.com - nagios-mode.git/commitdiff
Define syntax-begin-function as beginning-of-line.
authorMichael Orlitzky <michael@orlitzky.com>
Fri, 9 Apr 2010 16:05:19 +0000 (12:05 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Fri, 9 Apr 2010 16:05:19 +0000 (12:05 -0400)
nagios-mode.el

index a284c621ae9963448ef533c3110cab14f52d4d2f..6b2d1d12a3ded7159559539603d19aa6021f5cb6 100644 (file)
   (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-start-skip   "#\|; +"
-       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