Commit 1448f589 authored by Karl Heuer's avatar Karl Heuer
Browse files

(sh-mode): Do not fail if buffer has no

magic number and is not associated with a file.
parent a62a0574
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment