From 2df85b2b5e308b5d7192922b196d843e87e28398 Mon Sep 17 00:00:00 2001 From: Matthew Date: Thu, 19 Dec 2019 02:36:16 -0500 Subject: [PATCH 1/2] Wrap keyboard-quit instead of completely replacing keyboard-quit --- eaf.el | 5 +++-- eaf.py | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/eaf.el b/eaf.el index 4a17246..305efce 100644 --- a/eaf.el +++ b/eaf.el @@ -644,9 +644,10 @@ to edit EAF keybindings!" fun fun))) (message (format "export %s to html" (buffer-file-name)))))) (defun eaf-keyboard-quit () - "Similar to `keyboard-quit' but signals a ‘quit’ condition to EAF applications." + "Layers on top of `keyboard-quit' but signals a ‘quit’ condition to EAF applications." (interactive) - (eaf-call "action_quit" eaf--buffer-id)) + (eaf-call "action_quit" eaf--buffer-id) + (call-interactively 'keyboard-quit)) (defun eaf-send-key () "Directly send key to EAF Python side." diff --git a/eaf.py b/eaf.py index ad42fa3..1d68b68 100755 --- a/eaf.py +++ b/eaf.py @@ -259,7 +259,6 @@ class EAF(dbus.service.Object): def action_quit(self, buffer_id): if buffer_id in self.buffer_dict: self.buffer_dict[buffer_id].action_quit() - self.message_to_emacs("Quit") @dbus.service.method(EAF_DBUS_NAME, in_signature="ss", out_signature="") def send_key(self, buffer_id, event_string): From 015da9ebf8580f5a7353779a3ff8a41aefb1a0c6 Mon Sep 17 00:00:00 2001 From: Matthew Date: Thu, 19 Dec 2019 02:39:45 -0500 Subject: [PATCH 2/2] Fix typo, remap keyboard-quit --- eaf.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eaf.el b/eaf.el index 305efce..0e4f67b 100644 --- a/eaf.el +++ b/eaf.el @@ -96,10 +96,10 @@ (defvar eaf-mode-map* (let ((map (make-sparse-keymap))) - (define-key map (kbd "C-g") #'eaf-keyboard-quit) (define-key map (kbd "C-h m") #'eaf-describe-bindings) (define-key map [remap describe-bindings] #'eaf-describe-bindings) (define-key map (kbd "C-c b") #'eaf-open-bookmark) + (define-key map (vector 'remap #'keyboard-quit) #'eaf-keyboard-quit) (define-key map (vector 'remap #'self-insert-command) #'eaf-send-key) (dolist (single-key '("RET" "DEL" "TAB" "SPC" "" "" "" "" "" "" "" "" "")) (define-key map (kbd single-key) #'eaf-send-key)) @@ -644,7 +644,7 @@ to edit EAF keybindings!" fun fun))) (message (format "export %s to html" (buffer-file-name)))))) (defun eaf-keyboard-quit () - "Layers on top of `keyboard-quit' but signals a ‘quit’ condition to EAF applications." + "Wrap around `keyboard-quit' and signals a ‘quit’ condition to EAF applications." (interactive) (eaf-call "action_quit" eaf--buffer-id) (call-interactively 'keyboard-quit))