diff options
| author | Philipp Stephani | 2019-04-19 13:03:40 +0200 |
|---|---|---|
| committer | Philipp Stephani | 2019-04-19 14:03:16 +0200 |
| commit | 5c5e309527e6b582e2c04b83e7af45f3144863ac (patch) | |
| tree | 0a19797e7e67663915d95b72ea5452c80b5dc552 | |
| parent | 3ff7d7321ac62b1eb896e8a032e7f75f5a6b8146 (diff) | |
| download | emacs-5c5e309527e6b582e2c04b83e7af45f3144863ac.tar.gz emacs-5c5e309527e6b582e2c04b83e7af45f3144863ac.zip | |
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.
| -rw-r--r-- | doc/lispref/processes.texi | 4 | ||||
| -rw-r--r-- | etc/NEWS | 3 | ||||
| -rw-r--r-- | src/process.c | 17 | ||||
| -rw-r--r-- | 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 6be311b5639..43009b35b2a 100644 --- a/doc/lispref/processes.texi +++ b/doc/lispref/processes.texi | |||
| @@ -678,7 +678,9 @@ Initialize the process query flag to @var{query-flag}. | |||
| 678 | @xref{Query Before Exit}. | 678 | @xref{Query Before Exit}. |
| 679 | 679 | ||
| 680 | @item :stop @var{stopped} | 680 | @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 | ||
| 682 | stopped state. | 684 | stopped state. |
| 683 | 685 | ||
| 684 | @item :filter @var{filter} | 686 | @item :filter @var{filter} |
| @@ -1515,6 +1515,9 @@ The global value of 'indent-line-function', which defaults to | |||
| 1515 | To get back the old behavior, add a function to 'text-mode-hook' which | 1515 | To get back the old behavior, add a function to 'text-mode-hook' which |
| 1516 | performs (setq-local indent-line-function #'indent-relative). | 1516 | performs (setq-local indent-line-function #'indent-relative). |
| 1517 | 1517 | ||
| 1518 | ** 'make-process' no longer accepts a non-nil ':stop' key. This has | ||
| 1519 | never worked reliably, and now causes an error. | ||
| 1520 | |||
| 1518 | 1521 | ||
| 1519 | * Lisp Changes in Emacs 27.1 | 1522 | * Lisp Changes in Emacs 27.1 |
| 1520 | 1523 | ||
diff --git a/src/process.c b/src/process.c index 0c440371628..6717ccb4187 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -1643,10 +1643,11 @@ ENCODING is used for writing. | |||
| 1643 | :noquery BOOL -- When exiting Emacs, query the user if BOOL is nil and | 1643 | :noquery BOOL -- When exiting Emacs, query the user if BOOL is nil and |
| 1644 | the process is running. If BOOL is not given, query before exiting. | 1644 | the process is running. If BOOL is not given, query before exiting. |
| 1645 | 1645 | ||
| 1646 | :stop BOOL -- Start process in the `stopped' state if BOOL non-nil. | 1646 | :stop BOOL -- BOOL must be nil. The `:stop' key is ignored otherwise |
| 1647 | In the stopped state, a process does not accept incoming data, but you | 1647 | and is retained for compatibility with other process types such as |
| 1648 | can send outgoing data. The stopped state is cleared by | 1648 | pipe processes. Asynchronous subprocesses never start in the |
| 1649 | `continue-process' and set by `stop-process'. | 1649 | `stopped' state. Use `stop-process' and `continue-process' to send |
| 1650 | signals to stop and continue a process. | ||
| 1650 | 1651 | ||
| 1651 | :connection-type TYPE -- TYPE is control type of device used to | 1652 | :connection-type TYPE -- TYPE is control type of device used to |
| 1652 | communicate with subprocesses. Values are `pipe' to use a pipe, `pty' | 1653 | communicate with subprocesses. Values are `pipe' to use a pipe, `pty' |
| @@ -1746,8 +1747,10 @@ usage: (make-process &rest ARGS) */) | |||
| 1746 | 1747 | ||
| 1747 | if (!query_on_exit) | 1748 | if (!query_on_exit) |
| 1748 | XPROCESS (proc)->kill_without_query = 1; | 1749 | XPROCESS (proc)->kill_without_query = 1; |
| 1749 | if (tem = Fplist_get (contact, QCstop), !NILP (tem)) | 1750 | tem = Fplist_get (contact, QCstop); |
| 1750 | pset_command (XPROCESS (proc), Qt); | 1751 | /* Normal processes can't be started in a stopped state, see |
| 1752 | Bug#30460. */ | ||
| 1753 | CHECK_TYPE (NILP (tem), Qnull, tem); | ||
| 1751 | 1754 | ||
| 1752 | tem = Fplist_get (contact, QCconnection_type); | 1755 | tem = Fplist_get (contact, QCconnection_type); |
| 1753 | if (EQ (tem, Qpty)) | 1756 | if (EQ (tem, Qpty)) |
| @@ -8300,6 +8303,8 @@ returns non-`nil'. */); | |||
| 8300 | "internal-default-interrupt-process"); | 8303 | "internal-default-interrupt-process"); |
| 8301 | DEFSYM (Qinterrupt_process_functions, "interrupt-process-functions"); | 8304 | DEFSYM (Qinterrupt_process_functions, "interrupt-process-functions"); |
| 8302 | 8305 | ||
| 8306 | DEFSYM (Qnull, "null"); | ||
| 8307 | |||
| 8303 | defsubr (&Sprocessp); | 8308 | defsubr (&Sprocessp); |
| 8304 | defsubr (&Sget_process); | 8309 | defsubr (&Sget_process); |
| 8305 | defsubr (&Sdelete_process); | 8310 | defsubr (&Sdelete_process); |
diff --git a/test/src/process-tests.el b/test/src/process-tests.el index 0bb7ebe50a8..b853f77946d 100644 --- a/test/src/process-tests.el +++ b/test/src/process-tests.el | |||
| @@ -284,5 +284,14 @@ file name handler." | |||
| 284 | (put #'process-tests--file-handler 'operations | 284 | (put #'process-tests--file-handler 'operations |
| 285 | '(unhandled-file-name-directory make-process)) | 285 | '(unhandled-file-name-directory make-process)) |
| 286 | 286 | ||
| 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 | |||
| 287 | (provide 'process-tests) | 296 | (provide 'process-tests) |
| 288 | ;; process-tests.el ends here. | 297 | ;; process-tests.el ends here. |