# HG changeset patch # User Richard M. Stallman # Date 738885052 0 # Node ID 3dd9b89c6a17bdc61e395ff3dcafec7a3767a8b9 # Parent 6dec27d736e26cec9ef9c45f1fd0be629f43c026 (inhibit-local-variables-regexps): New variable. (set-auto-mode): Handle inhibit-local-variables-regexps. diff -r 6dec27d736e2 -r 3dd9b89c6a17 lisp/files.el --- a/lisp/files.el Mon May 31 21:28:36 1993 +0000 +++ b/lisp/files.el Mon May 31 21:50:52 1993 +0000 @@ -790,6 +790,9 @@ 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 @@ (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