From: Karl Heuer Date: Sat, 15 May 1999 05:57:39 +0000 (+0000) Subject: (sh-mode): Do not fail if buffer has no X-Git-Tag: emacs-20.4~219 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1448f5894e3bcd114b20604165dd42d97f1bd37f;p=emacs.git (sh-mode): Do not fail if buffer has no magic number and is not associated with a file. --- diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 22dae00d40c..44d70931f66 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el @@ -774,8 +774,9 @@ with your script for an edit-interpret-debug cycle." (save-excursion (goto-char (point-min)) (cond ((looking-at "#![ \t]?\\([^ \t\n]*/bin/env[ \t]\\)?\\([^ \t\n]+\\)") - (match-string 2)) - ((string-match "\\.m?spec$" buffer-file-name) + (match-string 2)) + ((and buffer-file-name + (string-match "\\.m?spec$" buffer-file-name)) "rpm"))))) (if interpreter (sh-set-shell interpreter nil nil)