emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Control help- and Info-mode buffers from other buffers


From: Arthur Miller
Subject: Re: Control help- and Info-mode buffers from other buffers
Date: Thu, 01 Jun 2023 10:50:36 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Juri Linkov <juri@linkov.net> writes:

>> Why can't we just invoke the command directly, via M-x, when anything
>> bound to a key is an interactive command by definition? The reason is
>> that commands are written with (or without) some assumptions.
>
> Because in this case you need to modify all commands to switch windows
> explicitly.

It was a rhetorical question, not something I really was asking you, and I gave
the very same answer after that one :).

Anyway, pre/post hook hack is very useful, and works with many commands, but not
with all, so it is not 100% failsafe and general.Try to execute Info-mode
from other window but Info (shortcut 'm'). In my Emacs it does not work.

My point was that commands to be written with this in mind.

Another problem with the above is that this will work only for 'other-window'
for which Emacs has an algorithm to figure out which window it is. But what when
you have more then two windows, and wish to switch to a different window than
what Emacs considers as 'other-window'? You will have to prompt the user, to
choose one. The help or info buffers are seldom the 'other-buffer' so constanly
choosing the window would be just as annoying as constantly switching to and
from, in my opinion.

I would prefer if there was a code gen in form of a macro, as suggested, similar
to define-minor-mode, that does this switching on pre-defined prefixes so that
we get uniformity, and helps people write commands so they work from
anywhere. Since it is not possible to completely automate it, perhaps lisp
manual could mention how to write commands so they are callable from other
windows then just selected one.

I don't say you should not include the pre/post hack into Emacs if you want, it
is better then what already is there for the similar purpose (don't remember
longer the one included since I don't use it). I am just saying that we should
perhaps write better commands in the future, so we don't need the hack :).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]