GNU bug report logs - #74792
29.2.50; goto-address-mode should support RET in special-mode buffers

Previous Next

Package: emacs;

Reported by: Spencer Baugh <sbaugh <at> janestreet.com>

Date: Wed, 11 Dec 2024 16:12:01 UTC

Severity: normal

Found in version 29.2.50

Full log


View this message in rfc822 format

From: Spencer Baugh <sbaugh <at> janestreet.com>
To: Juri Linkov <juri <at> linkov.net>
Cc: dmitry <at> gutov.dev, Eli Zaretskii <eliz <at> gnu.org>, 74792 <at> debbugs.gnu.org
Subject: bug#74792: 29.2.50; goto-address-mode should support RET in special-mode buffers
Date: Thu, 12 Dec 2024 15:47:12 -0500
Juri Linkov <juri <at> linkov.net> writes:

>>>  > goto-address-mode binds C-c RET to goto-address-at-point when point is
>>>  > on a URL or email address.  In special-mode buffers (or maybe any
>>>  > read-only buffer?) it should also bind RET while point is on the URL or
>>>  > email address.
>>> 
>>>  I don't think it's a good idea, since many special-mode descendants
>>>  bind RET to useful commands.  For goto-address-at-point to override
>>>  that would be a nuisance, I think.
>>> 
>>> True, but when I've specifically moved point to a URL it is usually because I want to follow the URL, not do
>>> whatever is bound to RET in the mode.
>>
>> You cannot know that.  E.g., point could be on a URL by chance, for
>> example, if a buffer starts with a URL.
>>
>>> But this sounds like something that may differ between users, so perhaps we could add this controlled by a
>>> defcustom?
>>
>> Let's first hear that enough people here think that it might sometimes
>> be a good thing.  If so, then yes, a user option, by default off,
>> could be a way to introduce such behavior.
>
> Typing just RET would be more intuitive, but indeed there is a problem
> that e.g. 'C-h C-t RET RET RET ...' will scroll lines one by one
> until this line becomes current:
>
>   https://www.gnu.org/licenses/why-assign.html
>
> Then RET will surprisingly visit that URL.
>
> Unfortunately, an option can't help because most users might want to
> enable it, but only if it doesn't misfire in unexpected situations.

True.  Perhaps it should be enabled buffer-locally, then.  Then a user
can set it in a major-mode hook - and if a major-mode does not bind RET
to something else, the major-mode can just enable it.




This bug report was last modified 75 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.