GNU bug report logs - #70577
[PATCH] New command other-project-prefix

Previous Next

Package: emacs;

Reported by: Dmitry Gutov <dmitry <at> gutov.dev>

Date: Fri, 26 Apr 2024 03:03:21 UTC

Severity: wishlist

Tags: patch

Full log


Message #119 received at 70577 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: 70577 <at> debbugs.gnu.org
Subject: Re: bug#70577: [PATCH] New command other-project-prefix
Date: Sun, 26 May 2024 09:52:37 +0300
>>> -		     (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.




This bug report was last modified 125 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.