From: Eli Zaretskii Date: Fri, 16 Dec 2005 15:44:39 +0000 (+0000) Subject: (set-auto-mode): If search for mode specification failed, look for an X-Git-Tag: emacs-pretest-22.0.90~5241 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ec6328a24a5b7e1fb3e307b276dc8ed07f2f3816;p=emacs.git (set-auto-mode): If search for mode specification failed, look for an interpreter specified on the first line. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4fa3538b30e..a442970132a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2005-12-16 Klaus Zeitler + + * files.el (set-auto-mode): Look for an interpreter specified on + the first line also if search for mode specification succeeded, + but the mode is not known. + 2005-12-16 Carsten Dominik * textmodes/org.el: (org-tags-match-list-sublevels): New option. diff --git a/lisp/files.el b/lisp/files.el index df78985e3be..bb2342c2cef 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2098,7 +2098,8 @@ only set the major mode, if that would change it." (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))))) + (throw 'nop nil)))))) + (unless done ;; 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 ;; finds the interpreter anywhere in $PATH.