summaryrefslogtreecommitdiff
path: root/lisp/files.el
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2007-12-28 22:26:14 +0000
committerMiles Bader <miles@gnu.org>2007-12-28 22:26:14 +0000
commitb17f53abc28496125965f36147b76ea5f6a2b4fb (patch)
tree4293e53692f304327ba689dfeea32d1b0b5bc12a /lisp/files.el
parent2e5093251c8e63f4546ffc30182dd4015e9a58fd (diff)
parentea7ac2eb953bf3c30670e60cb00a9fca611b38b7 (diff)
downloademacs-b17f53abc28496125965f36147b76ea5f6a2b4fb.tar.gz
Merge from emacs--rel--22
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-966
Diffstat (limited to 'lisp/files.el')
-rw-r--r--lisp/files.el17
1 files changed, 15 insertions, 2 deletions
diff --git a/lisp/files.el b/lisp/files.el
index 70a07ea5eff..dec47ce362e 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -525,7 +525,10 @@ using \\[toggle-read-only]."
:group 'view)
(defvar file-name-history nil
- "History list of file names entered in the minibuffer.")
+ "History list of file names entered in the minibuffer.
+
+Maximum length of the history list is determined by the value
+of `history-length', which see.")
(put 'ange-ftp-completion-hook-function 'safe-magic t)
(defun ange-ftp-completion-hook-function (op &rest args)
@@ -2092,7 +2095,7 @@ ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\)\\'" . archive-mode)
("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;
@@ -2139,6 +2142,16 @@ See also `interpreter-mode-alist', which detects executable script modes
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