]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/files.el (file-auto-mode-skip): New var.
authorRansom Williams <auvergnerw@gmail.com>
Sat, 5 May 2012 03:21:47 +0000 (23:21 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Sat, 5 May 2012 03:21:47 +0000 (23:21 -0400)
(set-auto-mode-1): Use it.

lisp/ChangeLog
lisp/files.el

index 664c7734f1a8fedabbd986d47e75d491f672dd98..fcefb166ecbdfda2a8fa370663c9fe56941ad392 100644 (file)
@@ -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.
index dd80ce69811af5499c2382aca9601b789536bdbb..f2302c2dd48caab89fb36709eff8081c39ec594b 100644 (file)
@@ -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))