On Wed, Oct 13 2021, Lars Ingebrigtsen wrote: > Helmut Eller writes: > >> I would like to request this feature: stop-process, when called with a >> sub-process that is connected via pipes, should use delete_read_fd. It >> should basically do the same as for sockets. >> >> Currently, stop-process uses some difficult to understand logic and >> eventually sends SIGSTOP to the process. This might work in theory, but >> in practice it can take a long time before Emacs stops receiving output. > > You're supposed to be able to use `continue-process' on the process > after stopping it for a while -- that's not possible if you delete the > fd. Here "deleting" only removes the fd from the event loop; it doesn't close the fd. The fd can be added back by `continue-process'. The patch below implements the basic idea. Though, not very nicely because in this case p->command can't be used to indicate that the fd is temporarily "deleted". It writes something to the process->plist. A proper patch would probably do this in a better way: