diff options
| author | Richard M. Stallman | 1995-04-02 02:22:14 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-04-02 02:22:14 +0000 |
| commit | b20ff6d0b709ae7cd35e8f629b7b69c308e809a5 (patch) | |
| tree | 395162b0284d8536792c2f62dc8100076d661f12 | |
| parent | 469f4e8cfcea07d6a1fcd807e2d40dfc223c5e26 (diff) | |
| download | emacs-b20ff6d0b709ae7cd35e8f629b7b69c308e809a5.tar.gz emacs-b20ff6d0b709ae7cd35e8f629b7b69c308e809a5.zip | |
(inhibit-first-line-modes-suffixes): New variable.
(set-auto-mode): Use it.
(inhibit-first-line-modes-regexps): Use \\', not $.
| -rw-r--r-- | lisp/files.el | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lisp/files.el b/lisp/files.el index 0003bd533fe..1a0bc74ea94 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -914,9 +914,14 @@ The car of each element is compared with | |||
| 914 | the name of the interpreter specified in the first line. | 914 | the name of the interpreter specified in the first line. |
| 915 | If it matches, mode MODE is selected.") | 915 | If it matches, mode MODE is selected.") |
| 916 | 916 | ||
| 917 | (defconst inhibit-first-line-modes-regexps '("\\.tar$") | 917 | (defconst inhibit-first-line-modes-regexps '("\\.tar\\'") |
| 918 | "List of regexps; if one matches a file name, don't look for `-*-'.") | 918 | "List of regexps; if one matches a file name, don't look for `-*-'.") |
| 919 | 919 | ||
| 920 | (defconst inhibit-first-line-modes-suffixes nil | ||
| 921 | "List of regexps for what to ignore, for `inhibit-first-line-modes-regexps'. | ||
| 922 | When checking `inhibit-first-line-modes-regexps', we first discard | ||
| 923 | from the end of the file name anything that matches one of these regexps.") | ||
| 924 | |||
| 920 | (defvar user-init-file | 925 | (defvar user-init-file |
| 921 | "" ; set by command-line | 926 | "" ; set by command-line |
| 922 | "File name including directory of user's initialization file.") | 927 | "File name including directory of user's initialization file.") |
| @@ -943,9 +948,10 @@ If `enable-local-variables' is nil, this function does not check for a | |||
| 943 | ;; of the regexps in inhibit-first-line-modes-regexps. | 948 | ;; of the regexps in inhibit-first-line-modes-regexps. |
| 944 | (let ((temp inhibit-first-line-modes-regexps) | 949 | (let ((temp inhibit-first-line-modes-regexps) |
| 945 | (name (file-name-sans-versions buffer-file-name))) | 950 | (name (file-name-sans-versions buffer-file-name))) |
| 951 | (if (string-match inhibit-first-line-modes-suffixes name) | ||
| 952 | (setq name (substring name 0 (match-beginning 0)))) | ||
| 946 | (while (and temp | 953 | (while (and temp |
| 947 | (not (string-match (car temp) | 954 | (not (string-match (car temp) name))) |
| 948 | name))) | ||
| 949 | (setq temp (cdr temp))) | 955 | (setq temp (cdr temp))) |
| 950 | (not temp)) | 956 | (not temp)) |
| 951 | (search-forward "-*-" (save-excursion | 957 | (search-forward "-*-" (save-excursion |