unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Philipp Stephani <p.stephani2@gmail.com>
To: emacs-devel@gnu.org
Cc: Philipp Stephani <phst@google.com>
Subject: [PATCH 2/3] Don't print "process finished" into the stderr buffer.
Date: Wed,  4 Apr 2018 14:02:17 +0200	[thread overview]
Message-ID: <20180404120218.257212-2-phst@google.com> (raw)
In-Reply-To: <20180404120218.257212-1-phst@google.com>

* 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




  reply	other threads:[~2018-04-04 12:02 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-04 12:02 [PATCH 1/3] Document that 'make-process' mixes the output streams Philipp Stephani
2018-04-04 12:02 ` Philipp Stephani [this message]
2018-04-04 13:14   ` [PATCH 2/3] Don't print "process finished" into the stderr buffer Eli Zaretskii
2018-04-07 20:21     ` Philipp Stephani
2018-04-08 13:13       ` Eli Zaretskii
2018-04-10  4:14         ` Stephen Leake
2018-04-10  4:59           ` Eli Zaretskii
2019-04-19 19:28         ` Philipp Stephani
2019-04-20  7:30           ` Eli Zaretskii
2019-04-21 13:55             ` Philipp Stephani
2019-04-21 19:09               ` Eli Zaretskii
2019-04-21 20:57             ` Stefan Monnier
2019-04-22  9:37               ` Eli Zaretskii
2019-04-22 14:43                 ` Stefan Monnier
2019-04-22 15:23                   ` Eli Zaretskii
2019-04-22 15:45                     ` Philipp Stephani
2019-04-22 15:52                       ` Eli Zaretskii
2018-04-04 12:02 ` [PATCH 3/3] Inherit process output coding system to stderr process Philipp Stephani
2018-04-04 13:39   ` Eli Zaretskii
2018-04-07 21:12     ` Philipp Stephani
2018-04-08 13:18       ` Eli Zaretskii
2018-04-08 16:39         ` Eli Zaretskii
2018-04-04 13:12 ` [PATCH 1/3] Document that 'make-process' mixes the output streams Eli Zaretskii
2018-04-07 20:18   ` Philipp Stephani

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180404120218.257212-2-phst@google.com \
    --to=p.stephani2@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=phst@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).