Add docstrings to fix hooks

This commit is contained in:
Henrik Lissner 2018-10-01 20:29:43 -04:00
parent 394633b5d8
commit 6368ef9ba0
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -494,15 +494,17 @@ moderate boost in startup (or theme switch) time."
(advice-add #'load-theme :around #'doom*prefer-compiled-theme)
(defun doom|disable-whitespace-mode-in-childframes (frame)
"`whitespace-mode' inundates child frames with whitspace markers, so disable
it to fix all that visual noise."
(when (frame-parameter frame 'parent-frame)
(with-selected-frame frame
(setq-local whitespace-style nil)
frame)))
(add-hook 'after-make-frame-functions #'doom|disable-whitespace-mode-in-childframes)
;; Disruptive motion errors take over the minibuffer while we're typing there;
;; prevent this from happening.
(defun doom*silence-motion-errors (orig-fn &rest args)
"Prevent disruptive motion errors taking over the minibuffer while we're in
it."
(if (not (minibufferp))
(apply orig-fn args)
(ignore-errors (apply orig-fn args))