summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorRansom Williams <auvergnerw@gmail.com>2012-05-04 23:21:47 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2012-05-04 23:21:47 -0400
commit248da2f497e8865e8bebb0e3adb9184ab36e95f2 (patch)
tree240db37a75dfcf790e0d59eabf3144d8fc8740cb /lisp
parentdf96ab1e0a29e4d178b1406ceacc70d5f9e5c2d6 (diff)
downloademacs-248da2f497e8865e8bebb0e3adb9184ab36e95f2.tar.gz
emacs-248da2f497e8865e8bebb0e3adb9184ab36e95f2.tar.bz2
emacs-248da2f497e8865e8bebb0e3adb9184ab36e95f2.zip
* lisp/files.el (file-auto-mode-skip): New var.
(set-auto-mode-1): Use it.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/files.el7
2 files changed, 11 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 664c7734f1a..fcefb166ecb 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2012-05-05 Ransom Williams <auvergnerw@gmail.com> (tiny change)
+
+ * files.el (file-auto-mode-skip): New var.
+ (set-auto-mode-1): Use it.
+
2012-05-05 Stefan Monnier <monnier@iro.umontreal.ca>
* repeat.el: Use lexical-binding.
diff --git a/lisp/files.el b/lisp/files.el
index dd80ce69811..f2302c2dd48 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -2782,6 +2782,11 @@ same, do nothing and return nil."
(funcall mode)
mode)))
+(defvar file-auto-mode-skip "^\\(#!\\|'\\\\\"\\)"
+ "Regexp of lines to skip when looking for file-local settings.
+If the first line matches this regular expression, then the -*-...-*- file-
+local settings will be consulted on the second line instead of the first.")
+
(defun set-auto-mode-1 ()
"Find the -*- spec in the buffer.
Call with point at the place to start searching from.
@@ -2804,7 +2809,7 @@ have no effect."
;; interpreter invocation. The same holds
;; for '\" in man pages (preprocessor
;; magic for the `man' program).
- (and (looking-at "^\\(#!\\|'\\\\\"\\)") 2)) t)
+ (and (looking-at file-auto-mode-skip) 2)) t)
(progn
(skip-chars-forward " \t")
(setq beg (point))