]> git.eshelyaron.com Git - emacs.git/commitdiff
Handle better changed default-directory in shell-command
authorMichael Albinus <michael.albinus@gmx.de>
Thu, 27 Mar 2025 16:48:20 +0000 (17:48 +0100)
committerEshel Yaron <me@eshelyaron.com>
Fri, 28 Mar 2025 16:17:36 +0000 (17:17 +0100)
* lisp/simple.el (shell-command): Kill buffer-local values of
`shell-file-name' and `shell-command-switch', there could be left
connection-local values.  (Bug#76888)

(cherry picked from commit 37b8acf3781a65d397a946f621893b07a0960de0)

lisp/simple.el

index 621446b929cf3ab5c65df6d07a18aa3b71b95b09..10eeba4ba45ae6c00a4d27c797c727e90681b685 100644 (file)
@@ -4604,6 +4604,9 @@ impose the use of a shell (with its need to quote arguments)."
              (with-current-buffer buffer
                 (shell-command-save-pos-or-erase)
                (setq default-directory directory)
+                ;; There could be left connection-local values.  (Bug#76888)
+                (kill-local-variable 'shell-file-name)
+                (kill-local-variable 'shell-command-switch)
                 (require 'shell)
                 (let ((process-environment
                        (append