emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-24 r108130: * lisp/files.el (file-aut


From: Stefan Monnier
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-24 r108130: * lisp/files.el (file-auto-mode-skip): New var.
Date: Fri, 02 Nov 2012 02:32:11 -0000
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 108130
author: Ransom Williams <address@hidden>
committer: Stefan Monnier <address@hidden>
branch nick: trunk
timestamp: Fri 2012-05-04 23:21:47 -0400
message:
  * lisp/files.el (file-auto-mode-skip): New var.
  (set-auto-mode-1): Use it.
modified:
  lisp/ChangeLog
  lisp/files.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-05-05 02:50:20 +0000
+++ b/lisp/ChangeLog    2012-05-05 03:21:47 +0000
@@ -1,3 +1,8 @@
+2012-05-05  Ransom Williams  <address@hidden>  (tiny change)
+
+       * files.el (file-auto-mode-skip): New var.
+       (set-auto-mode-1): Use it.
+
 2012-05-05  Stefan Monnier  <address@hidden>
 
        * repeat.el: Use lexical-binding.

=== modified file 'lisp/files.el'
--- a/lisp/files.el     2012-05-04 23:16:47 +0000
+++ b/lisp/files.el     2012-05-05 03:21:47 +0000
@@ -2782,6 +2782,11 @@
       (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 @@
                             ;; 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))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]