all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: carlmarcos--- via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
To: carlmarcos@tutanota.com
Cc: Help Gnu Emacs <help-gnu-emacs@gnu.org>
Subject: Re: Handling non-interactive use with faces
Date: Thu, 11 Aug 2022 17:56:23 +0200 (CEST)	[thread overview]
Message-ID: <N9Cbjnb--3-2@tutanota.com> (raw)
In-Reply-To: <N97m-43--3-2@tutanota.com-N97nByi--3-2>


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.




  parent reply	other threads:[~2022-08-11 15:56 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-10 17:23 Handling non-interactive use with faces carlmarcos--- via Users list for the GNU Emacs text editor
2022-08-10 17:36 ` Eli Zaretskii
     [not found] ` <N97m-43--3-2@tutanota.com-N97nByi--3-2>
2022-08-11 15:56   ` carlmarcos--- via Users list for the GNU Emacs text editor [this message]
2022-08-11 16:08     ` Eli Zaretskii
2022-08-11 18:32       ` carlmarcos--- via Users list for the GNU Emacs text editor
2022-08-11 18:42         ` Eli Zaretskii
2022-08-11 19:47           ` carlmarcos--- via Users list for the GNU Emacs text editor
2022-08-12  4:29             ` Michael Heerdegen
2022-08-12  4:34               ` carlmarcos--- via Users list for the GNU Emacs text editor
2022-08-12 21:43                 ` Michael Heerdegen
2022-08-12 21:47                   ` uzibalqa
2022-08-12 23:17                     ` Michael Heerdegen
2022-08-12 23:57                       ` uzibalqa
2022-08-13  5:00                     ` tomas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=N9Cbjnb--3-2@tutanota.com \
    --to=help-gnu-emacs@gnu.org \
    --cc=carlmarcos@tutanota.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.