diff options
| author | Richard M. Stallman | 2007-12-26 17:29:34 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2007-12-26 17:29:34 +0000 |
| commit | 73936494a34bc8c474eb7b315ad30ef653df5463 (patch) | |
| tree | a7c308ce5acd0bbde4e00b192bae4715ab805ce3 | |
| parent | a5af675edc7348b16262932edaf4385ef0d45479 (diff) | |
| download | emacs-73936494a34bc8c474eb7b315ad30ef653df5463.tar.gz emacs-73936494a34bc8c474eb7b315ad30ef653df5463.zip | |
(conf-mode-maybe): New function.
(auto-mode-alist): Use conf-mode-maybe for .conf etc.
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/files.el | 12 |
2 files changed, 16 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f24d7c79182..7eb76ce1539 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2007-12-26 Richard Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | * files.el (conf-mode-maybe): New function. | ||
| 4 | (auto-mode-alist): Use conf-mode-maybe for .conf etc. | ||
| 5 | |||
| 1 | 2007-12-26 Martin Rudalics <rudalics@gmx.at> | 6 | 2007-12-26 Martin Rudalics <rudalics@gmx.at> |
| 2 | 7 | ||
| 3 | * textmodes/fill.el (fill-find-break-point): Fix doc-string typo. | 8 | * textmodes/fill.el (fill-find-break-point): Fix doc-string typo. |
diff --git a/lisp/files.el b/lisp/files.el index d4b15324f94..ecfcc963e65 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -2029,7 +2029,7 @@ since only a single case-insensitive search through the alist is made." | |||
| 2029 | ("java.+\\.conf\\'" . conf-javaprop-mode) | 2029 | ("java.+\\.conf\\'" . conf-javaprop-mode) |
| 2030 | ("\\.properties\\(?:\\.[a-zA-Z0-9._-]+\\)?\\'" . conf-javaprop-mode) | 2030 | ("\\.properties\\(?:\\.[a-zA-Z0-9._-]+\\)?\\'" . conf-javaprop-mode) |
| 2031 | ;; *.cf, *.cfg, *.conf, *.config[.local|.de_DE.UTF8|...], */config | 2031 | ;; *.cf, *.cfg, *.conf, *.config[.local|.de_DE.UTF8|...], */config |
| 2032 | ("[/.]c\\(?:on\\)?f\\(?:i?g\\)?\\(?:\\.[a-zA-Z0-9._-]+\\)?\\'" . conf-mode) | 2032 | ("[/.]c\\(?:on\\)?f\\(?:i?g\\)?\\(?:\\.[a-zA-Z0-9._-]+\\)?\\'" . conf-mode-maybe) |
| 2033 | ("\\`/etc/\\(?:DIR_COLORS\\|ethers\\|.?fstab\\|.*hosts\\|lesskey\\|login\\.?de\\(?:fs\\|vperm\\)\\|magic\\|mtab\\|pam\\.d/.*\\|permissions\\(?:\\.d/.+\\)?\\|protocols\\|rpc\\|services\\)\\'" . conf-space-mode) | 2033 | ("\\`/etc/\\(?:DIR_COLORS\\|ethers\\|.?fstab\\|.*hosts\\|lesskey\\|login\\.?de\\(?:fs\\|vperm\\)\\|magic\\|mtab\\|pam\\.d/.*\\|permissions\\(?:\\.d/.+\\)?\\|protocols\\|rpc\\|services\\)\\'" . conf-space-mode) |
| 2034 | ("\\`/etc/\\(?:acpid?/.+\\|aliases\\(?:\\.d/.+\\)?\\|default/.+\\|group-?\\|hosts\\..+\\|inittab\\|ksysguarddrc\\|opera6rc\\|passwd-?\\|shadow-?\\|sysconfig/.+\\)\\'" . conf-mode) | 2034 | ("\\`/etc/\\(?:acpid?/.+\\|aliases\\(?:\\.d/.+\\)?\\|default/.+\\|group-?\\|hosts\\..+\\|inittab\\|ksysguarddrc\\|opera6rc\\|passwd-?\\|shadow-?\\|sysconfig/.+\\)\\'" . conf-mode) |
| 2035 | ;; ChangeLog.old etc. Other change-log-mode entries are above; | 2035 | ;; ChangeLog.old etc. Other change-log-mode entries are above; |
| @@ -2076,6 +2076,16 @@ See also `interpreter-mode-alist', which detects executable script modes | |||
| 2076 | based on the interpreters they specify to run, | 2076 | based on the interpreters they specify to run, |
| 2077 | and `magic-mode-alist', which determines modes based on file contents.") | 2077 | and `magic-mode-alist', which determines modes based on file contents.") |
| 2078 | 2078 | ||
| 2079 | (defun conf-mode-maybe () | ||
| 2080 | "Select Conf mode or XML mode according to start of file." | ||
| 2081 | (if (save-excursion | ||
| 2082 | (save-restriction | ||
| 2083 | (widen) | ||
| 2084 | (goto-char (point-min)) | ||
| 2085 | (looking-at "<\\?xml \\|<!-- \\|<!DOCTYPE "))) | ||
| 2086 | (xml-mode) | ||
| 2087 | (conf-mode))) | ||
| 2088 | |||
| 2079 | (defvar interpreter-mode-alist | 2089 | (defvar interpreter-mode-alist |
| 2080 | ;; Note: The entries for the modes defined in cc-mode.el (awk-mode | 2090 | ;; Note: The entries for the modes defined in cc-mode.el (awk-mode |
| 2081 | ;; and pike-mode) are added through autoload directives in that | 2091 | ;; and pike-mode) are added through autoload directives in that |