]> git.eshelyaron.com Git - emacs.git/commitdiff
Allow inhibiting the instructions on how to close emacsclient frames
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 7 Dec 2020 12:53:24 +0000 (13:53 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 7 Dec 2020 12:53:24 +0000 (13:53 +0100)
* doc/emacs/misc.texi (Invoking emacsclient): Document it.
* lisp/server.el (server-client-instructions): New variable.
(server-execute): Use it.

doc/emacs/misc.texi
etc/NEWS
lisp/server.el

index 5b5134b7c3fc5951c052747e97de64de95ca18e7..e0341a49913317a12f7f9e72c5a473de1bbcda37 100644 (file)
@@ -1893,6 +1893,12 @@ with @kbd{C-x #}.  But @kbd{C-x #} is the way to tell
 window or a frame, @kbd{C-x #} always displays the next server buffer
 in that window or in that frame.
 
+@vindex server-client-instructions
+  When @command{emacsclient} connects, the server will normally output
+a message that says how to exit the client frame.  If
+@code{server-client-instructions} is set to @code{nil}, this message
+is inhibited.
+
 @node emacsclient Options
 @subsection @code{emacsclient} Options
 @cindex @code{emacsclient} options
index a30355f20dbe1e800f9fccdcc1f05db387edaaa6..34f7d30c845831938c4d622508d8625a049eb1a3 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -287,6 +287,14 @@ the buffer cycles the whole buffer between "only top-level headings",
 \f
 * Changes in Specialized Modes and Packages in Emacs 28.1
 
+** Emacs Server
+
++++
+*** New user option 'server-client-instructions'.
+When emacsclient connects, Emacs will (by default) output a message
+about how to exit the client frame.  If 'server-client-instructions'
+is set to nil, this message is inhibited.
+
 ** Python mode
 
 *** 'C-c C-r' can now be used on arbitrary regions.
index 2fd94552ddab1a6a7316088415e07d894a4b88be..b1b27e33b2e824ebc7c9fafcf2394c7d70fd1c5d 100644 (file)
@@ -268,6 +268,12 @@ the \"-f\" switch otherwise."
   :type 'string
   :version "23.1")
 
+(defcustom server-client-instructions t
+  "If non-nil, output instructions on how to exit the client on connection.
+If non, no messaging is done."
+  :version "28.1"
+  :type 'boolean)
+
 ;; We do not use `temporary-file-directory' here, because emacsclient
 ;; does not read the init file.
 (defvar server-socket-dir
@@ -1360,8 +1366,10 @@ The following commands are accepted by the client:
             nil)
            ((and frame (null buffers))
             (run-hooks 'server-after-make-frame-hook)
-            (message "%s" (substitute-command-keys
-                           "When done with this frame, type \\[delete-frame]")))
+            (when server-client-instructions
+              (message "%s"
+                       (substitute-command-keys
+                        "When done with this frame, type \\[delete-frame]"))))
            ((not (null buffers))
             (run-hooks 'server-after-make-frame-hook)
             (server-switch-buffer
@@ -1372,9 +1380,11 @@ The following commands are accepted by the client:
              ;; where it may be displayed.
              (plist-get (process-plist proc) 'frame))
             (run-hooks 'server-switch-hook)
-            (unless nowait
-              (message "%s" (substitute-command-keys
-                             "When done with a buffer, type \\[server-edit]")))))
+            (when (and (not nowait)
+                       server-client-instructions)
+              (message "%s"
+                       (substitute-command-keys
+                        "When done with a buffer, type \\[server-edit]")))))
           (when (and frame (null tty-name))
             (server-unselect-display frame)))
       ((quit error)