From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#70577: [PATCH] New command other-project-prefix Date: Sun, 26 May 2024 09:52:37 +0300 Organization: LINKOV.NET Message-ID: <86bk4tdp22.fsf@mail.linkov.net> References: <86jzkhe81b.fsf@mail.linkov.net> <208c7a05-6cfe-40c2-af54-187967348686@gutov.dev> <86le4tz88d.fsf@mail.linkov.net> <865xvsjklh.fsf@mail.linkov.net> <861q6esvhl.fsf@mail.linkov.net> <938582b5-0f86-4cb0-8bfe-afb26af0e8c9@gutov.dev> <86eda4hpyh.fsf@mail.linkov.net> <1b247d37-d1da-462a-9582-f7f7ff689d8f@gutov.dev> <86fruja9bf.fsf@mail.linkov.net> <86jzjneoju.fsf@mail.linkov.net> <86plte1jro.fsf@mail.linkov.net> <86fru9m8dq.fsf@mail.linkov.net> <5c377d02-d61b-4f9c-a34e-ef19b706b2de@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18933"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: 70577@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun May 26 09:15:17 2024 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 1sB868-0004pm-V2 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 26 May 2024 09:15:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sB85s-0006Bv-71; Sun, 26 May 2024 03:15:01 -0400 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 1sB85n-00069P-UQ for bug-gnu-emacs@gnu.org; Sun, 26 May 2024 03:14:55 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sB85m-0005yn-MB for bug-gnu-emacs@gnu.org; Sun, 26 May 2024 03:14:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sB85u-0006Oj-CT for bug-gnu-emacs@gnu.org; Sun, 26 May 2024 03:15:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 26 May 2024 07:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70577 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 70577-submit@debbugs.gnu.org id=B70577.171670768424537 (code B ref 70577); Sun, 26 May 2024 07:15:02 +0000 Original-Received: (at 70577) by debbugs.gnu.org; 26 May 2024 07:14:44 +0000 Original-Received: from localhost ([127.0.0.1]:38237 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sB85b-0006Nh-RX for submit@debbugs.gnu.org; Sun, 26 May 2024 03:14:44 -0400 Original-Received: from relay7-d.mail.gandi.net ([217.70.183.200]:53285) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sB85Z-0006NT-Kr for 70577@debbugs.gnu.org; Sun, 26 May 2024 03:14:42 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id C5E0220004; Sun, 26 May 2024 07:14:26 +0000 (UTC) In-Reply-To: <5c377d02-d61b-4f9c-a34e-ef19b706b2de@gutov.dev> (Dmitry Gutov's message of "Sun, 26 May 2024 05:38:33 +0300") X-GND-Sasl: juri@linkov.net 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:285924 Archived-At: >>> - (eq this-command command)) >>> + (eq this-original-command command) >> Actually the real problem is that in project--other-place-prefix >> prefix-command-preserve-state changes this-command to last-command. > > This one might not be so bad (the idea, as documented, seems sensible). > > Changing this-read-command seems more suspect. > > But I guess it really means more checks would need to be done on > this-original-command instead. :-/ > > The (eq this-original-command command) check could probably be dropped, but > otherwise your addition looks good (I don't know any cases where > this-original-command would be wrong, though apparently there might be some > -- remappings of the prefix commands? seems an odd thing to do). > > It might also be possible to rewrite display-buffer-override-next-command > in a way that the installation of the "advice" (not actual advice in its > case) happens in pre-command-hook - then at that point the current command > hasn't had a chance to alter this-command. > > prefun would check whether it needs to be applied, if yet, add the cleanup > function to post-command-hook, and run the setup. The modification of > display-buffer-overriding-action might also be better done there, so it > doesn't alter any prompter UI in the next prefix command that might be > invoked. > > Not an urgent change, just something to consider. > > Have you had a chance to run with the modified patch a little? Any edge new > edge cases crop up? I tried to use the patch for a while, with and without this-original-command, but it often leaves the postfun hook in display-buffer-override-next-command active infinitely, thus needed to restart Emacs too often, so I just removed the patch without debugging what part causes this.