Skip to content

Commit 5c5e309

Browse files
committed
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.
1 parent 3ff7d73 commit 5c5e309

File tree

4 files changed

+26
-7
lines changed

4 files changed

+26
-7
lines changed

doc/lispref/processes.texi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,9 @@ Initialize the process query flag to @var{query-flag}.
678678
@xref{Query Before Exit}.
679679

680680
@item :stop @var{stopped}
681-
If @var{stopped} is non-@code{nil}, start the process in the
681+
@var{stopped} must be @code{nil}. The @code{:stop} key is ignored
682+
otherwise and is retained for compatibility with other process types
683+
such as pipe processes. Asynchronous subprocesses never start in the
682684
stopped state.
683685

684686
@item :filter @var{filter}

etc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,6 +1515,9 @@ The global value of 'indent-line-function', which defaults to
15151515
To get back the old behavior, add a function to 'text-mode-hook' which
15161516
performs (setq-local indent-line-function #'indent-relative).
15171517

1518+
** 'make-process' no longer accepts a non-nil ':stop' key. This has
1519+
never worked reliably, and now causes an error.
1520+
15181521

15191522
* Lisp Changes in Emacs 27.1
15201523

src/process.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,10 +1643,11 @@ ENCODING is used for writing.
16431643
:noquery BOOL -- When exiting Emacs, query the user if BOOL is nil and
16441644
the process is running. If BOOL is not given, query before exiting.
16451645
1646-
:stop BOOL -- Start process in the `stopped' state if BOOL non-nil.
1647-
In the stopped state, a process does not accept incoming data, but you
1648-
can send outgoing data. The stopped state is cleared by
1649-
`continue-process' and set by `stop-process'.
1646+
:stop BOOL -- BOOL must be nil. The `:stop' key is ignored otherwise
1647+
and is retained for compatibility with other process types such as
1648+
pipe processes. Asynchronous subprocesses never start in the
1649+
`stopped' state. Use `stop-process' and `continue-process' to send
1650+
signals to stop and continue a process.
16501651
16511652
:connection-type TYPE -- TYPE is control type of device used to
16521653
communicate with subprocesses. Values are `pipe' to use a pipe, `pty'
@@ -1746,8 +1747,10 @@ usage: (make-process &rest ARGS) */)
17461747

17471748
if (!query_on_exit)
17481749
XPROCESS (proc)->kill_without_query = 1;
1749-
if (tem = Fplist_get (contact, QCstop), !NILP (tem))
1750-
pset_command (XPROCESS (proc), Qt);
1750+
tem = Fplist_get (contact, QCstop);
1751+
/* Normal processes can't be started in a stopped state, see
1752+
Bug#30460. */
1753+
CHECK_TYPE (NILP (tem), Qnull, tem);
17511754

17521755
tem = Fplist_get (contact, QCconnection_type);
17531756
if (EQ (tem, Qpty))
@@ -8300,6 +8303,8 @@ returns non-`nil'. */);
83008303
"internal-default-interrupt-process");
83018304
DEFSYM (Qinterrupt_process_functions, "interrupt-process-functions");
83028305

8306+
DEFSYM (Qnull, "null");
8307+
83038308
defsubr (&Sprocessp);
83048309
defsubr (&Sget_process);
83058310
defsubr (&Sdelete_process);

test/src/process-tests.el

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,5 +284,14 @@ file name handler."
284284
(put #'process-tests--file-handler 'operations
285285
'(unhandled-file-name-directory make-process))
286286

287+
(ert-deftest make-process/stop ()
288+
"Check that `make-process' doesn't accept a `:stop' key.
289+
See Bug#30460."
290+
(should-error
291+
(make-process :name "test"
292+
:command (list (expand-file-name invocation-name
293+
invocation-directory))
294+
:stop t)))
295+
287296
(provide 'process-tests)
288297
;; process-tests.el ends here.

0 commit comments

Comments
 (0)