From 969d71d11c62ae085f094a96ecea2fb504bb4602 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Wed, 2 Nov 2022 20:22:10 +0200 Subject: [PATCH] Add the parameter :noquery to open-network-stream (bug#58948) * doc/lispref/processes.texi (Network): Add :noquery for open-network-stream. * lisp/net/network-stream.el (open-network-stream): Pass the parameter :noquery to make-network-process. Doc fix. * lisp/progmodes/eglot.el (eglot--connect): Pass `:noquery t' to eglot--inferior-bootstrap to use in open-network-stream call, like `:noquery t' is passed to make-process in other places. --- doc/lispref/processes.texi | 4 ++++ lisp/net/network-stream.el | 4 ++++ lisp/progmodes/eglot.el | 3 ++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi index da8df968541..adc6909aca6 100644 --- a/doc/lispref/processes.texi +++ b/doc/lispref/processes.texi @@ -2585,6 +2585,10 @@ that are mainly relevant to encrypted connections: @item :nowait @var{boolean} If non-@code{nil}, try to make an asynchronous connection. +@item :noquery @var{query-flag} +Initialize the process query flag to @var{query-flag}. +@xref{Query Before Exit}. + @item :coding @var{coding} Use this to set the coding systems used by the network process, in preference to binding @code{coding-system-for-read} or diff --git a/lisp/net/network-stream.el b/lisp/net/network-stream.el index 38a5e14c946..2b7e5393923 100644 --- a/lisp/net/network-stream.el +++ b/lisp/net/network-stream.el @@ -173,6 +173,9 @@ a greeting from the server. :nowait, if non-nil, says the connection should be made asynchronously, if possible. +:noquery - when exiting Emacs and the network process is running, +don't query the user if it's non-nil. + :shell-command is a `format-spec' string that can be used if :type is `shell'. It has two specs, %s for host and %p for port number. Example: \"ssh gateway nc %s %p\". @@ -195,6 +198,7 @@ gnutls-boot (as returned by `gnutls-boot-parameters')." (make-network-process :name name :buffer buffer :host (puny-encode-domain host) :service service :nowait (plist-get parameters :nowait) + :noquery (plist-get parameters :noquery) :tls-parameters (plist-get parameters :tls-parameters) :coding (plist-get parameters :coding)) diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el index 0a0d73eb6d2..204121045a0 100644 --- a/lisp/progmodes/eglot.el +++ b/lisp/progmodes/eglot.el @@ -1200,7 +1200,8 @@ This docstring appeases checkdoc, that's all." (pcase-let ((`(,connection . ,inferior) (eglot--inferior-bootstrap readable-name - contact))) + contact + '(:noquery t)))) (setq autostart-inferior-process inferior) connection)))) ((stringp (car contact)) -- 2.39.2