From 5d3496575c402405f75ca47e8503ee4a74a5402c Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 12 Dec 2020 22:54:48 -0500 Subject: [PATCH] Fix #4421: masquerade doom/escape as keyboard-quit Or abort-recursive-edit, depending. Some other packages/commands listen for these two (like undo-fu), and by remapping C-g we break those. --- core/core-keybinds.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/core-keybinds.el b/core/core-keybinds.el index bfeb54667..53c2ab47f 100644 --- a/core/core-keybinds.el +++ b/core/core-keybinds.el @@ -77,13 +77,15 @@ all hooks after it are ignored.") (interactive) (cond ((minibuffer-window-active-p (minibuffer-window)) ;; quit the minibuffer if open. + (setq this-command 'abort-recursive-edit) (abort-recursive-edit)) ;; Run all escape hooks. If any returns non-nil, then stop there. ((run-hook-with-args-until-success 'doom-escape-hook)) ;; don't abort macros ((or defining-kbd-macro executing-kbd-macro) nil) ;; Back to the default - ((keyboard-quit)))) + ((setq this-command 'keyboard-quit) + (keyboard-quit)))) (global-set-key [remap keyboard-quit] #'doom/escape)