GNU bug report logs -
#60740
29.0.60; Broken isearch-emoji-by-name
Previous Next
To reply to this bug, email your comments to 60740 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60740
; Package
emacs
.
(Wed, 11 Jan 2023 19:48:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Juri Linkov <juri <at> linkov.net>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Wed, 11 Jan 2023 19:48:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
etc/NEWS:
+++
*** New command 'isearch-emoji-by-name'.
It is bound to 'C-x 8 e RET' during an incremental search. The
command accepts the Unicode name of an Emoji (for example, "smiling
face" or "heart with arrow"), like 'C-x 8 e e', with minibuffer
completion, and adds the Emoji into the search string.
These examples "smiling face" and "heart with arrow" work fine.
But typing e.g. 'C-s C-x 8 e RET waving hand RET' fails with:
⛔ Error (transient): Inconsistent transient state detected.
This should never happen.
Please open an issue and post the shown command log.
This is a heisenbug, so any additional details might help.
Thanks!
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60740
; Package
emacs
.
(Thu, 12 Jan 2023 09:47:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 60740 <at> debbugs.gnu.org (full text, mbox):
> From: Juri Linkov <juri <at> linkov.net>
> Date: Wed, 11 Jan 2023 21:45:44 +0200
>
> etc/NEWS:
>
> +++
> *** New command 'isearch-emoji-by-name'.
> It is bound to 'C-x 8 e RET' during an incremental search. The
> command accepts the Unicode name of an Emoji (for example, "smiling
> face" or "heart with arrow"), like 'C-x 8 e e', with minibuffer
> completion, and adds the Emoji into the search string.
>
> These examples "smiling face" and "heart with arrow" work fine.
>
> But typing e.g. 'C-s C-x 8 e RET waving hand RET' fails with:
>
> ⛔ Error (transient): Inconsistent transient state detected.
> This should never happen.
> Please open an issue and post the shown command log.
> This is a heisenbug, so any additional details might help.
> Thanks!
Looks like a problem with any Emoji that has variants, where you need
to select one of the variants?
Lars, Jonas, could you please look into this?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60740
; Package
emacs
.
(Thu, 12 Jan 2023 09:58:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 60740 <at> debbugs.gnu.org (full text, mbox):
>>>>> On Thu, 12 Jan 2023 11:47:08 +0200, Eli Zaretskii <eliz <at> gnu.org> said:
>> But typing e.g. 'C-s C-x 8 e RET waving hand RET' fails with:
>>
>> ⛔ Error (transient): Inconsistent transient state detected.
>> This should never happen.
>> Please open an issue and post the shown command log.
>> This is a heisenbug, so any additional details might help.
>> Thanks!
I get it straight from 'emacs -Q', so obviously the quantum
probabilities are different here 😀
Eli> Looks like a problem with any Emoji that has variants, where you need
Eli> to select one of the variants?
Could be. The transient command log looks like this:
e ;; transient:emoji--command-Choose Emoji:👋🏾
C-s ;; isearch-repeat-forward
C-x 8 e RET ;; isearch-emoji-by-name
w ;; self-insert-command
a ;; self-insert-command
v ;; self-insert-command
i ;; self-insert-command
n ;; self-insert-command
g ;; self-insert-command
SPC ;; minibuffer-complete-word
h ;; self-insert-command
a ;; self-insert-command
n ;; self-insert-command
d ;; self-insert-command
RET ;; minibuffer-complete-and-exit
e ;; isearch-printing-char
(should that really be calling `isearch-printing-char' at the end
there?)
'C-x 8 e RET' for the same emoji works fine.
Robert
--
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60740
; Package
emacs
.
(Thu, 12 Jan 2023 11:26:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 60740 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: Juri Linkov <juri <at> linkov.net>
>> Date: Wed, 11 Jan 2023 21:45:44 +0200
>>
>> etc/NEWS:
>>
>> +++
>> *** New command 'isearch-emoji-by-name'.
>> It is bound to 'C-x 8 e RET' during an incremental search. The
>> command accepts the Unicode name of an Emoji (for example, "smiling
>> face" or "heart with arrow"), like 'C-x 8 e e', with minibuffer
>> completion, and adds the Emoji into the search string.
>>
>> These examples "smiling face" and "heart with arrow" work fine.
>>
>> But typing e.g. 'C-s C-x 8 e RET waving hand RET' fails with:
>>
>> ⛔ Error (transient): Inconsistent transient state detected.
>> This should never happen.
>> Please open an issue and post the shown command log.
>> This is a heisenbug, so any additional details might help.
>> Thanks!
>
> Looks like a problem with any Emoji that has variants, where you need
> to select one of the variants?
>
The command suspends the isearch while the emoji-search command is
invoked, but I see that the isearch reactivates prematurely, when the
Transient menu is shown (M-x debug-watch RET isearch-suspended RET is
helpful here).
Perhaps this is conflicting with Transient in some way. We should try
to keep the isearch suspended until after the Transient menu interaction
has finished, I think.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60740
; Package
emacs
.
(Thu, 12 Jan 2023 17:32:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 60740 <at> debbugs.gnu.org (full text, mbox):
>>> But typing e.g. 'C-s C-x 8 e RET waving hand RET' fails with:
>>>
>>> ⛔ Error (transient): Inconsistent transient state detected.
>>> This should never happen.
>>> Please open an issue and post the shown command log.
>>> This is a heisenbug, so any additional details might help.
>>> Thanks!
>>
>> Looks like a problem with any Emoji that has variants, where you need
>> to select one of the variants?
>
> The command suspends the isearch while the emoji-search command is
> invoked, but I see that the isearch reactivates prematurely, when the
> Transient menu is shown (M-x debug-watch RET isearch-suspended RET is
> helpful here).
>
> Perhaps this is conflicting with Transient in some way. We should try
> to keep the isearch suspended until after the Transient menu interaction
> has finished, I think.
The question is rather opposite: why Transient doesn't use
recursive-edit like all normal minibuffers?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60740
; Package
emacs
.
(Sat, 21 Jan 2023 07:25:01 GMT)
Full text and
rfc822 format available.
Message #20 received at 60740 <at> debbugs.gnu.org (full text, mbox):
Ping! Lars, Jonas: I'd really like to have a solution for this before
Emacs 29 goes into pretest. Please help.
> Cc: 60740 <at> debbugs.gnu.org
> Date: Thu, 12 Jan 2023 11:47:08 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
>
> > From: Juri Linkov <juri <at> linkov.net>
> > Date: Wed, 11 Jan 2023 21:45:44 +0200
> >
> > etc/NEWS:
> >
> > +++
> > *** New command 'isearch-emoji-by-name'.
> > It is bound to 'C-x 8 e RET' during an incremental search. The
> > command accepts the Unicode name of an Emoji (for example, "smiling
> > face" or "heart with arrow"), like 'C-x 8 e e', with minibuffer
> > completion, and adds the Emoji into the search string.
> >
> > These examples "smiling face" and "heart with arrow" work fine.
> >
> > But typing e.g. 'C-s C-x 8 e RET waving hand RET' fails with:
> >
> > ⛔ Error (transient): Inconsistent transient state detected.
> > This should never happen.
> > Please open an issue and post the shown command log.
> > This is a heisenbug, so any additional details might help.
> > Thanks!
>
> Looks like a problem with any Emoji that has variants, where you need
> to select one of the variants?
>
> Lars, Jonas, could you please look into this?
>
>
>
>
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60740
; Package
emacs
.
(Sun, 22 Jan 2023 19:27:02 GMT)
Full text and
rfc822 format available.
Message #23 received at 60740 <at> debbugs.gnu.org (full text, mbox):
>> But typing e.g. 'C-s C-x 8 e RET waving hand RET' fails with:
That binding doesn't exist in my configuration. Do you mean
"C-x 8 e e", i.e., emoji-insert?
>> ⛔ Error (transient): Inconsistent transient state detected.
I couldn't reproduce this with the above command (and also tried a
few other emoji commands). But I haven't tried with the version of
transient in emacs.git, and I have somewhat recently fixed related
issues in transient's own repository.
Recently I also noticed that my most recent attempt to update transient
in emacs.git has gone wrong; I think I just forgot to push. I intend
to merge transient.git into emacs.git very soon (it's all bugfixes and
minor cosmetics), but have come aware of additional problems that I was
planning to address first.
> I'd really like to have a solution for this before Emacs 29 goes into
> pretest.
When will that be? I also want to get the latest bugfixes in before
then and maybe even create a transient release before that happens,
but I would also like to avoid rushing it, if I can help it. (That
being said, fixing these issues is my top priority now, so I hope to
be ready to merge very soon.)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60740
; Package
emacs
.
(Mon, 23 Jan 2023 07:07:01 GMT)
Full text and
rfc822 format available.
Message #26 received at 60740 <at> debbugs.gnu.org (full text, mbox):
Jonas Bernoulli <jonas <at> bernoul.li> writes:
>>> But typing e.g. 'C-s C-x 8 e RET waving hand RET' fails with:
>
> That binding doesn't exist in my configuration. Do you mean
> "C-x 8 e e", i.e., emoji-insert?
The command is isearch-emoji-by-name, and the sequence to invoke it
_ends with RET_; FWIW that's what tripped me up when attempting to
reproduce (I kept hitting C-s C-x 8 e and failing to get the prompt).
FWIW² I can reproduce here (with 29 and master) _after_ removing
~/.emacs.d/transient.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60740
; Package
emacs
.
(Mon, 23 Jan 2023 12:10:02 GMT)
Full text and
rfc822 format available.
Message #29 received at 60740 <at> debbugs.gnu.org (full text, mbox):
> From: Jonas Bernoulli <jonas <at> bernoul.li>
> Cc: 60740 <at> debbugs.gnu.org
> Date: Sun, 22 Jan 2023 20:25:55 +0100
>
> >> But typing e.g. 'C-s C-x 8 e RET waving hand RET' fails with:
>
> That binding doesn't exist in my configuration. Do you mean
> "C-x 8 e e", i.e., emoji-insert?
>
> >> ⛔ Error (transient): Inconsistent transient state detected.
>
> I couldn't reproduce this with the above command (and also tried a
> few other emoji commands).
What exactly did you try? The problem I see here is that after typing
"C-s C-x 8 e RET waving hand RET", I immediately get the echo area
shows several variants of the "waving hands" Emoji, but if I type a
letter to choose one of them, I get the error message cited above.
> Recently I also noticed that my most recent attempt to update transient
> in emacs.git has gone wrong; I think I just forgot to push. I intend
> to merge transient.git into emacs.git very soon (it's all bugfixes and
> minor cosmetics), but have come aware of additional problems that I was
> planning to address first.
Please do that soon, and if that solves this problem, we can close the
bug.
> > I'd really like to have a solution for this before Emacs 29 goes into
> > pretest.
>
> When will that be?
VSN. Like in a week or so.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60740
; Package
emacs
.
(Thu, 26 Jan 2023 07:46:02 GMT)
Full text and
rfc822 format available.
Message #32 received at 60740 <at> debbugs.gnu.org (full text, mbox):
Ping! Any progress with this issue?
> Cc: larsi <at> gnus.org, 60740 <at> debbugs.gnu.org, juri <at> linkov.net
> Date: Mon, 23 Jan 2023 14:09:53 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
>
> > From: Jonas Bernoulli <jonas <at> bernoul.li>
> > Cc: 60740 <at> debbugs.gnu.org
> > Date: Sun, 22 Jan 2023 20:25:55 +0100
> >
> > >> But typing e.g. 'C-s C-x 8 e RET waving hand RET' fails with:
> >
> > That binding doesn't exist in my configuration. Do you mean
> > "C-x 8 e e", i.e., emoji-insert?
> >
> > >> ⛔ Error (transient): Inconsistent transient state detected.
> >
> > I couldn't reproduce this with the above command (and also tried a
> > few other emoji commands).
>
> What exactly did you try? The problem I see here is that after typing
> "C-s C-x 8 e RET waving hand RET", I immediately get the echo area
> shows several variants of the "waving hands" Emoji, but if I type a
> letter to choose one of them, I get the error message cited above.
>
> > Recently I also noticed that my most recent attempt to update transient
> > in emacs.git has gone wrong; I think I just forgot to push. I intend
> > to merge transient.git into emacs.git very soon (it's all bugfixes and
> > minor cosmetics), but have come aware of additional problems that I was
> > planning to address first.
>
> Please do that soon, and if that solves this problem, we can close the
> bug.
>
> > > I'd really like to have a solution for this before Emacs 29 goes into
> > > pretest.
> >
> > When will that be?
>
> VSN. Like in a week or so.
>
>
>
>
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60740
; Package
emacs
.
(Thu, 26 Jan 2023 15:45:02 GMT)
Full text and
rfc822 format available.
Message #35 received at 60740 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
> Ping! Any progress with this issue?
I have worked on it but haven't gotten anywhere yet.
I'll try again tomorrow.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60740
; Package
emacs
.
(Thu, 26 Jan 2023 16:39:01 GMT)
Full text and
rfc822 format available.
Message #38 received at 60740 <at> debbugs.gnu.org (full text, mbox):
> From: Jonas Bernoulli <jonas <at> bernoul.li>
> Cc: 60740 <at> debbugs.gnu.org, juri <at> linkov.net
> Date: Thu, 26 Jan 2023 16:43:56 +0100
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> > Ping! Any progress with this issue?
>
> I have worked on it but haven't gotten anywhere yet.
> I'll try again tomorrow.
Thanks. I thought you wanted to install a newer version of Transient,
and that the new version solves this problem? Which is why I thought
it would be a relatively simple job. Sorry if I misunderstood.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60740
; Package
emacs
.
(Mon, 30 Jan 2023 09:10:02 GMT)
Full text and
rfc822 format available.
Message #41 received at 60740 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: Jonas Bernoulli <jonas <at> bernoul.li>
>> Cc: 60740 <at> debbugs.gnu.org, juri <at> linkov.net
>> Date: Thu, 26 Jan 2023 16:43:56 +0100
>>
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>>
>> > Ping! Any progress with this issue?
>>
>> I have worked on it but haven't gotten anywhere yet.
>> I'll try again tomorrow.
>
> Thanks. I thought you wanted to install a newer version of Transient,
> and that the new version solves this problem? Which is why I thought
> it would be a relatively simple job. Sorry if I misunderstood.
Unfortunately there is a major bug in transient, which I am struggling
to fix. I have a working solution but it is quite abstruse and still
needs testing. I also have a nicer solution that doesn't really work
yet. If I knew I had time, I would work on the latter. But since the
pre-release could happen any time now, I should probably work on the
former.
Please warn me a day before you create the pre-release, so I can switch
my focus in time to merge the best solution I can come up by then into
Emacs.
I probably won't have time to fix isearch-emoji-by-name by then. One
problem is that emoji (not just this particular command) uses transient
in a way it was never intended to be used. I pointed that out when it
was originally added. But somehow it worked, so I never got around to
redo it.
I have actually rewritten how emoji uses transient a day ago, and while
it works in principal, it is not finished yet. I had some faint hope
that doing so would also magically fix isearch-emoji-by-name. It did
not. But it lays the ground work for doing that eventually.
I don't have the time to do that anymore. It would probably be best to
remove this command from Emacs 29.0.90.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60740
; Package
emacs
.
(Mon, 30 Jan 2023 13:11:02 GMT)
Full text and
rfc822 format available.
Message #44 received at 60740 <at> debbugs.gnu.org (full text, mbox):
> From: Jonas Bernoulli <jonas <at> bernoul.li>
> Cc: larsi <at> gnus.org, 60740 <at> debbugs.gnu.org, juri <at> linkov.net
> Date: Mon, 30 Jan 2023 10:09:34 +0100
>
> Unfortunately there is a major bug in transient, which I am struggling
> to fix. I have a working solution but it is quite abstruse and still
> needs testing. I also have a nicer solution that doesn't really work
> yet. If I knew I had time, I would work on the latter. But since the
> pre-release could happen any time now, I should probably work on the
> former.
What kind of time frame are you talking when you say "if I knew I had
time"?
> Please warn me a day before you create the pre-release, so I can switch
> my focus in time to merge the best solution I can come up by then into
> Emacs.
Will do.
> I probably won't have time to fix isearch-emoji-by-name by then. One
> problem is that emoji (not just this particular command) uses transient
> in a way it was never intended to be used. I pointed that out when it
> was originally added. But somehow it worked, so I never got around to
> redo it.
>
> I have actually rewritten how emoji uses transient a day ago, and while
> it works in principal, it is not finished yet. I had some faint hope
> that doing so would also magically fix isearch-emoji-by-name. It did
> not. But it lays the ground work for doing that eventually.
>
> I don't have the time to do that anymore. It would probably be best to
> remove this command from Emacs 29.0.90.
Since the command works for many Emoji, I prefer to leave it and live
with the known issues.
Thanks.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60740
; Package
emacs
.
(Mon, 30 Jan 2023 17:42:02 GMT)
Full text and
rfc822 format available.
Message #47 received at 60740 <at> debbugs.gnu.org (full text, mbox):
>> I don't have the time to do that anymore. It would probably be best to
>> remove this command from Emacs 29.0.90.
>
> Since the command works for many Emoji, I prefer to leave it and live
> with the known issues.
I disabled derived emoji in isearch-emoji-by-name,
so they don't cause the problems anymore in Emacs 29.
Leaving this bug report open to find a proper fix for master
if someone needs to select derived emoji.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60740
; Package
emacs
.
(Mon, 30 Jan 2023 18:04:02 GMT)
Full text and
rfc822 format available.
Message #50 received at 60740 <at> debbugs.gnu.org (full text, mbox):
> From: Juri Linkov <juri <at> linkov.net>
> Cc: Jonas Bernoulli <jonas <at> bernoul.li>, larsi <at> gnus.org, 60740 <at> debbugs.gnu.org
> Date: Mon, 30 Jan 2023 19:40:11 +0200
>
> >> I don't have the time to do that anymore. It would probably be best to
> >> remove this command from Emacs 29.0.90.
> >
> > Since the command works for many Emoji, I prefer to leave it and live
> > with the known issues.
>
> I disabled derived emoji in isearch-emoji-by-name,
> so they don't cause the problems anymore in Emacs 29.
Does this need some updates to NEWS or the manual?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60740
; Package
emacs
.
(Mon, 30 Jan 2023 18:14:02 GMT)
Full text and
rfc822 format available.
Message #53 received at 60740 <at> debbugs.gnu.org (full text, mbox):
>> >> I don't have the time to do that anymore. It would probably be best to
>> >> remove this command from Emacs 29.0.90.
>> >
>> > Since the command works for many Emoji, I prefer to leave it and live
>> > with the known issues.
>>
>> I disabled derived emoji in isearch-emoji-by-name,
>> so they don't cause the problems anymore in Emacs 29.
>
> Does this need some updates to NEWS or the manual?
I don't think so. Most users won't notice that something is missing.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60740
; Package
emacs
.
(Wed, 01 Feb 2023 23:10:02 GMT)
Full text and
rfc822 format available.
Message #56 received at 60740 <at> debbugs.gnu.org (full text, mbox):
* The first commit changes `isearch-emoji-by-name' to not use
transient. If there are derivations then `completing-read'
is instead used to let the user chose one.
I think we should stick to that. What I mention next, seems
way to risky at this time and I also do not think it would be
worth it. Selecting a derivation using `completing-read' isn't
bad at all.
(The problem with using a transient command inside
`with-isearch-suspended' is that expects to be able to call a
function, which uses `recursive-edit' in some way. Once that
returns, the macro resumes isearch. But transient does not do that
and it returns immediately after the transient prefix command
returns. That happens before the user selects a derivation by
invoking one of the suffix commands. So isearch resumes before
the user has made any choice.
One way around that might be to call `recursive-edit' in
`isearch-emoji-by-name' before calling the code that might then use
transient. But that would also have to automatically invoke a
command inside that recursive edit. I couldn't find a way to do
that. I timer might work, but that seems hacky.
Another approach could be to break up `with-isearch-suspended' up
into two functions, one that suspends and another that resumes.
The suspend function could maybe also responsible for returning
the resume function as a closure. The macro could use these two
functions and existing callers could continue to use that. But
`isearch-emoji-by-name' would only call the suspend function and
would have to somehow pass the resume function to transient, so
that it could call it when the time has come.)
* The second commit changes emoji.el to use transient.el the way I
intended it to be used. (I *think* transient already had support
for "dynamic" transient commands, when emoji.el was created, but
some of the convenience features certainly were missing still.)
The new implementation changes the remaining entry points to be
defined using `define-transient-prefix' but still without adding any
suffix commands to them up front. Previously no *prefix* command
was defined up front. Instead code very similar to what can be
found in `define-transient-prefix' was used to turn certain nodes
inside the tree of emoji into (sub-)prefix commands. These prefix
commands were then invoked using `funcall', which is not how that
is supposed to work; I am surprised that worked at all, but I guess
that just means that emoji doesn't use any of transient's features
that depend on `this-command' "being correct".
The new implementation adds a single, named suffix command,
`emoji-insert-glyph'. Now every suffix of a transient prefix is
either that command or a "recursive" call to the prefix itself, with
its scope narrowed to only part of the original tree of emoji. That
is a big improvement over the old implementation, which had to
define a new command for each and every emoji, and a new command for
every grouping of emoji.
Lars, previously a hash-table was used to track the emoji, that should
not be derived any further. I changed that to a list, because I am
yet to encounter a situation where more than one element has to be
tracked. Are there even any derivations of derivations? If so,
please point me to an example.
If there are any, then the first commit would have to be adjusted to
account for that. Otherwise, I think that is ready. I would still
like to test the second commit a bit more, before applying it.
Cheers,
Jonas
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60740
; Package
emacs
.
(Wed, 01 Feb 2023 23:10:02 GMT)
Full text and
rfc822 format available.
Message #59 received at 60740 <at> debbugs.gnu.org (full text, mbox):
* lisp/isearch.el (isearch-emoji-by-name): Use 'emoji--read-emoji'
and if that returns derivations, 'completing-read' to select one
of them. This fixes bug#60740.
* lisp/international/emoji.el (emoji--init): Autoload.
(emoji--read-emoji): New function, which doesn't use transient
and returns a list of the glyph and all derivations, if any.
(emoji--choose-emoji): Use 'emoji--read-emoji'.
---
lisp/international/emoji.el | 36 ++++++++++++++++++++----------------
lisp/isearch.el | 20 ++++++++------------
2 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/lisp/international/emoji.el b/lisp/international/emoji.el
index 2d17cf639b0..f75bd877991 100644
--- a/lisp/international/emoji.el
+++ b/lisp/international/emoji.el
@@ -245,6 +245,7 @@ emoji-list-help
(error "Emoji name is unknown")
(message "%s" name)))))
+;;;###autoload
(defun emoji--init (&optional force inhibit-adjust)
(when (or (not emoji--labels)
force)
@@ -638,7 +639,7 @@ emoji--split-long-lists
collect (cons (concat (string prefix) "-group")
(seq-take bit 77))))))))
-(defun emoji--choose-emoji ()
+(defun emoji--read-emoji ()
;; Use the list of names.
(let* ((table
(if (not emoji-alternate-names)
@@ -678,21 +679,24 @@ emoji--choose-emoji
(complete-with-action action table string pred)))
nil t)))
(when (cl-plusp (length name))
- (let* ((glyph (if emoji-alternate-names
- (cadr (split-string name "\t"))
- (gethash name emoji--all-bases)))
- (derived (gethash glyph emoji--derived)))
- (if (not derived)
- ;; Simple glyph with no derivations.
- (progn
- (emoji--add-recent glyph)
- (insert glyph))
- ;; Choose a derived version.
- (let ((emoji--done-derived (make-hash-table :test #'equal)))
- (setf (gethash glyph emoji--done-derived) t)
- (funcall
- (emoji--define-transient
- (cons "Choose Emoji" (cons glyph derived))))))))))
+ (let ((glyph (if emoji-alternate-names
+ (cadr (split-string name "\t"))
+ (gethash name emoji--all-bases))))
+ (cons glyph (gethash glyph emoji--derived))))))
+
+(defun emoji--choose-emoji ()
+ (pcase-let ((`(,glyph ,derived)) (emoji--read-emoji))
+ (if (not derived)
+ ;; Simple glyph with no derivations.
+ (progn
+ (emoji--add-recent glyph)
+ (insert glyph))
+ ;; Choose a derived version.
+ (let ((emoji--done-derived (make-hash-table :test #'equal)))
+ (setf (gethash glyph emoji--done-derived) t)
+ (funcall
+ (emoji--define-transient
+ (cons "Choose Emoji" (cons glyph derived))))))))
(defvar-keymap emoji-zoom-map
"+" #'emoji-zoom-increase
diff --git a/lisp/isearch.el b/lisp/isearch.el
index 22e27764127..bfa71756146 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -2774,25 +2774,21 @@ isearch-char-by-name
(mapconcat 'isearch-text-char-description
string ""))))))))
-(defvar emoji--derived)
(defun isearch-emoji-by-name (&optional count)
"Read an Emoji name and add it to the search string COUNT times.
COUNT (interactively, the prefix argument) defaults to 1.
The command accepts Unicode names like \"smiling face\" or
\"heart with arrow\", and completion is available."
(interactive "p")
+ (emoji--init)
(with-isearch-suspended
- (let ((emoji (with-temp-buffer
- ;; Derived emoji not supported yet (bug#60740).
- ;; So first load `emoji--labels', then `emoji--init'
- ;; will not fill `emoji--derived' that is set
- ;; to an empty hash table below.
- (ignore-errors (require 'emoji-labels))
- (let ((emoji--derived (make-hash-table :test #'equal)))
- (emoji-search))
- (if (and (integerp count) (> count 1))
- (apply 'concat (make-list count (buffer-string)))
- (buffer-string)))))
+ (pcase-let* ((`(,glyph . ,derived) (emoji--read-emoji))
+ (emoji (if derived
+ (completing-read "Select derivation: "
+ (cons glyph derived) nil t)
+ glyph)))
+ (when (and (integerp count) (> count 1))
+ (setq emoji (apply 'concat (make-list count emoji))))
(when emoji
(setq isearch-new-string (concat isearch-string emoji)
isearch-new-message (concat isearch-message
--
2.39.1
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60740
; Package
emacs
.
(Wed, 01 Feb 2023 23:10:03 GMT)
Full text and
rfc822 format available.
Message #62 received at 60740 <at> debbugs.gnu.org (full text, mbox):
* lisp/international/emoji.el:
(emoji--done-derived): Remove variable.
(emoji-insert, emoji-recent, emoji-search, emoji-list-select):
Define using 'transient-define-prefix'. Use a base suffix group
whose value is calculated dynamically.
(emoji--setup-prefix, emoji--setup-suffixes, emoji-group-description):
New functions used to dynamically calculate suffixes.
(emoji--narrow): New suffix class, used to pass state to recursive,
narrowed invocations of the prefix command the user initially invoked.
(emoji-insert-glyph): New suffix command that is used for all glyphs
that have no derivations. Previously a separate command was define
for each glyph.
(emoji--fontify-glyph): Replace 'inhibit-derived' argument with
'done-derived' argument.
(emoji--define-transient): Remove function.
(emoji--layout): New function, replacing 'emoji--define-transient'.
Return the suffixes in 'define-transient-prefix' format. Unlike
the replaced function, do not define any new commands, instead use
either the current prefix command or 'emoji-insert-glyph'.
(emoji--recent-transient): Remove function.
(emoji--char-sequence): New function.
(emoji--add-recent): Remove all text properties from glyph.
(emoji--choose-emoji): Remove function.
---
lisp/international/emoji.el | 266 +++++++++++++++++-------------------
1 file changed, 125 insertions(+), 141 deletions(-)
diff --git a/lisp/international/emoji.el b/lisp/international/emoji.el
index f75bd877991..b920582fee0 100644
--- a/lisp/international/emoji.el
+++ b/lisp/international/emoji.el
@@ -68,38 +68,86 @@ emoji--labels
(defvar emoji--all-bases nil)
(defvar emoji--derived nil)
(defvar emoji--names (make-hash-table :test #'equal))
-(defvar emoji--done-derived nil)
(define-multisession-variable emoji--recent (list "😀" "😖"))
(defvar emoji--insert-buffer)
-;;;###autoload
-(defun emoji-insert ()
+;;;###autoload (autoload 'emoji-insert "emoji" nil t)
+(transient-define-prefix emoji-insert ()
"Choose and insert an emoji glyph."
+ :variable-pitch t
+ [:class transient-columns
+ :setup-children emoji--setup-suffixes
+ :description emoji--group-description]
(interactive "*")
(emoji--init)
- (unless (fboundp 'emoji--command-Emoji)
- (emoji--define-transient))
- (funcall (intern "emoji--command-Emoji")))
+ (emoji--setup-prefix 'emoji-insert "Emoji" nil
+ `(("Recent" ,@(multisession-value emoji--recent))
+ ,@emoji--labels)))
-;;;###autoload
-(defun emoji-recent ()
+;;;###autoload (autoload 'emoji-recent "emoji" nil t)
+(transient-define-prefix emoji-recent ()
"Choose and insert one of the recently-used emoji glyphs."
+ :variable-pitch t
+ [:class transient-columns
+ :setup-children emoji--setup-suffixes
+ :description emoji--group-description]
(interactive "*")
(emoji--init)
- (unless (fboundp 'emoji--command-Emoji)
- (emoji--define-transient))
- (funcall (emoji--define-transient
- (cons "Recent" (multisession-value emoji--recent)) t)))
+ (emoji--setup-prefix 'emoji-recent "Recent" t
+ (multisession-value emoji--recent)))
-;;;###autoload
-(defun emoji-search ()
+;;;###autoload (autoload 'emoji-search "emoji" nil t)
+(transient-define-prefix emoji-search ()
"Choose and insert an emoji glyph by typing its Unicode name.
This command prompts for an emoji name, with completion, and
inserts it. It recognizes the Unicode Standard names of emoji,
and also consults the `emoji-alternate-names' alist."
+ :variable-pitch t
+ [:class transient-columns
+ :setup-children emoji--setup-suffixes
+ :description emoji--group-description]
(interactive "*")
(emoji--init)
- (emoji--choose-emoji))
+ (pcase-let ((`(,glyph . ,derived) (emoji--read-emoji)))
+ (if derived
+ (emoji--setup-prefix 'emoji-search "Choose Emoji"
+ (list glyph)
+ (cons glyph derived))
+ (emoji--add-recent glyph)
+ (insert glyph))))
+
+(defun emoji--setup-prefix (command title done-derived spec)
+ (transient-setup
+ command nil nil
+ :scope (if (eq transient-current-command command)
+ (cons (oref (transient-suffix-object) title)
+ (oref (transient-suffix-object) done-derived))
+ (cons title done-derived))
+ :value (if (eq transient-current-command command)
+ (oref (transient-suffix-object) children)
+ spec)))
+
+(defun emoji--setup-suffixes (_)
+ (transient-parse-suffixes
+ (oref transient--prefix command)
+ (pcase-let ((`(,title . ,done-derived) (oref transient--prefix scope)))
+ (emoji--layout (oref transient--prefix command) title
+ (oref transient--prefix value) done-derived))))
+
+(defun emoji--group-description ()
+ (car (oref transient--prefix scope)))
+
+(defclass emoji--narrow (transient-suffix)
+ ((title :initarg :title)
+ (done-derived :initarg :done-derived)
+ (children :initarg :children)))
+
+(transient-define-suffix emoji-insert-glyph ()
+ "Insert the emoji you selected."
+ (interactive nil not-a-mode)
+ (let ((glyph (oref (transient-suffix-object) description)))
+ (emoji--add-recent glyph)
+ (insert glyph)))
;;;###autoload
(defun emoji-list ()
@@ -179,11 +227,10 @@ emoji--list-generate
'help-echo (emoji--name glyph))))
(insert "\n\n"))))
-(defun emoji--fontify-glyph (glyph &optional inhibit-derived)
+(defun emoji--fontify-glyph (glyph &optional done-derived)
(propertize glyph 'face
- (if (and (not inhibit-derived)
- (or (null emoji--done-derived)
- (not (gethash glyph emoji--done-derived)))
+ (if (and (not (or (eq done-derived t)
+ (member glyph done-derived)))
(gethash glyph emoji--derived))
;; If this emoji has derivations, use a special face
;; to tell the user.
@@ -206,33 +253,30 @@ emoji-list-mode
:interactive nil
(setq-local truncate-lines t))
-(defun emoji-list-select (event)
+;;;###autoload (autoload 'emoji-list-select "emoji" nil t)
+(transient-define-prefix emoji-list-select (event)
"Select the emoji under point."
+ :variable-pitch t
+ [:class transient-columns
+ :setup-children emoji--setup-suffixes
+ :description emoji--group-description]
(interactive (list last-nonmenu-event) emoji-list-mode)
(mouse-set-point event)
(let ((glyph (get-text-property (point) 'emoji-glyph)))
(unless glyph
(error "No emoji under point"))
- (let ((derived (gethash glyph emoji--derived))
- (end-func
- (lambda ()
- (let ((buf emoji--insert-buffer))
- (quit-window)
- (if (buffer-live-p buf)
- (switch-to-buffer buf)
- (error "Buffer disappeared"))))))
- (if (not derived)
- ;; Glyph without derivations.
- (progn
- (emoji--add-recent glyph)
- (funcall end-func)
- (insert glyph))
- ;; Pop up a transient to choose between derivations.
- (let ((emoji--done-derived (make-hash-table :test #'equal)))
- (setf (gethash glyph emoji--done-derived) t)
- (funcall
- (emoji--define-transient (cons "Choose Emoji" (cons glyph derived))
- nil end-func)))))))
+ (let ((buf emoji--insert-buffer))
+ (quit-window)
+ (if (buffer-live-p buf)
+ (switch-to-buffer buf)
+ (error "Buffer disappeared")))
+ (let ((derived (gethash glyph emoji--derived)))
+ (if derived
+ (emoji--setup-prefix 'emoji-list-select "Choose Emoji"
+ (list glyph)
+ (cons glyph derived))
+ (emoji--add-recent glyph)
+ (insert glyph)))))
(defun emoji-list-help ()
"Display the name of the emoji at point."
@@ -476,97 +520,51 @@ emoji--add-glyph
(setq parent elem))
(nconc elem (list glyph)))))
-(defun emoji--define-transient (&optional alist inhibit-derived
- end-function)
- (unless alist
- (setq alist (cons "Emoji" emoji--labels)))
- (let* ((mname (pop alist))
- (name (intern (format "emoji--command-%s" mname)))
- (emoji--done-derived (or emoji--done-derived
- (make-hash-table :test #'equal)))
- (has-subs (consp (cadr alist)))
- (layout
- (if has-subs
- ;; Define sub-maps.
- (cl-loop for entry in
- (emoji--compute-prefix
- (if (equal mname "Emoji")
- (cons (list "Recent") alist)
- alist))
- collect (list
- (car entry)
- (emoji--compute-name (cdr entry))
- (if (equal (cadr entry) "Recent")
- (emoji--recent-transient end-function)
- (emoji--define-transient
- (cons (concat mname " > " (cadr entry))
- (cddr entry))))))
- ;; Insert an emoji.
- (cl-loop for glyph in alist
- for i in (append (number-sequence ?a ?z)
- (number-sequence ?A ?Z)
- (number-sequence ?0 ?9)
- (number-sequence ?! ?/))
- collect (let ((this-glyph glyph))
- (list
- (string i)
- (emoji--fontify-glyph
- glyph inhibit-derived)
- (let ((derived
- (and (not inhibit-derived)
- (not (gethash glyph
- emoji--done-derived))
- (gethash glyph emoji--derived))))
- (if derived
- ;; We have a derived glyph, so add
- ;; another level.
- (progn
- (setf (gethash glyph
- emoji--done-derived)
- t)
- (emoji--define-transient
- (cons (concat mname " " glyph)
- (cons glyph derived))
- t end-function))
- ;; Insert the emoji.
- (lambda ()
- (interactive nil not-a-mode)
- ;; Allow switching to the correct
- ;; buffer.
- (when end-function
- (funcall end-function))
- (emoji--add-recent this-glyph)
- (insert this-glyph)))))))))
- (args (apply #'vector mname
- (emoji--columnize layout
- (if has-subs 2 8)))))
- ;; There's probably a better way to do this...
- (setf (symbol-function name)
- (lambda ()
- (interactive nil not-a-mode)
- (transient-setup name)))
- (pcase-let ((`(,class ,slots ,suffixes ,docstr ,_body)
- (transient--expand-define-args (list args))))
- (put name 'interactive-only t)
- (put name 'function-documentation docstr)
- (put name 'transient--prefix
- (apply (or class 'transient-prefix) :command name
- (cons :variable-pitch (cons t slots))))
- (put name 'transient--layout
- (transient-parse-suffixes name suffixes)))
- name))
-
-(defun emoji--recent-transient (end-function)
- "Create a function to display a dynamically generated menu."
- (lambda ()
- (interactive)
- (funcall (emoji--define-transient
- (cons "Recent" (multisession-value emoji--recent))
- t end-function))))
+(defun emoji--layout (command title spec done-derived)
+ (let ((has-subs (consp (cadr spec))))
+ (emoji--columnize
+ (if has-subs
+ (cl-loop for (key desc . glyphs) in (emoji--compute-prefix spec)
+ collect
+ (list key
+ (emoji--compute-name (cons desc glyphs))
+ command
+ :class 'emoji--narrow
+ :title (concat title " > " desc)
+ :done-derived (or (string-suffix-p "Recent" desc)
+ done-derived)
+ :children glyphs))
+ (cl-loop for glyph in spec
+ for char in (emoji--char-sequence)
+ for key = (string char)
+ for derived = (and (not (or (eq done-derived t)
+ (member glyph done-derived)))
+ (gethash glyph emoji--derived))
+ collect
+ (if derived
+ (list key
+ (emoji--fontify-glyph glyph done-derived)
+ command
+ :class 'emoji--narrow
+ :title (concat title " " glyph)
+ :done-derived (or (eq done-derived t)
+ (cons glyph done-derived))
+ :children (cons glyph derived))
+ (list key
+ (emoji--fontify-glyph glyph done-derived)
+ 'emoji-insert-glyph))))
+ (if has-subs 2 8))))
+
+(defun emoji--char-sequence ()
+ (append (number-sequence ?a ?z)
+ (number-sequence ?A ?Z)
+ (number-sequence ?0 ?9)
+ (number-sequence ?! ?/)))
(defun emoji--add-recent (glyph)
"Add GLYPH to the set of recently used emojis."
(let ((recent (multisession-value emoji--recent)))
+ (set-text-properties 0 (length glyph) nil glyph)
(setq recent (delete glyph recent))
(push glyph recent)
;; Shorten the list.
@@ -684,20 +682,6 @@ emoji--read-emoji
(gethash name emoji--all-bases))))
(cons glyph (gethash glyph emoji--derived))))))
-(defun emoji--choose-emoji ()
- (pcase-let ((`(,glyph ,derived)) (emoji--read-emoji))
- (if (not derived)
- ;; Simple glyph with no derivations.
- (progn
- (emoji--add-recent glyph)
- (insert glyph))
- ;; Choose a derived version.
- (let ((emoji--done-derived (make-hash-table :test #'equal)))
- (setf (gethash glyph emoji--done-derived) t)
- (funcall
- (emoji--define-transient
- (cons "Choose Emoji" (cons glyph derived))))))))
-
(defvar-keymap emoji-zoom-map
"+" #'emoji-zoom-increase
"-" #'emoji-zoom-decrease)
--
2.39.1
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60740
; Package
emacs
.
(Sat, 04 Feb 2023 08:31:01 GMT)
Full text and
rfc822 format available.
Message #65 received at 60740 <at> debbugs.gnu.org (full text, mbox):
> Cc: larsi <at> gnus.org
> From: Jonas Bernoulli <jonas <at> bernoul.li>
> Date: Thu, 2 Feb 2023 00:09:16 +0100
>
> * The first commit changes `isearch-emoji-by-name' to not use
> transient. If there are derivations then `completing-read'
> is instead used to let the user chose one.
>
> I think we should stick to that. What I mention next, seems
> way to risky at this time and I also do not think it would be
> worth it. Selecting a derivation using `completing-read' isn't
> bad at all.
>
> (The problem with using a transient command inside
> `with-isearch-suspended' is that expects to be able to call a
> function, which uses `recursive-edit' in some way. Once that
> returns, the macro resumes isearch. But transient does not do that
> and it returns immediately after the transient prefix command
> returns. That happens before the user selects a derivation by
> invoking one of the suffix commands. So isearch resumes before
> the user has made any choice.
>
> One way around that might be to call `recursive-edit' in
> `isearch-emoji-by-name' before calling the code that might then use
> transient. But that would also have to automatically invoke a
> command inside that recursive edit. I couldn't find a way to do
> that. I timer might work, but that seems hacky.
>
> Another approach could be to break up `with-isearch-suspended' up
> into two functions, one that suspends and another that resumes.
> The suspend function could maybe also responsible for returning
> the resume function as a closure. The macro could use these two
> functions and existing callers could continue to use that. But
> `isearch-emoji-by-name' would only call the suspend function and
> would have to somehow pass the resume function to transient, so
> that it could call it when the time has come.)
>
> * The second commit changes emoji.el to use transient.el the way I
> intended it to be used. (I *think* transient already had support
> for "dynamic" transient commands, when emoji.el was created, but
> some of the convenience features certainly were missing still.)
>
> The new implementation changes the remaining entry points to be
> defined using `define-transient-prefix' but still without adding any
> suffix commands to them up front. Previously no *prefix* command
> was defined up front. Instead code very similar to what can be
> found in `define-transient-prefix' was used to turn certain nodes
> inside the tree of emoji into (sub-)prefix commands. These prefix
> commands were then invoked using `funcall', which is not how that
> is supposed to work; I am surprised that worked at all, but I guess
> that just means that emoji doesn't use any of transient's features
> that depend on `this-command' "being correct".
>
> The new implementation adds a single, named suffix command,
> `emoji-insert-glyph'. Now every suffix of a transient prefix is
> either that command or a "recursive" call to the prefix itself, with
> its scope narrowed to only part of the original tree of emoji. That
> is a big improvement over the old implementation, which had to
> define a new command for each and every emoji, and a new command for
> every grouping of emoji.
Thanks.
Would it make sense to install the first patch on the emacs-29 branch
and the second on master? Or did I misunderstand your explanations
above? AFAIU, the first patch solves the immediate issue in this bug,
right?
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60740
; Package
emacs
.
(Sat, 04 Feb 2023 12:06:01 GMT)
Full text and
rfc822 format available.
Message #68 received at 60740 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
> Thanks.
>
> Would it make sense to install the first patch on the emacs-29 branch
> and the second on master? Or did I misunderstand your explanations
> above? AFAIU, the first patch solves the immediate issue in this bug,
> right?
That's correct and it would make sense to do it like this. At the same
time I think that it is risky both to install and not install the second
patch on emacs-29. On the one hand past changes to transient did not
break emoji, even though I did not specifically try to prevent that. On
the other the risk of that happening going forward is not zero. If Lars
finds the time to look at the refactoring before the pre-release, I
think it would be best to install it on emacs-29, but if not, I am find
with it going on master instead.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60740
; Package
emacs
.
(Sat, 04 Feb 2023 12:30:02 GMT)
Full text and
rfc822 format available.
Message #71 received at 60740 <at> debbugs.gnu.org (full text, mbox):
> From: Jonas Bernoulli <jonas <at> bernoul.li>
> Cc: 60740 <at> debbugs.gnu.org, larsi <at> gnus.org
> Date: Sat, 04 Feb 2023 13:05:28 +0100
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> > Thanks.
> >
> > Would it make sense to install the first patch on the emacs-29 branch
> > and the second on master? Or did I misunderstand your explanations
> > above? AFAIU, the first patch solves the immediate issue in this bug,
> > right?
>
> That's correct and it would make sense to do it like this. At the same
> time I think that it is risky both to install and not install the second
> patch on emacs-29. On the one hand past changes to transient did not
> break emoji, even though I did not specifically try to prevent that. On
> the other the risk of that happening going forward is not zero. If Lars
> finds the time to look at the refactoring before the pre-release, I
> think it would be best to install it on emacs-29, but if not, I am find
> with it going on master instead.
My suggestion is for now to install the first patch on emacs-29 and
the second one on master. We can always backport from master to
emacs-29 if we decide so later.
From my POV at this time, it is important to resolve the few remaining
issues that prevent us from starting the Emacs 29 pretest, and this
issue is one of them. Which is why I suggest to do the above now, and
consider backporting the second patch to emacs-29 later if we have
time.
Thanks.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60740
; Package
emacs
.
(Sun, 05 Feb 2023 14:41:02 GMT)
Full text and
rfc822 format available.
Message #74 received at 60740 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
> My suggestion is for now to install the first patch on emacs-29 and
> the second one on master.
I've installed the first and will install the second once someone else
has merged emacs-29 into master.
> We can always backport from master to emacs-29 if we decide so later.
>
> From my POV at this time, it is important to resolve the few remaining
> issues that prevent us from starting the Emacs 29 pretest, and this
> issue is one of them. Which is why I suggest to do the above now, and
> consider backporting the second patch to emacs-29 later if we have
> time.
I didn't realize that was on option, and assumed that after the
pre-release is done, it would get *much* more difficult to get a
non-bugfix installed than before. I now assume it is only "quite
a bit harder, but better that than delaying the pre-release". ;P
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60740
; Package
emacs
.
(Sun, 05 Feb 2023 14:54:02 GMT)
Full text and
rfc822 format available.
Message #77 received at 60740 <at> debbugs.gnu.org (full text, mbox):
> From: Jonas Bernoulli <jonas <at> bernoul.li>
> Cc: 60740 <at> debbugs.gnu.org, larsi <at> gnus.org
> Date: Sun, 05 Feb 2023 15:40:48 +0100
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> > My suggestion is for now to install the first patch on emacs-29 and
> > the second one on master.
>
> I've installed the first and will install the second once someone else
> has merged emacs-29 into master.
OK, thanks.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60740
; Package
emacs
.
(Sun, 05 Feb 2023 15:03:01 GMT)
Full text and
rfc822 format available.
Message #80 received at 60740 <at> debbugs.gnu.org (full text, mbox):
> From: Jonas Bernoulli <jonas <at> bernoul.li>
> Cc: 60740 <at> debbugs.gnu.org, larsi <at> gnus.org
> Date: Sun, 05 Feb 2023 15:40:48 +0100
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> > My suggestion is for now to install the first patch on emacs-29 and
> > the second one on master.
>
> I've installed the first
This apparently leads to
ELC ../lisp/isearch.elc
In end of data:
isearch.el:2785:40: Warning: the function `emoji--read-emoji' is not known to be defined.
ELC international/emoji.elc
In emoji--choose-emoji:
international/emoji.el:688:37: Warning: Unused lexical variable `emoji--read-emoji'
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60740
; Package
emacs
.
(Sun, 05 Feb 2023 16:30:02 GMT)
Full text and
rfc822 format available.
Message #83 received at 60740 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: Jonas Bernoulli <jonas <at> bernoul.li>
>> Cc: 60740 <at> debbugs.gnu.org, larsi <at> gnus.org
>> Date: Sun, 05 Feb 2023 15:40:48 +0100
>>
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>>
>> > My suggestion is for now to install the first patch on emacs-29 and
>> > the second one on master.
>>
>> I've installed the first
>
> This apparently leads to
I looked at the log to prevent that, but I think I just redirected
stdout and forgot about stderr. Byte-compiler warnings go to stderr,
right?
> ELC ../lisp/isearch.elc
>
> In end of data:
> isearch.el:2785:40: Warning: the function `emoji--read-emoji' is not
> known to be defined.
What's the usual way of dealing with this in Emacs itself? I wasn't
sure using an autoload would work here, and was going to use another
approach if this resulted in a warning. Unfortunately I missed the
warning. Should I use 'declare-function' instead and require 'emoji'
inside 'isearch-emoji-by-name'?
> ELC international/emoji.elc
>
> In emoji--choose-emoji:
> international/emoji.el:688:37: Warning: Unused lexical variable
> `emoji--read-emoji'
Yikes.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#60740
; Package
emacs
.
(Sun, 05 Feb 2023 16:54:01 GMT)
Full text and
rfc822 format available.
Message #86 received at 60740 <at> debbugs.gnu.org (full text, mbox):
> From: Jonas Bernoulli <jonas <at> bernoul.li>
> Cc: 60740 <at> debbugs.gnu.org, larsi <at> gnus.org
> Date: Sun, 05 Feb 2023 17:29:12 +0100
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> > This apparently leads to
>
> I looked at the log to prevent that, but I think I just redirected
> stdout and forgot about stderr. Byte-compiler warnings go to stderr,
> right?
In batch mode, yes.
> > ELC ../lisp/isearch.elc
> >
> > In end of data:
> > isearch.el:2785:40: Warning: the function `emoji--read-emoji' is not
> > known to be defined.
>
> What's the usual way of dealing with this in Emacs itself? I wasn't
> sure using an autoload would work here, and was going to use another
> approach if this resulted in a warning. Unfortunately I missed the
> warning. Should I use 'declare-function' instead and require 'emoji'
> inside 'isearch-emoji-by-name'?
The below is better, IMO. I installed it.
diff --git a/lisp/isearch.el b/lisp/isearch.el
index bfa7175..62ac6f1 100644
--- a/lisp/isearch.el
+++ b/lisp/isearch.el
@@ -2773,7 +2773,7 @@ isearch-char-by-name
isearch-new-message (concat isearch-message
(mapconcat 'isearch-text-char-description
string ""))))))))
+(autoload 'emoji--read-emoji "emoji")
(defun isearch-emoji-by-name (&optional count)
"Read an Emoji name and add it to the search string COUNT times.
COUNT (interactively, the prefix argument) defaults to 1.
This bug report was last modified 2 years and 131 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.