Subject: bug#74792: 29.2.50; goto-address-mode should support RET in special-mode buffers

From: Juri Linkov <[email-masked]>
Date: Mon, 16 Dec 2024 19:54:43 +0200

> For a long time I had been using RET to scroll by one line in Info:
>
>   (define-key Info-mode-map [return]
>     (lambda ()
>       (interactive)
>       (if nil ;; TODO: add predicate to check if point is on Info refs
>           (Info-follow-nearest-node)
>         (View-scroll-line-forward))))
>
> But still can't find a predicate that would prevent RET from visiting
> a reference only when the cursor moves to it while scrolling.
> And don't believe this is possible.  So need to use other
> less intuitive keys to visit links.

I forgot about other futile attempts to find a suitable heuristic:

  (define-key gnus-article-mode-map [return] 'my-gnus-article-press-or-scroll)
  (defun my-gnus-article-press-or-scroll ()
    (interactive)
    ;; When point is at the bottom of the window while scrolling
    (if (eq (point) (save-excursion (move-to-window-line -1) (point)))
        (View-scroll-line-forward)
      (gnus-article-press-button)))

Here the button is pressed when point is not at the bottom,
because point moves to the bottom while scrolling.
But in `emacs -Q` I see that point remains at the top
while scrolling.  So this behavior depends on customization.