emacs-devel
[Top][All Lists]
Advanced

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

Re: Info-mode patch


From: Juri Linkov
Subject: Re: Info-mode patch
Date: Fri, 30 Jun 2023 10:13:30 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu)

>> Please note that risk of prompting user more than once doesn't exist in case
>> of using wrapper commands.  Only the wrapper command prompts the user.
>> Then all other intermediate functions called recursively or via
>> function call chain don't need to prompt the user again because
>> they all work in the right window.
>
> Yes, that is expected since you are calling old command from a new function. A
> new function is a clean slate, so yepp, I am aware of that and I was aware 
> that
> you want to pre-select window before calling the original command. So yes, 
> that
> is a positive thing with wrapper approach, you get that one for free. I just
> clarified what commands needed the optional window and why, since you seemed 
> to
> think that I meant all commands need it.

Another advantage of wrapper commands is that you can implement what
Manuel asked you to do to make key sequences for another window repeatable.
This is possible only when you have separate wrapper commands like
Info-directory-other-window and a separate keymap with them like
Info-other-window-map.

>> I see an extra map as an advantage because users will be able
>> to put both help-other-window and info-other-window commands
>> on the same prefix map.  Then e.g. 'M-i l' will go back either
>> in the nearest Help or Info window.
>
> What does that mean? You are building some general
> "go-back-in-help-or-info-mode" command that will work specifically for info 
> and
> help and switch based on window buffer, or what is your plan there?

Yes, you can build combined commands, so users need to bind only 1 key.

> How will you deal with 's' which does two completely different things,
> search and view source? Are you building some key dispatcher into your 
> wrapper?
> Under which name will users file the command in that collective map?

You can implement 's' with something like this

  (defun Info-search-or-help-view-source-other-window ()
    (with-selected-window (help-or-info-window)
      (if (derived-mode-p 'help-mode)
        (help-view-source)
      (Info-search)))

But such convenience is optional, this is just an example to demonstrate
flexibility of the wrapper commands approach.

> I am not sure I understand you there. How am I supposed to go back in info
> buffer, if help window is nearest, or how am I supposed to go back in some 
> other
> info buffer than the nearest one? What does "nearest" even mean?

The nearness can be defined by the combined help-or-info-window
that handles both modes.



reply via email to

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