X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=nagios-mode.el;h=e1573345a61670b5fb8a9989d3abf622c367ecf4;hb=eb979cc1755ca7cf5b42f0ec401777fd6a1c50ee;hp=0fb247af60532847b469ae3faeb36a4d512e2fcd;hpb=91e617e3922a14b0482f006413ca4b10eee6fdf0;p=nagios-mode.git diff --git a/nagios-mode.el b/nagios-mode.el index 0fb247a..e157334 100644 --- a/nagios-mode.el +++ b/nagios-mode.el @@ -156,11 +156,23 @@ ;; Regular Expression Transformations (defun regexp-word(regexp) - "Takes a regular expression as an argument, and adds the word boundary condition to the beginning and end of it." + "Takes a regular expression as an argument, and adds the word boundary condition to the beginning and end of it. Newlines are treated as word boundaries." + ;; This basically joins two expressions in an alternation. + ;; The first allows for a newline followed by our regexp (on + ;; a word boundary), and the second checks for any-non-word + ;; character followed by our regexp. + ;; ;; I consider neither a hyphen nor an underscore to be a word - ;; boundary for the purpose of syntax highlighting. - (concat "[^_-]\\<\\(" regexp "\\)\\>[^_-]") + ;; boundary for the purpose of syntax highlighting, so I stick + ;; the no-hyphens-or-underscores class on each end of the + ;; expressions. + + (concat "\\(" + (concat "\\(^\\<\\(" regexp "\\)\\>[^_-]\\)") + "\\|" + (concat "\\([^_-]\\<\\(" regexp "\\)\\>[^_-]\\)") + "\\)") ) @@ -198,17 +210,17 @@ '("active_checks_enabled" "address" "alias" "check_command" "check_freshness" "check_interval" "check_period" "checks_enabled" "command_line" "command_name" "contact_groups" "contact_name" - "contactgroup_name" "dependent_host_name" + "contactgroup_name" "contacts" "dependent_host_name" "dependent_service_description" "email" "event_handler" "event_handler_enabled" "execution_failure_criteria" "failure_prediction_enabled" "first_notification" "flap_detection_enabled" "freshness_threshold" "friday" "high_flap_threshold" "host_name" "host_notification_commands" "host_notification_options" "host_notification_period" - "hostgroup_name" "hostgroups" "is_volatile" "last_notification" - "low_flap_threshold" "max_check_attempts" - "members" "monday" "normal_check_interval" - "notification_failure_criteria" + "host_notifications_enabled" "hostgroup_name" "hostgroups" + "is_volatile" "last_notification" "low_flap_threshold" + "max_check_attempts" "members" "monday" "normal_check_interval" + "notes" "notification_failure_criteria" "notification_interval" "notification_options" "notification_period" "notifications_enabled" "obsess_over_service" "pager" "parallelize_check" @@ -216,9 +228,9 @@ "process_perf_data" "retain_nonstatus_information" "retain_status_information" "retry_check_interval" "retry_interval" "saturday" "service_description" - "service_notification_commands" - "service_notification_options" - "service_notification_period" "stalking_options" + "service_notification_commands" "service_notification_options" + "service_notification_period" "service_notifications_enabled" + "servicegroup_name" "stalking_options" "sunday" "thursday" "timeperiod_name" "tuesday" "wednesday") t)) ) @@ -245,7 +257,7 @@ (eval-when-compile (regexp-alt-raw '("define +\\(host\\|service\\|timeperiod\\|contact\\|command\\)" - "define +\\(host\\|contact\\)group" + "define +\\(host\\|contact\\|service\\)group" "define +\\(service\\|host\\)dependency" "define +\\(service\\|host\\|hostgroup\\)escalation"))) )