diff options
author | Yuuki Harano <masm+github@masm11.me> | 2020-12-14 01:52:10 +0900 |
---|---|---|
committer | Yuuki Harano <masm+github@masm11.me> | 2020-12-14 01:52:10 +0900 |
commit | 3e30047ce3a81dd0879973012abbf570d3215dfd (patch) | |
tree | c7c10e82f2ff37705356a0c25b98d92c603c7983 /lisp/server.el | |
parent | aea5dbec2514811fb2e1cc44b2347a976a5b7de8 (diff) | |
parent | fe50a8b9ba79b4ac14a3a352d8bf84eaee4f2122 (diff) | |
download | emacs-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.el | 26 |
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) |