[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/files.el,v [EMACS_22_BASE]
From: |
Richard M. Stallman |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/files.el,v [EMACS_22_BASE] |
Date: |
Wed, 26 Dec 2007 17:29:04 +0000 |
CVSROOT: /cvsroot/emacs
Module name: emacs
Branch: EMACS_22_BASE
Changes by: Richard M. Stallman <rms> 07/12/26 17:29:03
Index: files.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/files.el,v
retrieving revision 1.896.2.33
retrieving revision 1.896.2.34
diff -u -b -r1.896.2.33 -r1.896.2.34
--- files.el 23 Dec 2007 16:08:30 -0000 1.896.2.33
+++ files.el 26 Dec 2007 17:29:03 -0000 1.896.2.34
@@ -2029,7 +2029,7 @@
("java.+\\.conf\\'" . conf-javaprop-mode)
("\\.properties\\(?:\\.[a-zA-Z0-9._-]+\\)?\\'" . conf-javaprop-mode)
;; *.cf, *.cfg, *.conf, *.config[.local|.de_DE.UTF8|...], */config
- ("[/.]c\\(?:on\\)?f\\(?:i?g\\)?\\(?:\\.[a-zA-Z0-9._-]+\\)?\\'" .
conf-mode)
+ ("[/.]c\\(?:on\\)?f\\(?:i?g\\)?\\(?:\\.[a-zA-Z0-9._-]+\\)?\\'" .
conf-mode-maybe)
("\\`/etc/\\(?:DIR_COLORS\\|ethers\\|.?fstab\\|.*hosts\\|lesskey\\|login\\.?de\\(?:fs\\|vperm\\)\\|magic\\|mtab\\|pam\\.d/.*\\|permissions\\(?:\\.d/.+\\)?\\|protocols\\|rpc\\|services\\)\\'"
. conf-space-mode)
("\\`/etc/\\(?:acpid?/.+\\|aliases\\(?:\\.d/.+\\)?\\|default/.+\\|group-?\\|hosts\\..+\\|inittab\\|ksysguarddrc\\|opera6rc\\|passwd-?\\|shadow-?\\|sysconfig/.+\\)\\'"
. conf-mode)
;; ChangeLog.old etc. Other change-log-mode entries are above;
@@ -2076,6 +2076,16 @@
based on the interpreters they specify to run,
and `magic-mode-alist', which determines modes based on file contents.")
+(defun conf-mode-maybe ()
+ "Select Conf mode or XML mode according to start of file."
+ (if (save-excursion
+ (save-restriction
+ (widen)
+ (goto-char (point-min))
+ (looking-at "<\\?xml \\|<!-- \\|<!DOCTYPE ")))
+ (xml-mode)
+ (conf-mode)))
+
(defvar interpreter-mode-alist
;; Note: The entries for the modes defined in cc-mode.el (awk-mode
;; and pike-mode) are added through autoload directives in that