aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Pfeiffer2004-11-04 20:25:08 +0000
committerDaniel Pfeiffer2004-11-04 20:25:08 +0000
commitdf4d061346b75da5366205536c74ac6442abbd7e (patch)
tree88c254e8eae74bf220b49a7b7b85ca8e5469288d
parent5dcd636bafa5ea99c11559e3a89bbbbaef604f52 (diff)
downloademacs-df4d061346b75da5366205536c74ac6442abbd7e.tar.gz
emacs-df4d061346b75da5366205536c74ac6442abbd7e.zip
(set-auto-mode): Don't get error after setting -*-mode-*-.
-rw-r--r--lisp/files.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/files.el b/lisp/files.el
index e9ae0fb834f..6ade94cd14d 100644
--- a/lisp/files.el
+++ b/lisp/files.el
@@ -1912,6 +1912,7 @@ only set the major mode, if that would change it."
1912 (message "Ignoring unknown mode `%s'" mode) 1912 (message "Ignoring unknown mode `%s'" mode)
1913 (setq done t) 1913 (setq done t)
1914 (or (set-auto-mode-0 mode keep-mode-if-same) 1914 (or (set-auto-mode-0 mode keep-mode-if-same)
1915 ;; continuing would call minor modes again, toggling them off
1915 (throw 'nop nil))))) 1916 (throw 'nop nil)))))
1916 ;; If we didn't, look for an interpreter specified in the first line. 1917 ;; If we didn't, look for an interpreter specified in the first line.
1917 ;; As a special case, allow for things like "#!/bin/env perl", which 1918 ;; As a special case, allow for things like "#!/bin/env perl", which
@@ -1924,10 +1925,11 @@ only set the major mode, if that would change it."
1924 ;; Map interpreter name to a mode, signalling we're done at the 1925 ;; Map interpreter name to a mode, signalling we're done at the
1925 ;; same time. 1926 ;; same time.
1926 done (assoc (file-name-nondirectory mode) 1927 done (assoc (file-name-nondirectory mode)
1927 interpreter-mode-alist))) 1928 interpreter-mode-alist))
1929 (if done
1930 (set-auto-mode-0 (cdr done) keep-mode-if-same)))
1928 ;; If we found an interpreter mode to use, invoke it now. 1931 ;; If we found an interpreter mode to use, invoke it now.
1929 (if done 1932 (unless done
1930 (set-auto-mode-0 (cdr done) keep-mode-if-same)
1931 (if (setq done (save-excursion 1933 (if (setq done (save-excursion
1932 (goto-char (point-min)) 1934 (goto-char (point-min))
1933 (assoc-default nil magic-mode-alist 1935 (assoc-default nil magic-mode-alist