changeset 57945:a705018ca13b

(set-auto-mode): Don't get error after setting -*-mode-*-.
author Daniel Pfeiffer <occitan@esperanto.org>
date Thu, 04 Nov 2004 20:25:08 +0000
parents d0ac3dd83e07
children de92b2015bb2
files lisp/files.el
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/files.el	Thu Nov 04 20:24:29 2004 +0000
+++ b/lisp/files.el	Thu Nov 04 20:25:08 2004 +0000
@@ -1912,6 +1912,7 @@
 		(message "Ignoring unknown mode `%s'" mode)
 	      (setq done t)
 	      (or (set-auto-mode-0 mode keep-mode-if-same)
+		  ;; continuing would call minor modes again, toggling them off
 		  (throw 'nop nil)))))
       ;; If we didn't, look for an interpreter specified in the first line.
       ;; As a special case, allow for things like "#!/bin/env perl", which
@@ -1924,10 +1925,11 @@
 	    ;; Map interpreter name to a mode, signalling we're done at the
 	    ;; same time.
 	    done (assoc (file-name-nondirectory mode)
-			interpreter-mode-alist)))
+			interpreter-mode-alist))
+      (if done
+	  (set-auto-mode-0 (cdr done) keep-mode-if-same)))
     ;; If we found an interpreter mode to use, invoke it now.
-    (if done
-	(set-auto-mode-0 (cdr done) keep-mode-if-same)
+    (unless done
       (if (setq done (save-excursion
 		       (goto-char (point-min))
 		       (assoc-default nil magic-mode-alist