]> git.eshelyaron.com Git - emacs.git/commitdiff
(sh-mode): Do not fail if buffer has no
authorKarl Heuer <kwzh@gnu.org>
Sat, 15 May 1999 05:57:39 +0000 (05:57 +0000)
committerKarl Heuer <kwzh@gnu.org>
Sat, 15 May 1999 05:57:39 +0000 (05:57 +0000)
magic number and is not associated with a file.

lisp/progmodes/sh-script.el

index 22dae00d40c02817f9a1ed5a477a00dab65a63c6..44d70931f66f6e7601b6df32e6a102b87be5f198 100644 (file)
@@ -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)