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