changeset 87179:5ab752d82a12

(etc-sudoers-generic-mode): New mode. (generic-unix-modes): Add it.
author Reiner Steib <Reiner.Steib@gmx.de>
date Sat, 08 Dec 2007 14:32:28 +0000
parents 81d86af942c9
children c50e8341c802
files lisp/ChangeLog lisp/generic-x.el
diffstat 2 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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)