# HG changeset patch # User Karl Heuer # Date 926747859 0 # Node ID e1cb8de8ffb28518cb7849976c57602d9487c010 # Parent c16f7defd5888489b66a48a28dd2d0ffc6442476 (sh-mode): Do not fail if buffer has no magic number and is not associated with a file. diff -r c16f7defd588 -r e1cb8de8ffb2 lisp/progmodes/sh-script.el --- a/lisp/progmodes/sh-script.el Fri May 14 15:50:20 1999 +0000 +++ b/lisp/progmodes/sh-script.el Sat May 15 05:57:39 1999 +0000 @@ -774,8 +774,9 @@ (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)