[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Fontification of the interactive prompt string?
From: |
Tassilo Horn |
Subject: |
Re: Fontification of the interactive prompt string? |
Date: |
Sat, 06 Jun 2015 00:12:45 +0200 |
User-agent: |
Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux) |
Marcin Borkowski <mbork@mbork.pl> writes:
Hi Marcin,
> I have an (interactive "cprompt\n") call, and I'd like the prompt to
> list possible characters (they define a few options for my function,
> and I have good reasons to implement it this way and not with C-u
> etc.) I'd like to have the relevant characters highlighted, like in:
>
> "file: _n_ew, _o_pen, _c_lose"
>
> where the underscores mean that something is e.g. in a different
> color.
>
> Is it possible?
The `interactive' argument may also be a form which reads the arguments
as it sees fit.
,----[ (info "(elisp)Using Interactive") ]
| • It may be a Lisp expression that is not a string; then it should be
| a form that is evaluated to get a list of arguments to pass to the
| command. Usually this form will call various functions to read
| input from the user, most often through the minibuffer (*note
| Minibuffers::) or directly from the keyboard (*note Reading
| Input::).
`----
> Bonus points if instead of colors the relevant letter might be
> e.g. put in brackets on terminals not supporting colors.
I don't know but I would refrain from trying to test terminal
capabilities from elisp and then act differently.
Bye,
Tassilo