Minor refactors & comment revision

This commit is contained in:
Henrik Lissner 2019-05-13 14:37:00 -04:00
parent 646cba3f68
commit 7443669b1e
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
5 changed files with 16 additions and 14 deletions

View file

@ -50,15 +50,16 @@ This is used by `associate!', `file-exists-p!' and `project-file-exists-p!'."
(defun doom--resolve-hook-forms (hooks)
"Converts a list of modes into a list of hook symbols.
If a mode is quoted, it is left as is."
If a mode is quoted, it is left as is. If the entire HOOKS list is quoted, the
list is returned as-is."
(declare (pure t) (side-effect-free t))
(cl-loop with quoted-p = (eq (car-safe hooks) 'quote)
for hook in (doom-enlist (doom-unquote hooks))
if (eq (car-safe hook) 'quote)
collect (cadr hook)
else if quoted-p
collect hook
else collect (intern (format "%s-hook" (symbol-name hook)))))
(let ((hook-list (doom-enlist (doom-unquote hooks))))
(if (eq (car-safe hooks) 'quote)
hook-list
(cl-loop for hook in hook-list
if (eq (car-safe hook) 'quote)
collect (cadr hook)
else collect (intern (format "%s-hook" (symbol-name hook)))))))
(defun doom--assert-stage-p (stage macro)
(unless (bound-and-true-p byte-compile-current-file)