[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master cd1313b: Allow inhibiting inserting #! in sh-set-shell

From: Lars Ingebrigtsen
Subject: master cd1313b: Allow inhibiting inserting #! in sh-set-shell
Date: Thu, 8 Jul 2021 10:23:38 -0400 (EDT)

branch: master
commit cd1313b7f128e19b3a6554b4e410a71da370a66f
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Allow inhibiting inserting #! in sh-set-shell
    * lisp/progmodes/sh-script.el (sh-set-shell): Allow inhibiting
    inserting the #! line (bug#20959).
 lisp/progmodes/sh-script.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index c3a12c5..91db4ae 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -2192,6 +2192,8 @@ Point should be before the newline."
 When used interactively, insert the proper starting #!-line,
 and make the visited file executable via `executable-set-magic',
 perhaps querying depending on the value of `executable-query'.
+(If given a prefix (i.e., `C-u') don't insert any starting #!
 When this function is called noninteractively, INSERT-FLAG (the third
 argument) controls whether to insert a #!-line and think about making
@@ -2215,7 +2217,7 @@ whose value is the shell name (don't quote it)."
                               '("csh" "rc" "sh"))
                       nil nil nil nil sh-shell-file)
                     (eq executable-query 'function)
-                    t))
+                    (not current-prefix-arg)))
   (if (string-match "\\.exe\\'" shell)
       (setq shell (substring shell 0 (match-beginning 0))))
   (setq sh-shell (sh-canonicalize-shell shell))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]