Commit c14c7a05 authored by Karl Heuer's avatar Karl Heuer
Browse files

(sh-mode): Call sh-set-shell only for a writable

empty buffer.
parent 57810560
......@@ -662,10 +662,9 @@ with your script for an edit-interpret-debug cycle."
;; parse or insert magic number for exec() and set all variables depending
;; on the shell thus determined
(goto-char (point-min))
(if (looking-at "#![\t ]*\\([^\t\n ]+\\)")
(match-string 1)
(and (zerop (buffer-size))
(not buffer-read-only)
(sh-set-shell sh-shell-file)))
(run-hooks 'sh-mode-hook))
(defalias 'shell-script-mode 'sh-mode)
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