summaryrefslogtreecommitdiff
path: root/lisp/server.el
diff options
context:
space:
mode:
authorYuuki Harano <masm+github@masm11.me>2020-12-14 01:52:10 +0900
committerYuuki Harano <masm+github@masm11.me>2020-12-14 01:52:10 +0900
commit3e30047ce3a81dd0879973012abbf570d3215dfd (patch)
treec7c10e82f2ff37705356a0c25b98d92c603c7983 /lisp/server.el
parentaea5dbec2514811fb2e1cc44b2347a976a5b7de8 (diff)
parentfe50a8b9ba79b4ac14a3a352d8bf84eaee4f2122 (diff)
downloademacs-3e30047ce3a81dd0879973012abbf570d3215dfd.tar.gz
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs into feature/pgtk
Diffstat (limited to 'lisp/server.el')
-rw-r--r--lisp/server.el26
1 files changed, 18 insertions, 8 deletions
diff --git a/lisp/server.el b/lisp/server.el
index 056f324ef53..84c2e00b26a 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -268,6 +268,12 @@ the \"-f\" switch otherwise."
:type 'string
:version "23.1")
+(defcustom server-client-instructions t
+ "If non-nil, display instructions on how to exit the client on connection.
+If nil, no instructions are displayed."
+ :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
@@ -1333,6 +1339,8 @@ The following commands are accepted by the client:
;; inhibit-quit flag, which is good since `commands' (as well as
;; find-file-noselect via the major-mode) can run arbitrary code,
;; including code that needs to wait.
+ (when (and frame server-raise-frame)
+ (select-frame-set-input-focus frame))
(with-local-quit
(condition-case err
(let ((buffers (server-visit-files files proc nowait)))
@@ -1365,8 +1373,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
@@ -1377,9 +1387,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)
@@ -1681,9 +1693,7 @@ be a cons cell (LINENUMBER . COLUMNNUMBER)."
(switch-to-buffer next-buffer))
;; After all the above, we might still have ended up with
;; a minibuffer/dedicated-window (if there's no other).
- (error (pop-to-buffer next-buffer)))))))
- (when server-raise-frame
- (select-frame-set-input-focus (window-frame)))))
+ (error (pop-to-buffer next-buffer)))))))))
;;;###autoload
(defun server-save-buffers-kill-terminal (arg)