emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 5c5e309: Remove :stop key from make-process.


From: Philipp Stephani
Subject: [Emacs-diffs] master 5c5e309: Remove :stop key from make-process.
Date: Fri, 19 Apr 2019 08:14:17 -0400 (EDT)

branch: master
commit 5c5e309527e6b582e2c04b83e7af45f3144863ac
Author: Philipp Stephani <address@hidden>
Commit: Philipp Stephani <address@hidden>

    Remove :stop key from make-process.
    
    This has never worked and caused issues such as Bug#30460.
    
    * src/process.c (Fmake_process): Don't accept :stop key any more.
    (syms_of_process): Define needed symbol 'null'.
    
    * test/src/process-tests.el (make-process/stop): New unit test.
    
    * doc/lispref/processes.texi (Asynchronous Processes): Remove :stop
    key from manual.
---
 doc/lispref/processes.texi |  4 +++-
 etc/NEWS                   |  3 +++
 src/process.c              | 17 +++++++++++------
 test/src/process-tests.el  |  9 +++++++++
 4 files changed, 26 insertions(+), 7 deletions(-)

diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi
index 6be311b..43009b3 100644
--- a/doc/lispref/processes.texi
+++ b/doc/lispref/processes.texi
@@ -678,7 +678,9 @@ Initialize the process query flag to @var{query-flag}.
 @xref{Query Before Exit}.
 
 @item :stop @var{stopped}
-If @var{stopped} is address@hidden, start the process in the
address@hidden must be @code{nil}.  The @code{:stop} key is ignored
+otherwise and is retained for compatibility with other process types
+such as pipe processes.  Asynchronous subprocesses never start in the
 stopped state.
 
 @item :filter @var{filter}
diff --git a/etc/NEWS b/etc/NEWS
index 3e3454b..4d76143 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1515,6 +1515,9 @@ The global value of 'indent-line-function', which 
defaults to
 To get back the old behavior, add a function to 'text-mode-hook' which
 performs (setq-local indent-line-function #'indent-relative).
 
+** 'make-process' no longer accepts a non-nil ':stop' key.  This has
+never worked reliably, and now causes an error.
+
 
 * Lisp Changes in Emacs 27.1
 
diff --git a/src/process.c b/src/process.c
index 0c44037..6717ccb 100644
--- a/src/process.c
+++ b/src/process.c
@@ -1643,10 +1643,11 @@ ENCODING is used for writing.
 :noquery BOOL -- When exiting Emacs, query the user if BOOL is nil and
 the process is running.  If BOOL is not given, query before exiting.
 
-:stop BOOL -- Start process in the `stopped' state if BOOL non-nil.
-In the stopped state, a process does not accept incoming data, but you
-can send outgoing data.  The stopped state is cleared by
-`continue-process' and set by `stop-process'.
+:stop BOOL -- BOOL must be nil.  The `:stop' key is ignored otherwise
+and is retained for compatibility with other process types such as
+pipe processes.  Asynchronous subprocesses never start in the
+`stopped' state.  Use `stop-process' and `continue-process' to send
+signals to stop and continue a process.
 
 :connection-type TYPE -- TYPE is control type of device used to
 communicate with subprocesses.  Values are `pipe' to use a pipe, `pty'
@@ -1746,8 +1747,10 @@ usage: (make-process &rest ARGS)  */)
 
   if (!query_on_exit)
     XPROCESS (proc)->kill_without_query = 1;
-  if (tem = Fplist_get (contact, QCstop), !NILP (tem))
-    pset_command (XPROCESS (proc), Qt);
+  tem = Fplist_get (contact, QCstop);
+  /* Normal processes can't be started in a stopped state, see
+     Bug#30460.  */
+  CHECK_TYPE (NILP (tem), Qnull, tem);
 
   tem = Fplist_get (contact, QCconnection_type);
   if (EQ (tem, Qpty))
@@ -8300,6 +8303,8 @@ returns non-`nil'.  */);
          "internal-default-interrupt-process");
   DEFSYM (Qinterrupt_process_functions, "interrupt-process-functions");
 
+  DEFSYM (Qnull, "null");
+
   defsubr (&Sprocessp);
   defsubr (&Sget_process);
   defsubr (&Sdelete_process);
diff --git a/test/src/process-tests.el b/test/src/process-tests.el
index 0bb7ebe..b853f77 100644
--- a/test/src/process-tests.el
+++ b/test/src/process-tests.el
@@ -284,5 +284,14 @@ file name handler."
 (put #'process-tests--file-handler 'operations
      '(unhandled-file-name-directory make-process))
 
+(ert-deftest make-process/stop ()
+  "Check that `make-process' doesn't accept a `:stop' key.
+See Bug#30460."
+  (should-error
+   (make-process :name "test"
+                 :command (list (expand-file-name invocation-name
+                                                  invocation-directory))
+                 :stop t)))
+
 (provide 'process-tests)
 ;; process-tests.el ends here.



reply via email to

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