Better doom/what-face; remove unused util defuns
This commit is contained in:
parent
03ebdf7855
commit
310c235bb5
1 changed files with 20 additions and 17 deletions
|
@ -2,14 +2,21 @@
|
|||
|
||||
;;;###autoload
|
||||
(defun doom/what-face (pos)
|
||||
"Tells you the name of the face (point) is on."
|
||||
"Lists all faces at point. Overlay faces are <>-delimited."
|
||||
(interactive "d")
|
||||
(let ((hl-line-p (bound-and-true-p hl-line-mode)))
|
||||
(if hl-line-p (hl-line-mode -1))
|
||||
(let ((face (or (get-char-property pos 'read-face-name)
|
||||
(get-char-property pos 'face))))
|
||||
(if face (message "Face: %s" face) (message "No face at %d" pos)))
|
||||
(if hl-line-p (hl-line-mode 1))))
|
||||
(let ((pos (point))
|
||||
faces)
|
||||
(when-let (face (get-text-property pos 'face))
|
||||
(dolist (f (if (listp face) face (list face)))
|
||||
(push (propertize (symbol-name f) 'face f) faces)))
|
||||
(dolist (ov (overlays-at pos (1+ pos)))
|
||||
(let ((face (overlay-get ov 'face)))
|
||||
(dolist (f (if (listp face) face (list face)))
|
||||
(push (propertize (concat (symbol-name f) "*") 'face f) faces))))
|
||||
|
||||
(message "%s %s"
|
||||
(propertize "Faces:" 'face 'font-lock-comment-face)
|
||||
(if faces (string-join faces ", ") "n/a"))))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom/what-col ()
|
||||
|
@ -17,14 +24,10 @@
|
|||
(message "Column %d" (current-column)))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom-what-bindings (key)
|
||||
(list
|
||||
(minor-mode-key-binding key)
|
||||
(local-key-binding key)
|
||||
(global-key-binding key)))
|
||||
|
||||
;;;###autoload
|
||||
(defun doom/what-major-mode ()
|
||||
(interactive)
|
||||
(message "Mode: %s" major-mode))
|
||||
(defun doom/what-bindings (key)
|
||||
(interactive "k")
|
||||
(message "minor-mode:\t%s\nlocal:\t\t%s\nglobal:\t\t%s"
|
||||
(or (minor-mode-key-binding key) "n/a")
|
||||
(or (local-key-binding key) "n/a")
|
||||
(or (global-key-binding key) "n/a")))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue