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:
Henrik Lissner 2018-06-04 00:07:03 +02:00
parent 9ba76b60dc
commit b2030c6ed3
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -35,11 +35,11 @@ If any hook returns non-nil, all hooks after it are ignored.")
;; quit the minibuffer if open.
(abort-recursive-edit))
;; 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
((or defining-kbd-macro executing-kbd-macro) nil)
;; Back to the default
(t (keyboard-quit))))
((keyboard-quit))))
(global-set-key [remap keyboard-quit] #'doom/escape)