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

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

Re: Handling non-interactive use with faces


From: carlmarcos
Subject: Re: Handling non-interactive use with faces
Date: Thu, 11 Aug 2022 17:56:23 +0200 (CEST)

Aug 10, 2022, 17:23 by help-gnu-emacs@gnu.org:

> How can this function be made to handle the case of non-interactive use to 
> pass a face for displaying its properties?
>
>
> (defun laxy-descface (facenm)
>   "Describe the typeface properties of face name FACENM."
>
>   (interactive
>    (list
>     (let* ( (cseq '("default" "mode-line" "mode-line-inactive"
>     "list" "text-property")) )
>       (completing-read "Face_property: " cseq nil t "text-property"))))
>
>   (pcase facenm
>     ("text-property"
>         (describe-face (get-text-property (point) 'face)))
>     ("default"
>         (describe-face (intern facenm)))
>     ("mode-line"
>         (describe-face (intern facenm)))
>     ("mode-line-inactive"
>         (describe-face (intern facenm)))
>     ("list"
>         (list-faces-display))) )
>
------- Original Message -------
On Wednesday, August 10th, 2022 at 5:36 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>
> You need to add a pcase alternative for a face or face name, and then
> you call your function with that face as a single argument.

I am struggling to figure out what kind of `pcase' I should use for the scheme 
you suggest.




reply via email to

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