diff options
author | Richard M. Stallman <[email protected]> | 1993-05-31 21:50:52 +0000 |
---|---|---|
committer | Richard M. Stallman <[email protected]> | 1993-05-31 21:50:52 +0000 |
commit | a0c9f21b2d32bb5f44e4954eb5b3465fc73510a4 (patch) | |
tree | 614f687913758cdfb53506ee828b7aa882a2be2e | |
parent | f8bc869a313bf255d35e0c1d255eb5aaa8296f24 (diff) |
(inhibit-local-variables-regexps): New variable.
(set-auto-mode): Handle inhibit-local-variables-regexps.
-rw-r--r-- | lisp/files.el | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lisp/files.el b/lisp/files.el index 83322d05aa..33d889dd5f 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -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 |