emacs-diffs
[Top][All Lists]
Advanced

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

master f542a4537e4: ; Improve recent change to printing exit status in E


From: Jim Porter
Subject: master f542a4537e4: ; Improve recent change to printing exit status in Eshell
Date: Tue, 12 Sep 2023 21:17:55 -0400 (EDT)

branch: master
commit f542a4537e430cee38d8ddb9c64e0bef393ae03a
Author: Jim Porter <jporterbugs@gmail.com>
Commit: Jim Porter <jporterbugs@gmail.com>

    ; Improve recent change to printing exit status in Eshell
    
    * lisp/eshell/esh-proc.el (eshell-interactive-filter): Declare.
    (eshell-interactive-process-filter): Simplify.
    (eshell-sentinel): Call 'eshell-interactive-filter'.
    
    * test/lisp/eshell/esh-proc-tests.el
    (esh-proc-test/kill-process/redirect-message): Use
    'eshell-with-temp-buffer'.
---
 lisp/eshell/esh-proc.el            | 6 +++---
 test/lisp/eshell/esh-proc-tests.el | 9 ++++-----
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/lisp/eshell/esh-proc.el b/lisp/eshell/esh-proc.el
index 5bfcbd6dc15..5df68947ec2 100644
--- a/lisp/eshell/esh-proc.el
+++ b/lisp/eshell/esh-proc.el
@@ -112,6 +112,7 @@ To add or remove elements of this list, see
 `eshell-record-process-object' and `eshell-remove-process-entry'.")
 
 (declare-function eshell-send-eof-to-process "esh-mode")
+(declare-function eshell-interactive-filter "esh-mode" (buffer string))
 (declare-function eshell-tail-process "esh-cmd")
 
 (defvar-keymap eshell-proc-mode-map
@@ -437,8 +438,6 @@ This is done after all necessary filtering has been done."
      'process (format-message "received output from process `%s'\n\n%s"
                               process string))
     (eshell--mark-as-output 0 (length string) string)
-    (require 'esh-mode)
-    (declare-function eshell-interactive-filter "esh-mode" (buffer string))
     (eshell-interactive-filter (if process (process-buffer process)
                                  (current-buffer))
                                string)))
@@ -511,7 +510,8 @@ PROC is the process that's exiting.  STRING is the exit 
message."
                        (eshell-interactive-output-p eshell-error-handle 
handles)
                        (not (string-match "^\\(finished\\|exited\\)"
                                           string)))
-              (eshell-output-object string eshell-error-handle handles))
+              (eshell--mark-as-output 0 (length string) string)
+              (eshell-interactive-filter (process-buffer proc) string))
             (process-put proc :eshell-pending nil)
             ;; If we're in the middle of handling output from this
             ;; process then schedule the EOF for later.
diff --git a/test/lisp/eshell/esh-proc-tests.el 
b/test/lisp/eshell/esh-proc-tests.el
index 52f8aeaedbe..d58764ac29f 100644
--- a/test/lisp/eshell/esh-proc-tests.el
+++ b/test/lisp/eshell/esh-proc-tests.el
@@ -316,11 +316,10 @@ write the exit status to the pipe.  See bug#54136."
 (ert-deftest esh-proc-test/kill-process/redirect-message ()
   "Test that killing a process with a redirected stderr omits the exit status."
   (skip-unless (executable-find "sleep"))
-  (with-temp-buffer
-    (let ((tempbuf (current-buffer)))
-      (with-temp-eshell
-       (eshell-insert-command (format "sleep 100 2> #<buffer %s>" tempbuf))
-       (kill-process (eshell-head-process))))
+  (eshell-with-temp-buffer bufname ""
+    (with-temp-eshell
+     (eshell-insert-command (format "sleep 100 2> #<buffer %s>" bufname))
+     (kill-process (eshell-head-process)))
     (should (equal (buffer-string) ""))))
 
 



reply via email to

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