Mercurial > emacs
changeset 24730:e1cb8de8ffb2
(sh-mode): Do not fail if buffer has no
magic number and is not associated with a file.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Sat, 15 May 1999 05:57:39 +0000 |
parents | c16f7defd588 |
children | d305965638f7 |
files | lisp/progmodes/sh-script.el |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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)