diff options
author | Karl Heuer <kwzh@gnu.org> | 1999-05-15 05:57:39 +0000 |
---|---|---|
committer | Karl Heuer <kwzh@gnu.org> | 1999-05-15 05:57:39 +0000 |
commit | 1448f5894e3bcd114b20604165dd42d97f1bd37f (patch) | |
tree | cf5e081afd7e396872122fc129ebc54671cc38ba /lisp | |
parent | a62a0574d4d935048022a6e0a9856c1fecf07dea (diff) | |
download | emacs-1448f5894e3bcd114b20604165dd42d97f1bd37f.tar.gz emacs-1448f5894e3bcd114b20604165dd42d97f1bd37f.tar.bz2 emacs-1448f5894e3bcd114b20604165dd42d97f1bd37f.zip |
(sh-mode): Do not fail if buffer has no
magic number and is not associated with a file.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/progmodes/sh-script.el | 5 |
1 files changed, 3 insertions, 2 deletions
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) |