emacs-diffs
[Top][All Lists]
Advanced

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

master cbfce82: Make shell-command use comint settings


From: Lars Ingebrigtsen
Subject: master cbfce82: Make shell-command use comint settings
Date: Fri, 4 Dec 2020 05:06:57 -0500 (EST)

branch: master
commit cbfce827ace4c410a2eed50c8d8c763721925b7e
Author: Alyssa Ross <hi@alyssa.is>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Make shell-command use comint settings
    
    * lisp/simple.el (shell-command): Use the term environment from
    comint, so that comint settings are used for commands like
    `async-shell-command', too (bug#45034).
    
    Copyright-paperwork-exempt: yes
---
 lisp/simple.el | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/lisp/simple.el b/lisp/simple.el
index 7d0c229..4356e40 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -3786,6 +3786,7 @@ a shell (with its need to quote arguments)."
   (shell-command command output-buffer error-buffer))
 
 (declare-function comint-output-filter "comint" (process string))
+(declare-function comint-term-environment "comint")
 
 (defun shell-command (command &optional output-buffer error-buffer)
   "Execute string COMMAND in inferior shell; display output, if any.
@@ -3965,10 +3966,13 @@ impose the use of a shell (with its need to quote 
arguments)."
                   (shell-command-save-pos-or-erase)
                  (setq default-directory directory)
                  (let ((process-environment
-                        (if (natnump async-shell-command-width)
-                            (cons (format "COLUMNS=%d" 
async-shell-command-width)
-                                  process-environment)
-                          process-environment)))
+                         (append
+                          (comint-term-environment)
+                          (and (natnump async-shell-command-width)
+                               (list
+                                (format "COLUMNS=%d"
+                                        async-shell-command-width)))
+                          process-environment)))
                    (setq proc
                          (start-process-shell-command "Shell" buffer command)))
                  (setq mode-line-process '(":%s"))



reply via email to

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