From 779ae60454adc5df618350731686bea8e4d64400 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 24 Jun 2017 16:20:22 +0200 Subject: [PATCH] Refactor doom-resolve-hooks --- core/core-lib.el | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/core/core-lib.el b/core/core-lib.el index 9f45fb086..50919a97c 100644 --- a/core/core-lib.el +++ b/core/core-lib.el @@ -40,16 +40,13 @@ (t paths))) (defun doom--resolve-hooks (hooks) - (let ((quoted-p (eq (car-safe hooks) 'quote))) - (when quoted-p - (setq hooks (cadr hooks))) - (cl-loop with hooks = (if (listp hooks) hooks (list hooks)) - for hook in 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)))))) + (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))))) (defun doom-unquote (exp) "Return EXP unquoted."