unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Arthur Miller <arthur.miller@live.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: juri@linkov.net,  manuel@ledu-giraud.fr,  emacs-devel@gnu.org
Subject: Re: Control help- and Info-mode buffers from other buffers
Date: Thu, 01 Jun 2023 15:45:53 +0200	[thread overview]
Message-ID: <AM9PR09MB4977E45152F739815608B0C396499@AM9PR09MB4977.eurprd09.prod.outlook.com> (raw)
In-Reply-To: <83o7lzcxm8.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 01 Jun 2023 05:57:54 -0400")

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Arthur Miller <arthur.miller@live.com>
>> Cc: Eli Zaretskii <eliz@gnu.org>,  manuel@ledu-giraud.fr,  emacs-devel@gnu.org
>> Date: Thu, 01 Jun 2023 11:16:50 +0200
>> 
>> In general, (I think) that allow to support commands that are available in
>> selected-window, to be executed in other-window, but does not have access to
>> commands defined in other-window, and naturally we can't executed commands from
>> selected-window if they are not supported in other-window. With other words, if
>> set of commands from selected window is S and set of commands in other-window is
>> O, than this will work in on the intersect of those commands, S∩O. Perhaps there
>> is more to it, but I think that is the minimal requirement (the commands has to
>> work on both buffers).
>
> I'm sorry, I don't understand what you are trying to say here.  What
> exactly is the minimum requirement, and why?

If I try to illustrate with an example: consider a two-window setup with scratch
buffer in first and info buffer in second window. If presses a key to execute
next command in other window and then 'm'the system will choose commands from
selected window (self-insert command in scratch buffer) and try to execute that
command in other window which is info buffer. Tbat is obviously wrong since user
probably meant to execute Info-menu, by default bound to 'm' in Info-mode.

I don't know if that can be fixed by perhaps manipulating unrread-key-events
list or in some other way, perhaps by putting input key back, or by some other
means. I haven't managed to get it correctly and have given up and instead tre
to address the problem in more fundamental way by making those functions aware
of the context they execute in. Also, even if problems could be fixed, I see no
point of using such method in this particular patch.

Sure, the hack has definitely a value on its own, and please, include it in
Emacs if you get some good understanding and robust error handling for it.

But for the suggested patch for help and info, I see no reason to use pre/post
hook to switch windows, I can just use with-selected-window which does 
exactly the same switching for me in 90% of cases, and manually fix the few
cases which needed some extra care.

>> Potentially it can also result in many bug repports and /r/Emacs threads where
>> people wonder why it does not work some command Foo in other buffer.
>
> If we have a good reason why it doesn't work, we will explain it.  And
> if we don't have a good reason, we can add another binding.  Where's
> the problem?

Yes, I understand that, and that is why I am also discussing it and trying to
bring to the table what is my understanding of the process involved. I don't
consider myself to understand everything going on in interaction between
commands and pre/post command hooks.

For example what happends if a command call
another command and it happen to have post hooks? Will it run after the second
command call internally (I think it will), which means it will switch back to
old window prematurely. 






  reply	other threads:[~2023-06-01 13:45 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-30  5:38 Control help- and Info-mode buffers from other buffers Arthur Miller
2023-05-30 12:54 ` Manuel Giraud via Emacs development discussions.
2023-05-30 13:31   ` Arthur Miller
2023-05-30 15:22     ` Manuel Giraud via Emacs development discussions.
2023-05-30 17:29     ` Juri Linkov
2023-05-31  5:55       ` Arthur Miller
2023-05-31 17:13         ` Juri Linkov
2023-06-01  3:16           ` Arthur Miller
2023-06-01  6:35             ` Juri Linkov
2023-06-01  7:05               ` Eli Zaretskii
2023-06-01  7:20                 ` Juri Linkov
2023-06-01  9:03                   ` Arthur Miller
2023-06-01  9:55                     ` Eli Zaretskii
2023-06-01 14:01                       ` Arthur Miller
2023-06-01  9:16                   ` Arthur Miller
2023-06-01  9:58                     ` Eli Zaretskii
2023-06-01 13:45                       ` Arthur Miller [this message]
2023-06-01 16:19                         ` Eli Zaretskii
2023-06-02  1:26                           ` Arthur Miller
2023-06-02  6:34                             ` Juri Linkov
2023-06-02 15:11                               ` Arthur Miller
2023-06-02 15:29                               ` Yuri Khan
2023-06-02 16:32                                 ` Juri Linkov
2023-06-04 14:09                                   ` Arthur Miller
2023-06-02  7:11                             ` Eli Zaretskii
2023-06-02 15:09                               ` Arthur Miller
2023-06-02 15:16                                 ` Eli Zaretskii
2023-06-03 13:53                                   ` Arthur Miller
2023-06-03 14:04                                     ` Eli Zaretskii
2023-06-03 15:06                                       ` Arthur Miller
2023-06-03 15:15                                         ` Eli Zaretskii
2023-06-04 14:19                                           ` Arthur Miller
2023-06-04 14:33                                             ` Eli Zaretskii
2023-06-04  7:52                                     ` Juri Linkov
2023-06-04 14:04                                       ` Arthur Miller
2023-06-04 16:50                                         ` Juri Linkov
2023-06-02 16:13                                 ` Juri Linkov
2023-06-03 13:49                                   ` Manuel Giraud via Emacs development discussions.
2023-06-04  7:44                                     ` Juri Linkov
2023-06-04  8:50                                       ` Eli Zaretskii
2023-06-04 13:40                                         ` [External] : " Drew Adams
2023-06-04 13:53                                           ` Arthur Miller
2023-06-04 14:00                                             ` Drew Adams
2023-06-04 14:20                                           ` Eli Zaretskii
2023-06-04 13:38                                       ` Manuel Giraud via Emacs development discussions.
2023-06-04  7:48                                   ` Juri Linkov
2023-06-01  8:50               ` Arthur Miller
2023-06-01 10:04                 ` Eli Zaretskii
2023-06-01 11:33                   ` Arthur Miller
2023-06-01 16:39                 ` Juri Linkov
2023-06-01 19:15                   ` Eli Zaretskii
2023-06-02  1:10                   ` Arthur Miller
2023-06-02  6:32                     ` Juri Linkov
2023-06-04 14:41                       ` Arthur Miller
2023-06-04 16:54                         ` Juri Linkov
2023-06-01  6:31           ` Juri Linkov
2023-05-30 16:15 ` Eli Zaretskii
2023-05-31  6:38   ` Arthur Miller
2023-05-30 18:04 ` [External] : " Drew Adams
2023-05-31  6:06   ` Arthur Miller
2023-05-31 13:00     ` Drew Adams
2023-05-31 13:27       ` Arthur Miller

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=AM9PR09MB4977E45152F739815608B0C396499@AM9PR09MB4977.eurprd09.prod.outlook.com \
    --to=arthur.miller@live.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=juri@linkov.net \
    --cc=manuel@ledu-giraud.fr \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).