all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: Dmitry Gutov <dmitry@gutov.dev>
Cc: 70577@debbugs.gnu.org
Subject: bug#70577: [PATCH] New command other-project-prefix
Date: Wed, 15 May 2024 09:46:52 +0300	[thread overview]
Message-ID: <86fruja9bf.fsf@mail.linkov.net> (raw)
In-Reply-To: <1b247d37-d1da-462a-9582-f7f7ff689d8f@gutov.dev> (Dmitry Gutov's message of "Tue, 14 May 2024 23:02:51 +0300")

>>> +(defvar other-project-prefix-transient-commands '(project-other-window-command
>>> +                                                  project-other-frame-command
>>> +                                                  project-other-tab-command
>>> +                                                  other-window-prefix
>>> +                                                  other-frame-prefix
>>> +                                                  other-tab-prefix)
>>> +  "List of commands that `other-project-prefix' does not apply to.
>> This doesn't yet support such things as 'C-x 5 p p'?
>
> I'm not sure that other-project-prefix can do that.
>
> How does other-frame-prefix work? display-buffer-override-next-command sets
> up hooks in the very familiar fashion, so that the next command (and only
> the next command) is affected by a number of changed variables, which get
> restored after.
>
> I suppose other-project-prefix could learn all the new variables it needs
> to "carry on", look up their values, and set them additionally for the next
> command. But that seems very ad-hoc.
>
> It seems the "proper" way to fix that would be a cross-codebase change
> where all similar "prefix" commands themselves check whether the next
> command is a "prefix" command as well, and if so, keep the variables and
> hooks in place for the command after it. This would also mean moving the
> information from other-project-prefix-transient-commands to symbol
> properties (the alternative I've mentioned previously).

In https://debbugs.gnu.org/cgi/bugreport.cgi?bug=63648#95
I made an unfinished attempt to handle this by:

```
diff --git a/lisp/window.el b/lisp/window.el
index ab7dd5ced12..52ba407d9c8 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -9099,7 +9091,8 @@ display-buffer-override-next-command
 		     (> (minibuffer-depth) minibuffer-depth)
 		     ;; But don't remove immediately after
 		     ;; adding the hook by the same command below.
-		     (eq this-command command))
+		     (eq this-command command)
+		     (memq this-command '(other-project-prefix)))
               (funcall exitfun))))
     ;; Call post-function after the next command finishes (bug#49057).
     (add-hook 'post-command-hook postfun)
```

I'm not sure if this is a proper way, this needs more trial-and-error.





  reply	other threads:[~2024-05-15  6:46 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-26  3:01 bug#70577: [PATCH] New command other-project-prefix Dmitry Gutov
2024-04-26  6:09 ` Juri Linkov
2024-04-26 10:59   ` Dmitry Gutov
2024-04-26 16:20     ` Dmitry Gutov
2024-04-28 12:13       ` Sean Whitton via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-28 15:56         ` Dmitry Gutov
2024-04-28 15:56         ` Dmitry Gutov
2024-04-28 16:46         ` Juri Linkov
2024-04-28 16:51       ` Juri Linkov
2024-04-28 21:40         ` Dmitry Gutov
2024-05-02  6:12           ` Juri Linkov
2024-05-04  2:12             ` Dmitry Gutov
2024-05-04  7:24               ` Eli Zaretskii
2024-05-04 17:22                 ` Dmitry Gutov
2024-05-04 17:34                   ` Eli Zaretskii
2024-05-05  0:02                     ` Dmitry Gutov
2024-05-05  5:44                       ` Eli Zaretskii
2024-05-05 18:26                         ` Dmitry Gutov
2024-05-05 16:40               ` Juri Linkov
2024-05-05 18:55                 ` Dmitry Gutov
2024-05-06 17:25                   ` Juri Linkov
2024-05-06 18:30                     ` Juri Linkov
2024-05-07 19:23                       ` Dmitry Gutov
2024-05-09  6:24                         ` Juri Linkov
2024-05-07 19:16                     ` Dmitry Gutov
2024-05-09  2:22                       ` Dmitry Gutov
2024-05-09  6:20                         ` Juri Linkov
2024-05-10  1:46                           ` Dmitry Gutov
2024-05-10  6:43                             ` Juri Linkov
2024-05-10 15:09                               ` Dmitry Gutov
2024-05-12 18:33                         ` Dmitry Gutov
2024-05-14  6:23                           ` Juri Linkov
2024-05-14 20:02                             ` Dmitry Gutov
2024-05-15  6:46                               ` Juri Linkov [this message]
2024-05-21  2:31                                 ` Dmitry Gutov
2024-05-21  6:08                                   ` Juri Linkov
2024-05-21 20:16                                     ` Dmitry Gutov
2024-05-22  6:12                                       ` Juri Linkov
2024-05-23  6:24                                         ` Juri Linkov
2024-05-26  2:38                                           ` Dmitry Gutov
2024-05-26  6:52                                             ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86fruja9bf.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=70577@debbugs.gnu.org \
    --cc=dmitry@gutov.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.