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