[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 2/3] Don't print "process finished" into the stderr buffer.
From: |
Philipp Stephani |
Subject: |
[PATCH 2/3] Don't print "process finished" into the stderr buffer. |
Date: |
Wed, 4 Apr 2018 14:02:17 +0200 |
* src/process.c (syms_of_process): Add 'ignore' symbol.
(Fmake_process): Use it as sentinel for the standard error pipe
process.
* test/src/process-tests.el (make-process/stderr-sentinel): New unit
test.
---
src/process.c | 5 ++++-
test/src/process-tests.el | 18 ++++++++++++++++++
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/src/process.c b/src/process.c
index c357a8bdc3..dcc9dcb31e 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1714,7 +1714,9 @@ usage: (make-process &rest ARGS) */)
QCbuffer,
Fget_buffer_create (xstderr),
QCnoquery,
- query_on_exit ? Qnil : Qt);
+ query_on_exit ? Qnil : Qt,
+ QCsentinel,
+ Qignore);
}
proc = make_process (name);
@@ -8184,6 +8186,7 @@ syms_of_process (void)
"internal-default-process-sentinel");
DEFSYM (Qinternal_default_process_filter,
"internal-default-process-filter");
+ DEFSYM (Qignore, "ignore");
#endif
DEFSYM (Qpri, "pri");
DEFSYM (Qnice, "nice");
diff --git a/test/src/process-tests.el b/test/src/process-tests.el
index b1b4665c3c..838ba78acb 100644
--- a/test/src/process-tests.el
+++ b/test/src/process-tests.el
@@ -199,5 +199,23 @@ process-test-sentinel-wait-function-working-p
(should (eq (process-exit-status process) 0))
(should (equal (buffer-string) "stdout\nstderr\n")))))
+(ert-deftest make-process/stderr-sentinel ()
+ "Check that `make-process' doesn't install the default sentinel for stderr."
+ (skip-unless (executable-find shell-file-name))
+ (with-temp-buffer
+ (let ((process (make-process
+ :name "stderr-sentinel"
+ :command (list shell-file-name shell-command-switch
+ "echo stderr >&2")
+ :buffer nil
+ :stderr (current-buffer)
+ :noquery t
+ :connection-type 'pipe)))
+ (while (process-live-p process)
+ (accept-process-output process))
+ (should (eq (process-status process) 'exit))
+ (should (eq (process-exit-status process) 0))
+ (should (equal (buffer-string) "stderr\n")))))
+
(provide 'process-tests)
;; process-tests.el ends here.
--
2.17.0.484.g0c8726318c-goog
[PATCH 3/3] Inherit process output coding system to stderr process., Philipp Stephani, 2018/04/04