diff options
| author | Karl Heuer | 1996-07-15 20:17:53 +0000 |
|---|---|---|
| committer | Karl Heuer | 1996-07-15 20:17:53 +0000 |
| commit | c14c7a05113ebc6ae6da859c680becf8cdd7b754 (patch) | |
| tree | 5d2592b5b2d3ac2c02062ac57afeb24f5d8e15b5 | |
| parent | 57810560535b0edda4718aaf98410809c739a4e6 (diff) | |
| download | emacs-c14c7a05113ebc6ae6da859c680becf8cdd7b754.tar.gz emacs-c14c7a05113ebc6ae6da859c680becf8cdd7b754.zip | |
(sh-mode): Call sh-set-shell only for a writable
empty buffer.
| -rw-r--r-- | lisp/progmodes/sh-script.el | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el index 51923ee2795..fbcdf5c8dbc 100644 --- a/lisp/progmodes/sh-script.el +++ b/lisp/progmodes/sh-script.el | |||
| @@ -662,10 +662,9 @@ with your script for an edit-interpret-debug cycle." | |||
| 662 | ;; parse or insert magic number for exec() and set all variables depending | 662 | ;; parse or insert magic number for exec() and set all variables depending |
| 663 | ;; on the shell thus determined | 663 | ;; on the shell thus determined |
| 664 | (goto-char (point-min)) | 664 | (goto-char (point-min)) |
| 665 | (sh-set-shell | 665 | (and (zerop (buffer-size)) |
| 666 | (if (looking-at "#![\t ]*\\([^\t\n ]+\\)") | 666 | (not buffer-read-only) |
| 667 | (match-string 1) | 667 | (sh-set-shell sh-shell-file))) |
| 668 | sh-shell-file))) | ||
| 669 | (run-hooks 'sh-mode-hook)) | 668 | (run-hooks 'sh-mode-hook)) |
| 670 | ;;;###autoload | 669 | ;;;###autoload |
| 671 | (defalias 'shell-script-mode 'sh-mode) | 670 | (defalias 'shell-script-mode 'sh-mode) |