aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRansom Williams2012-05-04 23:21:47 -0400
committerStefan Monnier2012-05-04 23:21:47 -0400
commit248da2f497e8865e8bebb0e3adb9184ab36e95f2 (patch)
tree240db37a75dfcf790e0d59eabf3144d8fc8740cb
parentdf96ab1e0a29e4d178b1406ceacc70d5f9e5c2d6 (diff)
downloademacs-248da2f497e8865e8bebb0e3adb9184ab36e95f2.tar.gz
emacs-248da2f497e8865e8bebb0e3adb9184ab36e95f2.zip
* lisp/files.el (file-auto-mode-skip): New var.
(set-auto-mode-1): Use it.
-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 @@
12012-05-05 Ransom Williams <auvergnerw@gmail.com> (tiny change)
2
3 * files.el (file-auto-mode-skip): New var.
4 (set-auto-mode-1): Use it.
5
12012-05-05 Stefan Monnier <monnier@iro.umontreal.ca> 62012-05-05 Stefan Monnier <monnier@iro.umontreal.ca>
2 7
3 * repeat.el: Use lexical-binding. 8 * 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."
2782 (funcall mode) 2782 (funcall mode)
2783 mode))) 2783 mode)))
2784 2784
2785(defvar file-auto-mode-skip "^\\(#!\\|'\\\\\"\\)"
2786 "Regexp of lines to skip when looking for file-local settings.
2787If the first line matches this regular expression, then the -*-...-*- file-
2788local settings will be consulted on the second line instead of the first.")
2789
2785(defun set-auto-mode-1 () 2790(defun set-auto-mode-1 ()
2786 "Find the -*- spec in the buffer. 2791 "Find the -*- spec in the buffer.
2787Call with point at the place to start searching from. 2792Call with point at the place to start searching from.
@@ -2804,7 +2809,7 @@ have no effect."
2804 ;; interpreter invocation. The same holds 2809 ;; interpreter invocation. The same holds
2805 ;; for '\" in man pages (preprocessor 2810 ;; for '\" in man pages (preprocessor
2806 ;; magic for the `man' program). 2811 ;; magic for the `man' program).
2807 (and (looking-at "^\\(#!\\|'\\\\\"\\)") 2)) t) 2812 (and (looking-at file-auto-mode-skip) 2)) t)
2808 (progn 2813 (progn
2809 (skip-chars-forward " \t") 2814 (skip-chars-forward " \t")
2810 (setq beg (point)) 2815 (setq beg (point))