Subject: Re: bug#60587: Patch for adding links to symbols' help documentation

From: "H. Dieter Wilhelm" <[email-masked]>
Date: Sun, 22 Jan 2023 14:00:00 +0100

Stefan Monnier <[email-masked]> writes:

>> Unfortunately I also need to investigate the code anew.  Yesterday I
>> realised a regression starting with Emacs-29!  `Tab' and `S-Tab' aren't
>> working any longer for Info references.  (E.g. the `Tab' keybinding is
>> switched from `Info-next-reference' to `forward-button'..)

Above information is, in fact, true but too narrow, since the
"switching" of keybindings is not occurring in general but only
happening when point sits directly on a button.  In regular Info text
either links, buttons and Info references, can still be reached by Tab
(or S-Tab).

> My crystal ball suggests that some code somewhere binds
> `forward-button` to the "tab" event rather than to the "TAB" event.
> "tab" should usually stay unbound (it is then remapped to "TAB" by
> `function-key-map`).

Poked around in button.el, info.el and help.el but couldn't find any
"tab" event binding (only "TAB").

But I think, I found the reason why it appears since Emacs-29, when
commenting out the following line in lisp/button.el the keybindings are
working as before Emacs-29:

    (defvar-keymap button-buffer-map
      :doc "Keymap useful for buffers containing buttons.
    Mode-specific keymaps may want to use this as their parent keymap."
      "TAB" #'forward-button
      "ESC TAB" #'backward-button
      "<backtab>" #'backward-button)

    (defvar-keymap button-map
      :doc "Keymap used by buttons."
-->;; :parent button-buffer-map
    "RET" #'push-button
      "<mouse-2>" #'push-button
      "<follow-link>" 'mouse-face
      ;; FIXME: You'd think that for keymaps coming from text-properties on the
      ;; mode-line or header-line, the `mode-line' or `header-line' prefix
      ;; shouldn't be necessary!
      "<mode-line> <mouse-2>" #'push-button
      "<header-line> <mouse-2>" #'push-button)

It seems to me that this is not a regression but some additional
functionality of Emacs.  I've yet to figure out how to deal with the
enhanced keymap of buttons..

-- 
Thank you for your interest

      Dieter

Best wishes
H. Dieter Wilhelm
Zwingenberg, Germany