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