help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Interactive function displaying face attributes


From: carlmarcos
Subject: Interactive function displaying face attributes
Date: Tue, 9 Aug 2022 20:24:21 +0200 (CEST)

I am writing this function to display face attributes.  The function works 
interactively accepting a string from the user obtained from `completing-read'.

For `char-after-point' I want to display the face attribute of the character 
after point.  Having seen that there can be more than one face at point, what 
can I do? 

(defun descface (face)
  "Describe the typeface properties of FACE."

  (interactive
   (list
    (let* ( (cseq '("char-after-point" "mode-line-inactive" "mode-line" 
"default")) )
      (completing-read "Face: " cseq nil t "mode-line"))))

  (cond ((equal face "char-after-point")
(plist-get (text-properties-at (point)) 'face))
(t (describe-face face)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]