unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Tassilo Horn <tsdh@gnu.org>
To: Marcin Borkowski <mbork@mbork.pl>
Cc: Help Gnu Emacs mailing list <help-gnu-emacs@gnu.org>
Subject: Re: Fontification of the interactive prompt string?
Date: Sat, 06 Jun 2015 00:12:45 +0200	[thread overview]
Message-ID: <87k2vhby8y.fsf@gnu.org> (raw)
In-Reply-To: <87vbf17rtx.fsf@mbork.pl> (Marcin Borkowski's message of "Fri, 05 Jun 2015 23:44:58 +0200")

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



  reply	other threads:[~2015-06-05 22:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-05 21:44 Fontification of the interactive prompt string? Marcin Borkowski
2015-06-05 22:12 ` Tassilo Horn [this message]
2015-06-05 22:34 ` Drew Adams

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=87k2vhby8y.fsf@gnu.org \
    --to=tsdh@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    --cc=mbork@mbork.pl \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).