unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Arthur Miller <arthur.miller@live.com>
To: Juri Linkov <juri@linkov.net>
Cc: emacs-devel@gnu.org
Subject: Re: Info-mode patch
Date: Mon, 03 Jul 2023 00:05:45 +0200	[thread overview]
Message-ID: <AM9PR09MB4977A55EDBFE14FD50521D829628A@AM9PR09MB4977.eurprd09.prod.outlook.com> (raw)
In-Reply-To: <86v8f2xkr4.fsf@mail.linkov.net> (Juri Linkov's message of "Sun,  02 Jul 2023 20:53:51 +0300")

Juri Linkov <juri@linkov.net> writes:

>>>>> 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.
>>>>
>>>> What exactly would not make my patch work with repeating commands?
>>>
>>> You can't add repeat symbols on existing Info commands used in Info buffers,
>>> only wrapper commands with a prefix key should be repeatable.
>>
>> I am not sure what that means, but I have tried repeat mode now with
>> my patch and it works out of the box. Both from an info buffer, and from other
>> buffer. It is kind-a cool, was not familiar with repeat mode before.
>
> But it's needed only for Info-other-window commands,
> not for Info-same-window commands.

Yes, I agree, and I don't need I need repeat mode for too many commands from
other window either; but since I have rebuilt the info mode itself, I have
"only" Info-mode-map, there are no "same-window/other-window" commands, and it
worked just fine with putting repeat mode on all, but that was expected. For the
record, I was able to port Info from version current master back to version 25
today. Only bad deal was a mailformad Info-spec, but everything seems to work well
when I test.

>> Can I get *some* help? When rewriting Info-mode-map definition, so I can use
>> :repeat keword to skip typing bunch of "put" statements, I couldn't add tool-bar
>> shortcuts in the map definitions. How do I use those with kbd syntax?
>>
>> (defvar-keymap Info-mode-map
>>   ( ... )
>>   ;;"<tool-bar> <C-Back in history>"    'Info-history-back-menu
>>   ;;"<tool-bar> <C-Forward in history>" 'Info-history-forward-menu
>>   )
>>
>> (define-key Info-mode-map [tool-bar C-Back\ in\ history]    'Info-history-back-menu)
>> (define-key Info-mode-map [tool-bar C-Forward\ in\ history] 'Info-history-forward-menu)
>>
>> I would like to not have to use those two define-key statements after the
>> definition.
>
> It seems you found a bug in 'key-valid-p'!
> And indeed it returns nil:
>
>   (key-valid-p "<tool-bar> <C-Back in history>")
>
> Whereas
>
>   (kbd "<tool-bar> <C-Back in history>")
>
> correctly returns [tool-bar C-Back\ in\ history].
>
> This is a clear bug in emacs-29.

Ok. Thanks, good to know. Then I'll keep those two outside of keymap definition.

>> Is there some way to tell interactive  where all propts will be placed, without
>> parsing interactive form and checking strings for interactive codes or something
>> similar awkward?
>
> Yes, there is such way by using the variable 'minibuffer-follows-selected-frame'.

So at least in theory, by let-bidinging it to nil, it should keep prompt
on the original frame. I did just quick naive test, and ended up in debugger:

(defun info-menu-wrapper ()
  (interactive)
  (let ((minibuffer-follows-selected-frame nil))
    (with-selected-window (info-window)
      (call-interactively #'Info-menu))))

but perhaps there are more tweacks to it which I am not familiar with, so I'll
leave it at that.

About wrapping; I agree that it is messy to go through each and every command as
I did to modify them, so for old existing commands, it is definitely easier to
do the wrapping, if possible. I just hope we get a better way for future command
writing. 

Thanks for the answer



  parent reply	other threads:[~2023-07-02 22:05 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-26 16:09 Info-mode patch Arthur Miller
2023-06-26 17:56 ` Juri Linkov
2023-06-26 20:17   ` Arthur Miller
2023-06-27  6:32     ` Juri Linkov
2023-06-27  7:54       ` Arthur Miller
2023-06-27 18:11         ` Juri Linkov
2023-06-27 23:09           ` Arthur Miller
2023-06-28  6:50             ` Juri Linkov
2023-06-28 21:52               ` Arthur Miller
2023-06-29  6:44                 ` Juri Linkov
2023-06-29 12:42                   ` Arthur Miller
2023-06-29 15:00                     ` [External] : " Drew Adams
2023-06-29 16:24                       ` Arthur Miller
2023-06-29 17:44                     ` Juri Linkov
2023-06-29 22:28                       ` Arthur Miller
2023-06-30  7:13                         ` Juri Linkov
2023-06-30  8:41                           ` Arthur Miller
2023-06-30 17:57                             ` Juri Linkov
2023-07-01  9:11                               ` Arthur Miller
2023-07-02 17:53                                 ` Juri Linkov
2023-07-02 18:39                                   ` Eli Zaretskii
2023-07-02 22:43                                     ` Arthur Miller
2023-07-03 11:46                                       ` Eli Zaretskii
2023-07-03 12:57                                         ` Arthur Miller
2023-07-03 13:17                                           ` Eli Zaretskii
2023-07-03 18:40                                             ` Juri Linkov
2023-07-03 18:57                                               ` Eli Zaretskii
2023-07-04  6:50                                                 ` easy-menu-define keys for key-valid-p (was: Info-mode patch) Juri Linkov
2023-07-04 11:33                                                   ` Eli Zaretskii
2023-07-03 21:07                                               ` Info-mode patch Arthur Miller
2023-07-04  7:59                                                 ` Andreas Schwab
2023-07-04  8:44                                                   ` Arthur Miller
2023-07-03 17:07                                       ` Eli Zaretskii
2023-07-04 23:58                                         ` Stefan Monnier
2023-07-08  8:14                                           ` Eli Zaretskii
2023-07-02 22:05                                   ` Arthur Miller [this message]
2023-07-03 18:45                                     ` Juri Linkov
2023-07-03 22:24                                       ` Arthur Miller
2023-07-04  6:54                                         ` Juri Linkov
2023-07-04  9:43                                           ` Arthur Miller
2023-07-04 17:51                                             ` Juri Linkov
2023-07-04 21:40                                               ` Arthur Miller
2023-07-05  6:17                                                 ` Juri Linkov
2023-07-05 14:25                                                   ` Arthur Miller
2023-07-01  9:59                         ` Getting Gnus to highlight citations in long mails (was: Info-mode patch) Kévin Le Gouguec
2023-07-01 12:40                           ` Getting Gnus to highlight citations in long mails Arthur Miller
2023-07-02 17:56                           ` Juri Linkov
2023-06-27 11:45   ` Info-mode patch Eli Zaretskii
2023-06-27 12:15     ` Arthur Miller
2023-06-27 12:42       ` Eli Zaretskii
2023-06-27 15:28         ` Arthur Miller
2023-06-27 16:03           ` Eli Zaretskii
2023-06-27 16:33             ` 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=AM9PR09MB4977A55EDBFE14FD50521D829628A@AM9PR09MB4977.eurprd09.prod.outlook.com \
    --to=arthur.miller@live.com \
    --cc=emacs-devel@gnu.org \
    --cc=juri@linkov.net \
    /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).