# HG changeset patch
# User Reiner Steib <Reiner.Steib@gmx.de>
# Date 1197124348 0
# Node ID 5ab752d82a12e67ad7753d0bbf16f61eb29151c0
# Parent  81d86af942c963daff5b62e69f520b1c7d0d781c
(etc-sudoers-generic-mode): New mode.
(generic-unix-modes): Add it.

diff -r 81d86af942c9 -r 5ab752d82a12 lisp/ChangeLog
--- a/lisp/ChangeLog	Sat Dec 08 14:29:18 2007 +0000
+++ b/lisp/ChangeLog	Sat Dec 08 14:32:28 2007 +0000
@@ -1,3 +1,8 @@
+2007-12-08  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* generic-x.el (etc-sudoers-generic-mode): New mode.
+	(generic-unix-modes): Add it.
+
 2007-12-08  Michael Albinus  <michael.albinus@gmx.de>
 
 	* net/dbus.el (dbus-hash-table=): Remove function.  We cannot
diff -r 81d86af942c9 -r 5ab752d82a12 lisp/generic-x.el
--- a/lisp/generic-x.el	Sat Dec 08 14:29:18 2007 +0000
+++ b/lisp/generic-x.el	Sat Dec 08 14:32:28 2007 +0000
@@ -221,6 +221,7 @@
     etc-modules-conf-generic-mode
     etc-passwd-generic-mode
     etc-services-generic-mode
+    etc-sudoers-generic-mode
     fvwm-generic-mode
     inetd-conf-generic-mode
     mailagent-rules-generic-mode
@@ -1736,6 +1737,21 @@
       (setq imenu-generic-expression
 	    '((nil "^\\([^# \t]+\\)\\s-+" 1))))))))
 
+;; /etc/sudoers
+(when (memq 'etc-sudoers-generic-mode generic-extras-enable-list)
+
+(define-generic-mode etc-sudoers-generic-mode
+  '(?#)
+  '("User_Alias" "Runas_Alias" "Host_Alias"  "Cmnd_Alias"
+    "NOPASSWD" "PASSWD" "NOEXEC" "EXEC"
+    "ALL")
+  '(("\\<\\(root\\|su\\)\\>" 1 font-lock-warning-face)
+    ("\\(\\*\\)" 1 font-lock-warning-face)
+    ("\\<\\(%[A-Za-z0-9_]+\\)\\>" 1 font-lock-variable-name-face))
+  '("/etc/sudoers\\'")
+  nil
+  "Generic mode for sudoers configuration files."))
+
 ;; From Jacques Duthen <jacques.duthen@sncf.fr>
 (when (memq 'show-tabs-generic-mode generic-extras-enable-list)