mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
Refactor doom/escape
Now returns first hook that returns non-nil; this makes it a little easier to debug doom-escape-hook.
This commit is contained in:
@ -35,11 +35,11 @@ If any hook returns non-nil, all hooks after it are ignored.")
|
|||||||
;; quit the minibuffer if open.
|
;; quit the minibuffer if open.
|
||||||
(abort-recursive-edit))
|
(abort-recursive-edit))
|
||||||
;; Run all escape hooks. If any returns non-nil, then stop there.
|
;; Run all escape hooks. If any returns non-nil, then stop there.
|
||||||
((run-hook-with-args-until-success 'doom-escape-hook))
|
((cl-find-if #'funcall doom-escape-hook))
|
||||||
;; don't abort macros
|
;; don't abort macros
|
||||||
((or defining-kbd-macro executing-kbd-macro) nil)
|
((or defining-kbd-macro executing-kbd-macro) nil)
|
||||||
;; Back to the default
|
;; Back to the default
|
||||||
(t (keyboard-quit))))
|
((keyboard-quit))))
|
||||||
|
|
||||||
(global-set-key [remap keyboard-quit] #'doom/escape)
|
(global-set-key [remap keyboard-quit] #'doom/escape)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user