Refactor doom/what-face
This commit is contained in:
parent
42e7f56a1f
commit
d5b84eee3d
1 changed files with 7 additions and 12 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue