From 0e638e4b1481e60b6d8211b15d55d3fde6291b31 Mon Sep 17 00:00:00 2001 From: Jim Porter Date: Wed, 2 Nov 2022 09:22:43 -0700 Subject: [PATCH] [WIP] Try using a keymap for server-mode --- lisp/frame.el | 6 +++++- lisp/server.el | 5 +++++ lisp/startup.el | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lisp/frame.el b/lisp/frame.el index 400f8a44ee..f1888623e4 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -128,7 +128,11 @@ handle-delete-frame (not (frame-parent frame-1)) (not (frame-parameter frame-1 'delete-before))) (throw 'other-frame t)))) - (delete-frame frame t) + ;; NOTE: This change is optional. If you think it adds too + ;; much complexity, let's remove it. + (funcall (or (command-remapping #'delete-frame) + #'delete-frame) + t) ;; Gildea@x.org says it is ok to ask questions before terminating. (save-buffers-kill-emacs)))) diff --git a/lisp/server.el b/lisp/server.el index 90d97c1538..aec6677f1d 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -796,6 +796,10 @@ server-running-p t) (file-error nil))) +;; NOTE: This change is optional, but it makes it easier for users to +;; add keybindings for `server-mode'. +(defvar-keymap server-mode-keymap) + ;;;###autoload (define-minor-mode server-mode "Toggle Server mode. @@ -805,6 +809,7 @@ server-mode `server-start' for details." :global t :version "22.1" + :keymap server-mode-keymap ;; Fixme: Should this check for an existing server socket and do ;; nothing if there is one (for multiple Emacs sessions)? (server-start (not server-mode))) diff --git a/lisp/startup.el b/lisp/startup.el index 70267fc857..a494e42d25 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -1604,7 +1604,7 @@ command-line (let ((dn (daemonp))) (when dn (when (stringp dn) (setq server-name dn)) - (server-start) + (server-mode 1) (if server-process (daemon-initialized) (if (stringp dn) -- 2.25.1