Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
248da2f4
Commit
248da2f4
authored
May 04, 2012
by
Ransom Williams
Committed by
Stefan Monnier
May 04, 2012
Browse files
* lisp/files.el (file-auto-mode-skip): New var.
(set-auto-mode-1): Use it.
parent
df96ab1e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
lisp/ChangeLog
lisp/ChangeLog
+5
-0
lisp/files.el
lisp/files.el
+6
-1
No files found.
lisp/ChangeLog
View file @
248da2f4
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.
...
...
lisp/files.el
View file @
248da2f4
...
...
@@ -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))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment