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
a0c9f21b
Commit
a0c9f21b
authored
May 31, 1993
by
Richard M. Stallman
Browse files
(inhibit-local-variables-regexps): New variable.
(set-auto-mode): Handle inhibit-local-variables-regexps.
parent
f8bc869a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
lisp/files.el
lisp/files.el
+11
-0
No files found.
lisp/files.el
View file @
a0c9f21b
...
...
@@ -790,6 +790,9 @@ Alist of filename patterns vs corresponding major mode functions.
Each
element
looks
like
(
REGEXP
.
FUNCTION
)
.
Visiting
a
file
whose
name
matches
REGEXP
causes
FUNCTION
to
be
called.
")
(defconst inhibit-local-variables-regexps '("
\\.tar$
")
"
List
of
regexps
; if one matches a file name, don't look for local vars.")
(
defun
set-auto-mode
()
"Select major mode appropriate for current buffer.
This checks for a -*- mode tag in the buffer's text, or
...
...
@@ -805,6 +808,14 @@ If `enable-local-variables' is nil, this function does not check for a
(
goto-char
(
point-min
))
(
skip-chars-forward
" \t\n"
)
(
if
(
and
enable-local-variables
;; Don't look for -*- if this file name matches any
;; of the regexps in inhibit-local-variables-regexps.
(
not
(
let
((
temp
inhibit-local-variables-regexps
))
(
while
(
and
temp
(
not
(
string-match
(
car
temp
)
buffer-file-name
)))
(
setq
temp
(
cdr
temp
)))
(
not
temp
)))
(
search-forward
"-*-"
(
save-excursion
;; If the file begins with "#!"
;; (exec interpreter magic), look
...
...
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