emacs-devel
[Top][All Lists]
Advanced

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

Re: Entering emojis


From: Jonas Bernoulli
Subject: Re: Entering emojis
Date: Wed, 03 Nov 2021 02:27:36 +0100

Lars Ingebrigtsen <larsi@gnus.org> writes:

> 😄

👍🏼 Like it a lot!

Lately I was actually occasionally wishing this existed.

Let's start with the nitpicking:
- The section description is in some cases displayed at the bottom.
- That's it.

It's great to see something added to Emacs that uses Transient.
Thanks for that!  And for the variable-pitch functionality.

Transient has some support for dynamically generating the suffixes of
some prefix using the `setup-children' function, see notmuch-transient
for an example (https://git.sr.ht/~tarsius/notmuch-transient).
the result.

You maybe could use that approach too, at least for the top-level prefix
commands.  I haven't tried using this for sub-prefixes though.  In the
notmuch case the suffixes are recreated every time but you could of
course cache the result.

Ah, actually I ran into one more issue.  When I used describe-function
to jump to transient-define-prefix to compare it to the code you copied
from there I got a lot of new completion candidates for various
generated suffix commands that are not intended to invoked directly (and
whose name begin with "transient:", which is transient's convention for
"anonymous" suffixes but weird I admit).

Transient actually tries to prevent that using a *supper weird* hack (I
would rather not explain in detail), but you bypass when you generate
the suffixes.  This hack isn't actually necessary anymore starting with
Emacs 28, but I haven't implemented the new approach yet, though it
should be trivial:

I intend to use (put SUFFIX 'modes '(transient-no-mode)) to do the M-x
hiding going forward, which reminds me: it might be a good idea to
officially support and document some value that indicates that a command
should *never* be shown by M-x.  Careful readers might be confused by
the use of a mode that doesn't actually exist and it would be good if
not every package author who wants to do this has to define some "ceci
n'est pas une mode" variable and/or function to have a doc-string to
explain what is going on.

And since I am going a bit off-topic anyway, let's take it all the way
with a question that is only related in that it came up in the context
of another package that also uses transient:

Is there some generic way to turn a function that reads a single value
in the minibuffer into one that reads multiple values, similar to what
completing-read-multiple does but which isn't limited to a set of known
choices.  The function I have in mind is read-file-name-multiple (which
is supposed to go beyond merely supporting wildcards, supporting input
like "foo.txt,~/bin/bar.sh").

Magit actually uses completing-read-multiple for its "--" argument used
to limit logs and diffs to one or more files.  It can use do that
because the set of choices is known and limited to files tracked in the
current repository.  This other package needs to read multiple files
that are scattered all across the file system.

  🛌 time! Signing off.
  Jonas



reply via email to

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