From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#60740: [PATCH 0/2] emoji changes Date: Sat, 04 Feb 2023 10:30:36 +0200 Message-ID: <83zg9tu91v.fsf@gnu.org> References: <83leli3nly.fsf@gnu.org> <20230201230918.550-1-jonas@bernoul.li> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1561"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60740@debbugs.gnu.org, larsi@gnus.org To: Jonas Bernoulli Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 04 09:31:28 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pODxI-0000Gs-Ny for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 04 Feb 2023 09:31:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pODwx-00028Z-OV; Sat, 04 Feb 2023 03:31:07 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pODwt-000285-NL for bug-gnu-emacs@gnu.org; Sat, 04 Feb 2023 03:31:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pODwt-0000W1-Al for bug-gnu-emacs@gnu.org; Sat, 04 Feb 2023 03:31:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pODwr-0001k1-U8 for bug-gnu-emacs@gnu.org; Sat, 04 Feb 2023 03:31:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 04 Feb 2023 08:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60740 X-GNU-PR-Package: emacs Original-Received: via spool by 60740-submit@debbugs.gnu.org id=B60740.16754994384517 (code B ref 60740); Sat, 04 Feb 2023 08:31:01 +0000 Original-Received: (at 60740) by debbugs.gnu.org; 4 Feb 2023 08:30:38 +0000 Original-Received: from localhost ([127.0.0.1]:40644 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pODwU-00019s-BP for submit@debbugs.gnu.org; Sat, 04 Feb 2023 03:30:38 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:44982) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pODwS-0000sX-O5 for 60740@debbugs.gnu.org; Sat, 04 Feb 2023 03:30:37 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pODwM-0000P1-9g; Sat, 04 Feb 2023 03:30:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=ow3NdFkN+fmsAJ2hou2UZqRH9Jt5o2ZzxxDVRKbgH4Q=; b=eteGq18uPhXx jb29xq98BcwnkqYD/Z3V7vMTISIns1Sj7Uz96g6xOObdOCpj/YLwewfrRwZ0O6hRHyOXe4FRzviMZ ihdvsxSmpNuYoJaorJC8dcEEessUAvfY/x9eYk9tWRkGrreMvWj0cE2GC6yb5v68kwDtuNhKqW69V roqvg8gHkx8iI7M77RxfVSBqPzcNSc09++WcOutLY26yYWvPob0LbZj8ttC+l3tu4yUjHftgBRlXg UPNFBtuxSnbLDPZTG2YJP1wcd4j0E78qNWFeNzVDJXwTReLHIBm4ZO0dh4AsTFwh2J/qyfrtNg1dc QdqOLgKsgIZflAmR8IhQ0w==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pODwL-0003hH-ED; Sat, 04 Feb 2023 03:30:30 -0500 In-Reply-To: <20230201230918.550-1-jonas@bernoul.li> (message from Jonas Bernoulli on Thu, 2 Feb 2023 00:09:16 +0100) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:254758 Archived-At: > Cc: larsi@gnus.org > From: Jonas Bernoulli > 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?