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
|
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."
|
whose car is the list of faces and cadr is the list of overlay faces."
|
||||||
(interactive)
|
(interactive)
|
||||||
(unless pos
|
(let* ((pos (or pos (point)))
|
||||||
(setq pos (point)))
|
(faces (let ((face (get-text-property pos 'face)))
|
||||||
(let ((faces (let ((face (get-text-property pos 'face)))
|
|
||||||
(if (keywordp (car-safe face))
|
(if (keywordp (car-safe face))
|
||||||
(list face)
|
(list face)
|
||||||
(cl-loop for f in (if (listp face) face (list face))
|
(cl-loop for f in (doom-enlist face) collect f))))
|
||||||
collect f))))
|
|
||||||
(overlays (cl-loop for ov in (overlays-at pos (1+ pos))
|
(overlays (cl-loop for ov in (overlays-at pos (1+ pos))
|
||||||
nconc (cl-loop with face = (overlay-get ov 'face)
|
nconc (doom-enlist (overlay-get ov 'face)))))
|
||||||
for f in (if (listp face) face (list face))
|
|
||||||
collect f))))
|
|
||||||
|
|
||||||
(cond ((called-interactively-p 'any)
|
(cond ((called-interactively-p 'any)
|
||||||
(message "%s %s\n%s %s"
|
(message "%s %s\n%s %s"
|
||||||
(propertize "Faces:" 'face 'font-lock-comment-face)
|
(propertize "Faces:" 'face 'font-lock-comment-face)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue