]> gitweb.michael.orlitzky.com - nagios-mode.git/blob - nagios-mode.el
8482abee94e397159ff728546d5a8d9c39d52d84
[nagios-mode.git] / nagios-mode.el
1 ;;
2 ;; nagios-mode, an Emacs mode for Nagios <http://www.nagios.org/>
3 ;; configuration files.
4 ;;
5 ;; Copyright Michael Orlitzky
6 ;;
7 ;; http://michael.orlitzky.com/
8 ;;
9 ;; This program is free software: you can redistribute it and/or modify
10 ;; it under the terms of the GNU General Public License as published by
11 ;; the Free Software Foundation, either version 3 of the License, or
12 ;; (at your option) any later version.
13 ;;
14 ;; This program is distributed in the hope that it will be useful,
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;; GNU General Public License for more details.
18 ;;
19 ;; http://www.fsf.org/licensing/licenses/gpl.html
20 ;;
21
22 (require 'font-lock)
23 (require 'regexp-opt)
24
25
26 ;; Custom Variables
27
28 (defcustom nagios-indent-level 2
29 "Number of spaces in one indentation (tab)."
30 :type 'integer :group 'nagios
31 )
32
33
34
35 ;; Indentation Voodoo
36
37 (defun nagios-indent-line(&optional flag)
38 "Indents a line, taking nesting into account."
39 (interactive)
40 (nagios-indent-to (nagios-calculate-indent))
41 )
42
43
44 (defun beginning-of-line-pos()
45 ;; Return the point position corresponding to the beginning
46 ;; of the current line.
47 (save-excursion
48 (beginning-of-line)
49 (point)
50 )
51 )
52
53 (defun end-of-line-pos()
54 ;; Return the point position corresponding to the end
55 ;; of the current line.
56 (save-excursion
57 (end-of-line)
58 (point)
59 )
60 )
61
62 (defun point-offset()
63 ;; How far are we from the beginning of the line?
64 (- (point) (beginning-of-line-pos))
65 )
66
67 (defun first-char-offset()
68 ;; How far is the first character on this line
69 ;; from the beginning of the line?
70 (save-excursion
71 (beginning-of-line)
72 (skip-chars-forward " \t")
73 )
74 )
75
76 (defun first-char-pos()
77 ;; What's the position of the first character on this line?
78 (+ (beginning-of-line-pos) (first-char-offset))
79 )
80
81 (defun nagios-indent-to(indent-column)
82 "Indent the current line to column indent-column."
83 ;; Store the point in orig-pos.
84 (let ((orig-point (point)))
85
86 ;; And store the offset of the first character (with respect to the
87 ;; beginning of the line) in orig-first-char-offset.
88 (let ((orig-first-char-offset (first-char-offset)))
89
90 ;; Delete any leading whitespace, and move the point to the
91 ;; beginning of the line.
92 (delete-region (beginning-of-line-pos) (first-char-pos))
93 (beginning-of-line)
94
95 ;; Now insert indent-column spaces.
96 (let ((indent-remaining indent-column))
97 (while (< 0 indent-remaining)
98 (insert " ")
99 (setq indent-remaining (- indent-remaining 1)))
100 )
101
102 ;; The text on the current line just moved left/right some amount;
103 ;; call it text-delta. We want to move the point that same distance.
104 (let ((text-delta (- (first-char-offset) orig-first-char-offset)))
105 (goto-char (+ orig-point text-delta))
106 )
107
108 ;; The point should never wind up to the left of indent-column, so
109 ;; if it's there, move it over to indent-column.
110 (if (< (point-offset) indent-column)
111 (goto-char (+ (beginning-of-line-pos) indent-column))
112 )
113 )
114 )
115 )
116
117
118
119 (defun last-opening-brace()
120 ;; Get the position of the last opening brace, with
121 ;; respect to the current point.
122 (save-excursion
123 (let ((lob (re-search-backward "{" nil t)))
124 (if lob
125 lob
126 -1)
127 )
128 )
129 )
130
131 (defun last-closing-brace()
132 ;; Get the position of the last closing brace, with
133 ;; respect to the current point.
134 (save-excursion
135 (let ((lcb (re-search-backward "}" nil t)))
136 (if lcb
137 lcb
138 -1)
139 )
140 )
141 )
142
143 (defun nagios-in-block()
144 "Determine if the point is inside of a {} block."
145
146 ;; If the last brace seen in the buffer is an opening brace, we're
147 ;; in a block. Otherwise, we aren't.
148 (if (>= (last-closing-brace) (last-opening-brace))
149 nil
150 t)
151 )
152
153
154 (defun brace-on-line()
155 ;; Is there a curly brace on this line?
156 (save-excursion
157 (re-search-forward "[{}]" (end-of-line-pos) t)
158 )
159 )
160
161 (defun nagios-calculate-indent()
162 "Calculate the level of indentation."
163
164 ;; We're either inside a block, or we aren't.
165 ;; Initialize the indent variable to either nagios-indent-level
166 ;; or 0 depending on whether or not we're in a block.
167 (let ((indent (if (nagios-in-block)
168 nagios-indent-level
169 0)
170 )
171 )
172
173 ;; Set the indentation level to 0 if we find either brace on this
174 ;; line.
175 (if (brace-on-line)
176 (setq indent 0)
177 )
178
179 indent
180 )
181 )
182
183
184 ;; Keymaps
185
186 (defun nagios-insert-right-brace-and-indent()
187 "Insert a '}' character, and indent the line."
188 (interactive)
189 (insert "}")
190 (nagios-indent-line)
191 )
192
193
194 (defvar nagios-mode-map()
195 "Keymap used in nagios mode.")
196
197 (when (not nagios-mode-map)
198 (setq nagios-mode-map (make-sparse-keymap))
199 (define-key nagios-mode-map
200 (read-kbd-macro "}")
201 'nagios-insert-right-brace-and-indent)
202 )
203
204
205
206 (defconst nagios-directives
207 (eval-when-compile
208 (concat "^[ \t\r\n]*"
209
210 (regexp-opt
211 '("active_checks_enabled" "address" "alias" "check_command"
212 "check_freshness" "check_interval" "check_period" "checks_enabled"
213 "command_line" "command_name" "contactgroups" "contact_groups"
214 "contactgroup_members" "contact_name" "contactgroup_name" "contacts"
215 "dependent_host_name" "dependent_service_description" "email"
216 "event_handler" "event_handler_enabled" "execution_failure_criteria"
217 "failure_prediction_enabled" "first_notification"
218 "first_notification_delay" "flap_detection_enabled" "freshness_threshold"
219 "friday" "high_flap_threshold" "host_name" "host_notification_commands"
220 "host_notification_options" "host_notification_period"
221 "host_notifications_enabled" "hostgroup_name" "hostgroups"
222 "is_volatile" "last_notification" "low_flap_threshold"
223 "max_check_attempts" "members" "monday" "normal_check_interval"
224 "notes" "notification_failure_criteria"
225 "notification_interval" "notification_options"
226 "notification_period" "notifications_enabled"
227 "obsess_over_service" "pager" "parallelize_check"
228 "parents" "passive_checks_enabled"
229 "process_perf_data" "retain_nonstatus_information"
230 "retain_status_information" "retry_check_interval"
231 "retry_interval" "saturday" "service_description"
232 "service_notification_commands" "service_notification_options"
233 "service_notification_period" "service_notifications_enabled"
234 "servicegroup_name" "stalking_options"
235 "sunday" "thursday" "timeperiod_name" "tuesday" "wednesday") t)
236
237 "[ \r\n\t]+")
238 )
239 )
240
241
242
243 (defconst nagios-macros
244 (eval-when-compile
245 (regexp-opt
246 '("$ADMINEMAIL$"
247 "$ADMINPAGER$"
248 "$ARG1$"
249 "$ARG10$"
250 "$ARG11$"
251 "$ARG12$"
252 "$ARG13$"
253 "$ARG14$"
254 "$ARG15$"
255 "$ARG16$"
256 "$ARG17$"
257 "$ARG18$"
258 "$ARG19$"
259 "$ARG2$"
260 "$ARG20$"
261 "$ARG21$"
262 "$ARG22$"
263 "$ARG23$"
264 "$ARG24$"
265 "$ARG25$"
266 "$ARG26$"
267 "$ARG27$"
268 "$ARG28$"
269 "$ARG29$"
270 "$ARG3$"
271 "$ARG30$"
272 "$ARG31$"
273 "$ARG32$"
274 "$ARG4$"
275 "$ARG5$"
276 "$ARG6$"
277 "$ARG7$"
278 "$ARG8$"
279 "$ARG9$"
280 "$COMMANDFILE$"
281 "$CONTACTALIAS$"
282 "$CONTACTEMAIL$"
283 "$CONTACTGROUPALIAS$"
284 "$CONTACTGROUPMEMBERS$"
285 "$CONTACTGROUPNAME$"
286 "$CONTACTGROUPNAMES$"
287 "$CONTACTNAME$"
288 "$CONTACTPAGER$"
289 "$DATE$"
290 "$EVENTSTARTTIME$"
291 "$HOSTACKAUTHOR$"
292 "$HOSTACKAUTHORALIAS$"
293 "$HOSTACKAUTHORNAME$"
294 "$HOSTACKCOMMENT$"
295 "$HOSTACTIONURL$"
296 "$HOSTADDRESS$"
297 "$HOSTALIAS$"
298 "$HOSTATTEMPT$"
299 "$HOSTCHECKCOMMAND$"
300 "$HOSTCHECKTYPE$"
301 "$HOSTDISPLAYNAME$"
302 "$HOSTDOWNTIME$"
303 "$HOSTDURATION$"
304 "$HOSTDURATIONSEC$"
305 "$HOSTEVENTID$"
306 "$HOSTEXECUTIONTIME$"
307 "$HOSTGROUPACTIONURL$"
308 "$HOSTGROUPALIAS$"
309 "$HOSTGROUPMEMBERS$"
310 "$HOSTGROUPNAME$"
311 "$HOSTGROUPNAMES$"
312 "$HOSTGROUPNOTES$"
313 "$HOSTGROUPNOTESURL$"
314 "$HOSTLATENCY$"
315 "$HOSTNAME$"
316 "$HOSTNOTES$"
317 "$HOSTNOTESURL$"
318 "$HOSTNOTIFICATIONID$"
319 "$HOSTNOTIFICATIONNUMBER$"
320 "$HOSTOUTPUT$"
321 "$HOSTPERCENTCHANGE$"
322 "$HOSTPERFDATA$"
323 "$HOSTPERFDATAFILE$"
324 "$HOSTPROBLEMID$"
325 "$HOSTSTATE$"
326 "$HOSTSTATEID$"
327 "$HOSTSTATETYPE$"
328 "$ISVALIDTIME$"
329 "$LASTHOSTCHECK$"
330 "$LASTHOSTDOWN$"
331 "$LASTHOSTEVENTID$"
332 "$LASTHOSTPROBLEMID$"
333 "$LASTHOSTSTATE$"
334 "$LASTHOSTSTATECHANGE$"
335 "$LASTHOSTSTATEID$"
336 "$LASTHOSTUNREACHABLE$"
337 "$LASTHOSTUP$"
338 "$LASTSERVICECHECK$"
339 "$LASTSERVICECRITICAL$"
340 "$LASTSERVICEEVENTID$"
341 "$LASTSERVICEOK$"
342 "$LASTSERVICEPROBLEMID$"
343 "$LASTSERVICESTATE$"
344 "$LASTSERVICESTATECHANGE$"
345 "$LASTSERVICESTATEID$"
346 "$LASTSERVICEUNKNOWN$"
347 "$LASTSERVICEWARNING$"
348 "$LOGFILE$"
349 "$LONGDATETIME$"
350 "$LONGHOSTOUTPUT$"
351 "$LONGSERVICEOUTPUT$"
352 "$MAINCONFIGFILE$"
353 "$MAXHOSTATTEMPTS$"
354 "$MAXSERVICEATTEMPTS$"
355 "$NEXTVALIDTIME$"
356 "$NOTIFICATIONAUTHOR$"
357 "$NOTIFICATIONAUTHORALIAS$"
358 "$NOTIFICATIONAUTHORNAME$"
359 "$NOTIFICATIONCOMMENT$"
360 "$NOTIFICATIONISESCALATED$"
361 "$NOTIFICATIONNUMBER$"
362 "$NOTIFICATIONRECIPIENTS$"
363 "$NOTIFICATIONTYPE$"
364 "$OBJECTCACHEFILE$"
365 "$PROCESSSTARTTIME$"
366 "$RESOURCEFILE$"
367 "$RETENTIONDATAFILE$"
368 "$SERVICEACKAUTHOR$"
369 "$SERVICEACKAUTHORALIAS$"
370 "$SERVICEACKAUTHORNAME$"
371 "$SERVICEACKCOMMENT$"
372 "$SERVICEACTIONURL$"
373 "$SERVICEATTEMPT$"
374 "$SERVICECHECKCOMMAND$"
375 "$SERVICECHECKTYPE$"
376 "$SERVICEDESC$"
377 "$SERVICEDISPLAYNAME$"
378 "$SERVICEDOWNTIME$"
379 "$SERVICEDURATION$"
380 "$SERVICEDURATIONSEC$"
381 "$SERVICEEVENTID$"
382 "$SERVICEEXECUTIONTIME$"
383 "$SERVICEGROUPACTIONURL$"
384 "$SERVICEGROUPALIAS$"
385 "$SERVICEGROUPMEMBERS$"
386 "$SERVICEGROUPNAME$"
387 "$SERVICEGROUPNAMES$"
388 "$SERVICEGROUPNOTES$"
389 "$SERVICEGROUPNOTESURL$"
390 "$SERVICEISVOLATILE$"
391 "$SERVICELATENCY$"
392 "$SERVICENOTES$"
393 "$SERVICENOTESURL$"
394 "$SERVICENOTIFICATIONID$"
395 "$SERVICENOTIFICATIONNUMBER$"
396 "$SERVICEOUTPUT$"
397 "$SERVICEPERCENTCHANGE$"
398 "$SERVICEPERFDATA$"
399 "$SERVICEPERFDATAFILE$"
400 "$SERVICEPROBLEMID$"
401 "$SERVICESTATE$"
402 "$SERVICESTATEID$"
403 "$SERVICESTATETYPE$"
404 "$SHORTDATETIME$"
405 "$STATUSDATAFILE$"
406 "$TEMPFILE$"
407 "$TEMPPATH$"
408 "$TIME$"
409 "$TIMET$"
410 "$TOTALHOSTPROBLEMS$"
411 "$TOTALHOSTPROBLEMSUNHANDLED$"
412 "$TOTALHOSTSDOWN$"
413 "$TOTALHOSTSDOWNUNHANDLED$"
414 "$TOTALHOSTSERVICES$"
415 "$TOTALHOSTSERVICESCRITICAL$"
416 "$TOTALHOSTSERVICESOK$"
417 "$TOTALHOSTSERVICESUNKNOWN$"
418 "$TOTALHOSTSERVICESWARNING$"
419 "$TOTALHOSTSUNREACHABLE$"
420 "$TOTALHOSTSUNREACHABLEUNHANDLED$"
421 "$TOTALHOSTSUP$"
422 "$TOTALSERVICEPROBLEMS$"
423 "$TOTALSERVICEPROBLEMSUNHANDLED$"
424 "$TOTALSERVICESCRITICAL$"
425 "$TOTALSERVICESCRITICALUNHANDLED$"
426 "$TOTALSERVICESOK$"
427 "$TOTALSERVICESUNKNOWN$"
428 "$TOTALSERVICESUNKNOWNUNHANDLED$"
429 "$TOTALSERVICESWARNING$"
430 "$TOTALSERVICESWARNINGUNHANDLED$"
431 "$USER1$"
432 "$USER10$"
433 "$USER100$"
434 "$USER101$"
435 "$USER102$"
436 "$USER103$"
437 "$USER104$"
438 "$USER105$"
439 "$USER106$"
440 "$USER107$"
441 "$USER108$"
442 "$USER109$"
443 "$USER11$"
444 "$USER110$"
445 "$USER111$"
446 "$USER112$"
447 "$USER113$"
448 "$USER114$"
449 "$USER115$"
450 "$USER116$"
451 "$USER117$"
452 "$USER118$"
453 "$USER119$"
454 "$USER12$"
455 "$USER120$"
456 "$USER121$"
457 "$USER122$"
458 "$USER123$"
459 "$USER124$"
460 "$USER125$"
461 "$USER126$"
462 "$USER127$"
463 "$USER128$"
464 "$USER129$"
465 "$USER13$"
466 "$USER130$"
467 "$USER131$"
468 "$USER132$"
469 "$USER133$"
470 "$USER134$"
471 "$USER135$"
472 "$USER136$"
473 "$USER137$"
474 "$USER138$"
475 "$USER139$"
476 "$USER14$"
477 "$USER140$"
478 "$USER141$"
479 "$USER142$"
480 "$USER143$"
481 "$USER144$"
482 "$USER145$"
483 "$USER146$"
484 "$USER147$"
485 "$USER148$"
486 "$USER149$"
487 "$USER15$"
488 "$USER150$"
489 "$USER151$"
490 "$USER152$"
491 "$USER153$"
492 "$USER154$"
493 "$USER155$"
494 "$USER156$"
495 "$USER157$"
496 "$USER158$"
497 "$USER159$"
498 "$USER16$"
499 "$USER160$"
500 "$USER161$"
501 "$USER162$"
502 "$USER163$"
503 "$USER164$"
504 "$USER165$"
505 "$USER166$"
506 "$USER167$"
507 "$USER168$"
508 "$USER169$"
509 "$USER17$"
510 "$USER170$"
511 "$USER171$"
512 "$USER172$"
513 "$USER173$"
514 "$USER174$"
515 "$USER175$"
516 "$USER176$"
517 "$USER177$"
518 "$USER178$"
519 "$USER179$"
520 "$USER18$"
521 "$USER180$"
522 "$USER181$"
523 "$USER182$"
524 "$USER183$"
525 "$USER184$"
526 "$USER185$"
527 "$USER186$"
528 "$USER187$"
529 "$USER188$"
530 "$USER189$"
531 "$USER19$"
532 "$USER190$"
533 "$USER191$"
534 "$USER192$"
535 "$USER193$"
536 "$USER194$"
537 "$USER195$"
538 "$USER196$"
539 "$USER197$"
540 "$USER198$"
541 "$USER199$"
542 "$USER2$"
543 "$USER20$"
544 "$USER200$"
545 "$USER201$"
546 "$USER202$"
547 "$USER203$"
548 "$USER204$"
549 "$USER205$"
550 "$USER206$"
551 "$USER207$"
552 "$USER208$"
553 "$USER209$"
554 "$USER21$"
555 "$USER210$"
556 "$USER211$"
557 "$USER212$"
558 "$USER213$"
559 "$USER214$"
560 "$USER215$"
561 "$USER216$"
562 "$USER217$"
563 "$USER218$"
564 "$USER219$"
565 "$USER22$"
566 "$USER220$"
567 "$USER221$"
568 "$USER222$"
569 "$USER223$"
570 "$USER224$"
571 "$USER225$"
572 "$USER226$"
573 "$USER227$"
574 "$USER228$"
575 "$USER229$"
576 "$USER23$"
577 "$USER230$"
578 "$USER231$"
579 "$USER232$"
580 "$USER233$"
581 "$USER234$"
582 "$USER235$"
583 "$USER236$"
584 "$USER237$"
585 "$USER238$"
586 "$USER239$"
587 "$USER24$"
588 "$USER240$"
589 "$USER241$"
590 "$USER242$"
591 "$USER243$"
592 "$USER244$"
593 "$USER245$"
594 "$USER246$"
595 "$USER247$"
596 "$USER248$"
597 "$USER249$"
598 "$USER25$"
599 "$USER250$"
600 "$USER251$"
601 "$USER252$"
602 "$USER253$"
603 "$USER254$"
604 "$USER255$"
605 "$USER256$"
606 "$USER26$"
607 "$USER27$"
608 "$USER28$"
609 "$USER29$"
610 "$USER3$"
611 "$USER30$"
612 "$USER31$"
613 "$USER32$"
614 "$USER33$"
615 "$USER34$"
616 "$USER35$"
617 "$USER36$"
618 "$USER37$"
619 "$USER38$"
620 "$USER39$"
621 "$USER4$"
622 "$USER40$"
623 "$USER41$"
624 "$USER42$"
625 "$USER43$"
626 "$USER44$"
627 "$USER45$"
628 "$USER46$"
629 "$USER47$"
630 "$USER48$"
631 "$USER49$"
632 "$USER5$"
633 "$USER50$"
634 "$USER51$"
635 "$USER52$"
636 "$USER53$"
637 "$USER54$"
638 "$USER55$"
639 "$USER56$"
640 "$USER57$"
641 "$USER58$"
642 "$USER59$"
643 "$USER6$"
644 "$USER60$"
645 "$USER61$"
646 "$USER62$"
647 "$USER63$"
648 "$USER64$"
649 "$USER65$"
650 "$USER66$"
651 "$USER67$"
652 "$USER68$"
653 "$USER69$"
654 "$USER7$"
655 "$USER70$"
656 "$USER71$"
657 "$USER72$"
658 "$USER73$"
659 "$USER74$"
660 "$USER75$"
661 "$USER76$"
662 "$USER77$"
663 "$USER78$"
664 "$USER79$"
665 "$USER8$"
666 "$USER80$"
667 "$USER81$"
668 "$USER82$"
669 "$USER83$"
670 "$USER84$"
671 "$USER85$"
672 "$USER86$"
673 "$USER87$"
674 "$USER88$"
675 "$USER89$"
676 "$USER9$"
677 "$USER90$"
678 "$USER91$"
679 "$USER92$"
680 "$USER93$"
681 "$USER94$"
682 "$USER95$"
683 "$USER96$"
684 "$USER97$"
685 "$USER98$"
686 "$USER99$")))
687 )
688
689
690
691 (defconst nagios-definitions
692 (eval-when-compile
693
694 (concat "^[ \t\r\n]*"
695
696 "\\(" ;; Stick parenthesis around whatever comes out
697 ;; of regexp-opt. We use this to match a
698 ;; subexpression during font-lock.
699 (regexp-opt
700 '("define command"
701 "define contact"
702 "define contactgroup"
703 "define host"
704 "define hostdependency"
705 "define hostescalation"
706 "define hostextinfo"
707 "define hostgroup"
708 "define hostgroupescalation"
709 "define null"
710 "define service"
711 "define servicedependency"
712 "define serviceescalation"
713 "define serviceextinfo"
714 "define servicegroup"
715 "define timeperiod"))
716 ;; This closes the parentheses that we opened
717 "\\)" ;; before regexp-opt.
718
719 ;; These can be "terminated" by either an opening curly
720 ;; brace, or a space.
721 "\\({\\| \\)")
722 )
723 )
724
725
726
727 (defconst nagios-special
728 (eval-when-compile
729 (concat "^[ \t\r\n]*"
730
731 (regexp-opt
732 '("name" "register" "use") t)
733
734 "[ \r\n\t]+"))
735 )
736
737
738
739 ;; The One True Font Locking Variable
740
741 (defvar nagios-font-lock-keywords
742 (list
743 (cons nagios-special font-lock-keyword-face)
744 (cons nagios-directives font-lock-variable-name-face)
745 (cons nagios-macros font-lock-constant-face)
746 (cons nagios-definitions '(1 font-lock-function-name-face)))
747
748 "Rules for highlighting Nagios configuration files."
749 )
750
751
752
753 (defvar nagios-mode-syntax-table nil
754 "Syntax table used in nagios-mode buffers.")
755 (if nagios-mode-syntax-table
756 nil
757 (setq nagios-mode-syntax-table (make-syntax-table))
758 (modify-syntax-entry ?# "< b" nagios-mode-syntax-table) ;; Comment style 1
759 (modify-syntax-entry ?\; "< b" nagios-mode-syntax-table) ;; Comment style 2
760 (modify-syntax-entry ?\n "> b" nagios-mode-syntax-table) ;; End comment
761 )
762
763
764 ;; Main Mode Function
765
766 (defun nagios-mode()
767 "Major mode for editing Nagios configuration files."
768
769 (interactive)
770 (kill-all-local-variables)
771 (make-local-variable 'font-lock-defaults)
772 (make-local-variable 'comment-start)
773 (make-local-variable 'comment-start-skip)
774 (make-local-variable 'comment-end)
775 (make-local-variable 'indent-line-function)
776 (make-local-variable 'syntax-begin-function)
777
778 (set-syntax-table nagios-mode-syntax-table)
779
780 (setq mode-name "nagios"
781 major-mode 'nagios-mode
782 indent-line-function 'nagios-indent-line
783 font-lock-defaults '(nagios-font-lock-keywords)
784 comment-start "#"
785 comment-start-skip "#\|; +"
786 comment-end ""
787
788 ;; Since comments and strings do not span multiple lines,
789 ;; the syntax parser can safely start parsing at the beginning
790 ;; of any line.
791 syntax-begin-function 'beginning-of-line
792 )
793
794 ;; Keyboard Mapping
795 (use-local-map nagios-mode-map)
796
797 ;; I don't /think/ I need to define this before attempting
798 ;; to run it. Users can define it if they want.
799 (run-hooks 'nagios-mode-hook)
800 )
801
802
803 (provide 'nagios-mode)