From d5b84eee3d560ee7a5986bc447c0190d6c82ae3d Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Fri, 15 Sep 2017 13:49:00 +0200 Subject: [PATCH] Refactor doom/what-face --- core/autoload/debug.el | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/core/autoload/debug.el b/core/autoload/debug.el index 99262a8e3..52e1d00b3 100644 --- a/core/autoload/debug.el +++ b/core/autoload/debug.el @@ -7,18 +7,13 @@ Interactively prints the list to the echo area. Noninteractively, returns a list whose car is the list of faces and cadr is the list of overlay faces." (interactive) - (unless pos - (setq pos (point))) - (let ((faces (let ((face (get-text-property pos 'face))) - (if (keywordp (car-safe face)) - (list face) - (cl-loop for f in (if (listp face) face (list face)) - collect f)))) - (overlays (cl-loop for ov in (overlays-at pos (1+ pos)) - nconc (cl-loop with face = (overlay-get ov 'face) - for f in (if (listp face) face (list face)) - collect f)))) - + (let* ((pos (or pos (point))) + (faces (let ((face (get-text-property pos 'face))) + (if (keywordp (car-safe face)) + (list face) + (cl-loop for f in (doom-enlist face) collect f)))) + (overlays (cl-loop for ov in (overlays-at pos (1+ pos)) + nconc (doom-enlist (overlay-get ov 'face))))) (cond ((called-interactively-p 'any) (message "%s %s\n%s %s" (propertize "Faces:" 'face 'font-lock-comment-face)