aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Ingebrigtsen2021-07-08 16:23:29 +0200
committerLars Ingebrigtsen2021-07-08 16:23:29 +0200
commitcd1313b7f128e19b3a6554b4e410a71da370a66f (patch)
tree1f0b7d25dae1c2f75c00ed875b6834112cd39222
parent57eb0db9dc270278db9d51214fae780f020fef6a (diff)
downloademacs-cd1313b7f128e19b3a6554b4e410a71da370a66f.tar.gz
emacs-cd1313b7f128e19b3a6554b4e410a71da370a66f.zip
Allow inhibiting inserting #! in sh-set-shell
* lisp/progmodes/sh-script.el (sh-set-shell): Allow inhibiting inserting the #! line (bug#20959).
-rw-r--r--lisp/progmodes/sh-script.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index c3a12c5b2c5..91db4ae21cb 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -2192,6 +2192,8 @@ Point should be before the newline."
2192When used interactively, insert the proper starting #!-line, 2192When used interactively, insert the proper starting #!-line,
2193and make the visited file executable via `executable-set-magic', 2193and make the visited file executable via `executable-set-magic',
2194perhaps querying depending on the value of `executable-query'. 2194perhaps querying depending on the value of `executable-query'.
2195(If given a prefix (i.e., `C-u') don't insert any starting #!
2196line.)
2195 2197
2196When this function is called noninteractively, INSERT-FLAG (the third 2198When this function is called noninteractively, INSERT-FLAG (the third
2197argument) controls whether to insert a #!-line and think about making 2199argument) controls whether to insert a #!-line and think about making
@@ -2215,7 +2217,7 @@ whose value is the shell name (don't quote it)."
2215 '("csh" "rc" "sh")) 2217 '("csh" "rc" "sh"))
2216 nil nil nil nil sh-shell-file) 2218 nil nil nil nil sh-shell-file)
2217 (eq executable-query 'function) 2219 (eq executable-query 'function)
2218 t)) 2220 (not current-prefix-arg)))
2219 (if (string-match "\\.exe\\'" shell) 2221 (if (string-match "\\.exe\\'" shell)
2220 (setq shell (substring shell 0 (match-beginning 0)))) 2222 (setq shell (substring shell 0 (match-beginning 0))))
2221 (setq sh-shell (sh-canonicalize-shell shell)) 2223 (setq sh-shell (sh-canonicalize-shell shell))