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

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Spencer Baugh <sbaugh@HIDDEN>; dated Wed, 11 Dec 2024 16:12:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 74792 <at> debbugs.gnu.org:


Received: (at 74792) by debbugs.gnu.org; 16 Sep 2025 15:26:00 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Sep 16 11:26:00 2025
Received: from localhost ([127.0.0.1]:49364 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uyXZA-0004sZ-5t
	for submit <at> debbugs.gnu.org; Tue, 16 Sep 2025 11:26:00 -0400
Received: from mout-p-202.mailbox.org ([2001:67c:2050:0:465::202]:37730)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1uyXZ6-0004ro-Qk
 for 74792 <at> debbugs.gnu.org; Tue, 16 Sep 2025 11:25:57 -0400
Received: from smtp2.mailbox.org (smtp2.mailbox.org [10.196.197.2])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4cR5MF0c6qz9tSQ;
 Tue, 16 Sep 2025 17:25:45 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkov.net; s=MBO0001; 
 t=1758036345;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=gGWR21XgGBbIJpzNJLbcQMSY7z2aH+P27DtDcxKZ/n0=;
 b=Nwk5ghTmi1+V9XXHYb+N4NYTK/elhR7Iy6a7Dv7RODWVsDx3avPujarEs+y6108eiIHhTL
 ec0mdiMLuACQtwC2o7gidfFTHe7FHDPXNC538/2vFubPwb3e+F8mHU60l95qkLXY1jXCG0
 4hGK9G5vC4C36HQfR98bQZAtKY4ypl7VE7E3TAIG2DdQS0cQcAihP+tgCSDlElZpqlWGJu
 7C1XgeNu1MbVd0uzCrnFRDWNdvuWo4hsbHX64so8fwhGi//Kje0JR0xICPQ4Z3oRPNm60v
 w0g4WeXMjT8mlGz9mAjiL75bZk4rwrtLO1qsHij4oxZGE0zj/Ahsb1wc8VPj5A==
From: Juri Linkov <juri@HIDDEN>
To: Spencer Baugh <sbaugh@HIDDEN>
Subject: Re: bug#74792: 29.2.50; goto-address-mode should support RET in
 special-mode buffers
In-Reply-To: <874it7wz2y.fsf@HIDDEN>
Organization: LINKOV.NET
References: <ierzfl22oaa.fsf@HIDDEN> <874it7wz2y.fsf@HIDDEN>
Date: Tue, 16 Sep 2025 18:09:35 +0300
Message-ID: <87frcmhaq4.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 74792
Cc: dmitry@HIDDEN, 74792 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

> +(defun browse-url-keymap-filter (cmd)
> +  "Return CMD if `browse-url' button bindings should be active.
> +By default they are active only in special-mode buffers."
> +  (when (derived-mode-p 'special-mode)
> +    cmd))

Actually to be able to use RET on OSC-8 hyperlinks in shell and
compilation buffers, this condition should be extended to:

  (defun browse-url-keymap-filter (cmd)
    "Return CMD if `browse-url' button bindings should be active.
  By default they are active only in special-mode buffers."
    (when (derived-mode-p 'special-mode 'comint-mode 'compilation-mode)
      cmd))




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#74792; Package emacs. Full text available.

Message received at 74792 <at> debbugs.gnu.org:


Received: (at 74792) by debbugs.gnu.org; 13 Sep 2025 19:02:21 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Sep 13 15:02:20 2025
Received: from localhost ([127.0.0.1]:57138 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uxVVs-0003ou-GB
	for submit <at> debbugs.gnu.org; Sat, 13 Sep 2025 15:02:20 -0400
Received: from mout-p-101.mailbox.org ([80.241.56.151]:52120)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1uxVVo-0003o3-5c
 for 74792 <at> debbugs.gnu.org; Sat, 13 Sep 2025 15:02:17 -0400
Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4cPLJJ1HN7z9t8w;
 Sat, 13 Sep 2025 21:02:08 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkov.net; s=MBO0001; 
 t=1757790128;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=dsewXO+/TNY3hXQxgKv8YNa4g4iSwgg41z2dIMQFmoQ=;
 b=PaxKxLQsnPIn6XGNZ0AcoQb6zMDd1l6dS8pwVkUVdx6iKxDr5Q2s0VNRaIAnKCBbCGjmSZ
 AbqqfCl7HbMrIxb9wdB/1ngxQedJL3ChesrsF7+qcDjsF4CLVCy8hpBrBbof5h1kTVwXM/
 5dRcEkO6tq3XhPOE7q+NwqEhxFWLKUCbH6011lb3lla3OWw7KHYa6pCLtoMdMAJFrLgTz2
 yJCPF8qUiblOuBoYdNOSj9yU7uWhGUc34OF1P0xikr6h3/qIhU7GYGQPzxenJbw12pqhEa
 FuGrW31WmCQEoPLbtMeCb6tOkrjrwh1OenNsPH0AyPXjH0d6Yh5BSsUfoU7g/Q==
From: Juri Linkov <juri@HIDDEN>
To: Spencer Baugh <sbaugh@HIDDEN>
Subject: Re: bug#74792: 29.2.50; goto-address-mode should support RET in
 special-mode buffers
In-Reply-To: <ier5xdn8jrw.fsf@HIDDEN>
Organization: LINKOV.NET
References: <ierzfl22oaa.fsf@HIDDEN> <iertt77ttgg.fsf@HIDDEN>
 <875xdnvjol.fsf@HIDDEN> <ier5xdn8jrw.fsf@HIDDEN>
Date: Sat, 13 Sep 2025 21:48:08 +0300
Message-ID: <875xdmb2nz.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 74792
Cc: dmitry@HIDDEN, 74792 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>> Does this sound more preferable to have separate navigation spaces?
>> So when point is already on the link, then TAB could go to the next
>> goto-address-mode link, skipping all other link types.
>> And when point is on plain text, TAB could move to the next commit message.
>
> Hm, I guess personally I'd prefer TAB to only move between buttons, even
> when point isn't on a button, since I use n and p to move between
> entries.  But others may certainly disagree.

Since we can't change the default behavior, you can add just
such customization:

  (add-hook 'log-view-mode-hook 'button-mode)

and TAB will navigate the buttons.

Currently there are only 2 buttons in log-view buffers:

  [Show 2X entries]    [Show unlimited entries]

So we can turn goto-address-mode links and bug references
into buttons too, and TAB will navigate them as well.

>>> Perhaps this is just something the individual major mode should
>>> implement, though?  But maybe there's some opportunity for sharing some
>>> code to do the task "turn some text matching a regex into a
>>> button/widget"?
>>
>> There is e.g. 'browse-url-add-buttons' that uses 'browse-url-button-regexp'.
>> However, there is danger of breaking user configurations while rewriting
>> goto-addr.el to use 'browse-url-button-regexp' and button.el functions.
>>
>> If the goal is to have TAB navigate to the next link, it's safer to write
>> specific function that searches the next overlay with the property 'goto-address',
>
> Yes, seems hard to do in a robust way.
>
> I also don't really even like button.el that much - I dislike how C-h k
> RET points you to the generic push-button command, which is useless for
> figuring out what the button will actually do.

The only way to see what the button does is to type 'C-u C-x =' on it
and to inspect the 'action' property, but it displays byte-compiled code.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#74792; Package emacs. Full text available.

Message received at 74792 <at> debbugs.gnu.org:


Received: (at 74792) by debbugs.gnu.org; 12 Sep 2025 21:06:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 12 17:06:12 2025
Received: from localhost ([127.0.0.1]:51459 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uxAyB-0000tq-LR
	for submit <at> debbugs.gnu.org; Fri, 12 Sep 2025 17:06:12 -0400
Received: from mxout5.mail.janestreet.com ([64.215.233.18]:45041)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <sbaugh@HIDDEN>)
 id 1uxAy6-0000tH-0k
 for 74792 <at> debbugs.gnu.org; Fri, 12 Sep 2025 17:06:09 -0400
From: Spencer Baugh <sbaugh@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#74792: 29.2.50; goto-address-mode should support RET in
 special-mode buffers
In-Reply-To: <874it7wz2y.fsf@HIDDEN> (Juri Linkov's message of "Fri, 
 12 Sep 2025 19:14:05 +0300")
References: <ierzfl22oaa.fsf@HIDDEN> <874it7wz2y.fsf@HIDDEN>
Date: Fri, 12 Sep 2025 17:06:00 -0400
Message-ID: <ier348r8jpj.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com;
 s=waixah; t=1757711160;
 bh=Ie/Uqmh77oMr7dx7A60YTINYQBauu5yqj8hd2wv5/c8=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=cCeq/CfRwlovc5rPoMX2VlFa01Sm8Z/oTVsU32RWRU7Vh5Sp6XitAxu2zDuCGIiV0
 uYZTWQ4+gR3HdWcn5ru6fppKab8ZdC0Xm6zMETnMpJktEaLYyc3xWs4NOpnSz3a8Is
 xfpwAg/azvmL4WYjywCd+ED5LohV/TecsumbB5MjzsfGUbSmWwt1PZSoptZovMoS/k
 jIB3jvRdSBNQ0fiGi6sbvdSse1PXe63aYwe6clCpktXqLDoRB1AIC/kzh4k7LL2gFP
 xbQ0ZO9kx8gr1wL8GBSbyma/R0o3NkVsEjM91C3CUYr7SyR3/f2hL3GS3xIe3W9Mjn
 yU8grIpz3frGg==
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 74792
Cc: dmitry@HIDDEN, 74792 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Juri Linkov <juri@HIDDEN> writes:

>> This could be done with an extended-menu-item binding with a filter
>> which checks (derived-mode-p 'special-mode), but maybe there's a better
>> way?
>
> Using the filter function will allow the users to tune the required behavior
> depending on the context.

True.

> So now such filter is added here to be used
> in next 4 keymaps:
>
> diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
> index 63ed7283949..16fe506110b 100644
> --- a/lisp/net/browse-url.el
> +++ b/lisp/net/browse-url.el
> @@ -1759,9 +1759,24 @@ browse-url-elinks-sentinel
>  
>  ;;; Adding buttons to a buffer to call `browse-url' when you hit them.
>  
> +;;;###autoload
> +(defun browse-url-keymap-filter (cmd)
> +  "Return CMD if `browse-url' button bindings should be active.
> +By default they are active only in special-mode buffers."
> +  (when (derived-mode-p 'special-mode)
> +    cmd))
> +
> +;;;###autoload
> +(defun browse-url-keymap-bind (binding)
> +  "Use BINDING according to `browse-url-keymap-filter'."
> +  `(menu-item
> +    "" ,binding
> +    :filter ,#'browse-url-keymap-filter))
> +
>  (defvar-keymap browse-url-button-map
>    :doc "The keymap used for `browse-url' buttons."
> -  "RET"       #'browse-url-button-open
> +  "RET"       (browse-url-keymap-bind #'browse-url-button-open)
> +  "C-c RET"   #'browse-url-button-open
>    "<mouse-2>" #'browse-url-button-open
>    "w"         #'browse-url-button-copy)
>  
> diff --git a/lisp/net/goto-addr.el b/lisp/net/goto-addr.el
> index d803a050e90..b603cc04f8d 100644
> --- a/lisp/net/goto-addr.el
> +++ b/lisp/net/goto-addr.el
> @@ -121,6 +121,7 @@ goto-address-url-regexp
>  (defvar-keymap goto-address-highlight-keymap
>    :doc "Keymap to hold goto-addr's mouse key defs under highlighted URLs."
>    "<mouse-2>" #'goto-address-at-point
> +  "RET"       (browse-url-keymap-bind #'goto-address-at-point)
>    "C-c RET"   #'goto-address-at-point)
>  
>  (defun goto-address-context-menu (menu click)
> diff --git a/lisp/progmodes/bug-reference.el b/lisp/progmodes/bug-reference.el
> index 9901d5df245..f91e7536c6d 100644
> --- a/lisp/progmodes/bug-reference.el
> +++ b/lisp/progmodes/bug-reference.el
> @@ -45,6 +45,7 @@ bug-reference
>  (defvar-keymap bug-reference-map
>    :doc "Keymap used by bug reference buttons."
>    "<mouse-2>" #'bug-reference-push-button
> +  "RET"       (browse-url-keymap-bind #'bug-reference-push-button)
>    "C-c RET"   #'bug-reference-push-button)
>  
>  ;; E.g., "https://gcc.gnu.org/PR%s"
> diff --git a/lisp/ansi-osc.el b/lisp/ansi-osc.el
> index 83fcd0d184a..d3c066cfdba 100644
> --- a/lisp/ansi-osc.el
> +++ b/lisp/ansi-osc.el
> @@ -146,6 +146,7 @@ ansi-osc-directory-tracker
>  
>  (defvar-keymap ansi-osc-hyperlink-map
>    :doc "Keymap used by OSC 8 hyperlink buttons."
> +  "RET"           (browse-url-keymap-bind #'browse-url-button-open)
>    "C-c RET"       #'browse-url-button-open
>    "<mouse-2>"     #'browse-url-button-open
>    "<follow-link>" 'mouse-face)

Looks great to me.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#74792; Package emacs. Full text available.

Message received at 74792 <at> debbugs.gnu.org:


Received: (at 74792) by debbugs.gnu.org; 12 Sep 2025 21:04:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 12 17:04:44 2025
Received: from localhost ([127.0.0.1]:51450 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uxAwl-0000l2-L5
	for submit <at> debbugs.gnu.org; Fri, 12 Sep 2025 17:04:44 -0400
Received: from mxout5.mail.janestreet.com ([64.215.233.18]:49847)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <sbaugh@HIDDEN>)
 id 1uxAwi-0000kX-V4
 for 74792 <at> debbugs.gnu.org; Fri, 12 Sep 2025 17:04:41 -0400
From: Spencer Baugh <sbaugh@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#74792: 29.2.50; goto-address-mode should support RET in
 special-mode buffers
In-Reply-To: <875xdnvjol.fsf@HIDDEN> (Juri Linkov's message of "Fri, 
 12 Sep 2025 19:18:02 +0300")
References: <ierzfl22oaa.fsf@HIDDEN> <iertt77ttgg.fsf@HIDDEN>
 <875xdnvjol.fsf@HIDDEN>
Date: Fri, 12 Sep 2025 17:04:35 -0400
Message-ID: <ier5xdn8jrw.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com;
 s=waixah; t=1757711075;
 bh=jd/n4AEsEJxzglIet6OyrtrYciqjhtF+NvIGaq51BfI=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=DbI5s4buW6q93L9iGL+GDEZcIJ1mR/n8DpcHQmP+0Elm4LBJ69YcdJyaeVGOuQ7p4
 jStVjXn2bsSknxU5ZaEeZrcITkQc6QX9c4vkjek95M1+3/35K0RMucG6cb9ltlXpiX
 Mi1C7BXy7LlTtW8PDlQvZ3/0JE6da675piVqDooA7OiiHoGluoqadNEnO2OrCCzJMO
 Uz4gMQbHgivdawJjuilU++H44e+082FQckVLKMcouGKKjlqAUi6suqH+1noK1ug3lv
 DNFp3qncK0O98YEFSu/9OaGFU/UrmyTYVXLcZHUj8Mck0fyPSG4xsbdIRgktfwc+BC
 /RGypDRkwm/Zg==
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 74792
Cc: dmitry@HIDDEN, 74792 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Juri Linkov <juri@HIDDEN> writes:

>> As a more broad change which might also be useful, it would be nice if
>> there was a way to get goto-address-mode to use button.el buttons
>> instead of its own custom overlays.  Or perhaps to use wid-edit.el
>> widgets.
>>
>> I say this because if I have:
>> - A buffer that has buttons or widgets
>> - where TAB is bound to button-forward or widget-forward to navigate
>>   between buttons,
>> - and which also contains some arbitrary stretches of text (e.g. commit messages)
>> - and which wants to make URLs in that text clickable
>>
>> It would be nice to be able to use goto-address-mode to do this.  But it
>> would also be nice if goto-address-mode made the URLs into button.el
>> buttons or widgets, so that TAB navigated to the URLs too.
>
> This means mixing different navigation spaces.  Currently TAB always navigates
> to the next commit message.  After using button.el for goto-address-mode links,
> the users will need to type more TABs, since to be able to navigate to the
> next commit message, TAB first needs to traverse all goto-address-mode
> links in the currently open commit message.
>
> Also when 'bug-reference-mode' is enabled, will need to go through all
> bug references before arriving at the next commit message.

Oh, that's true.  I didn't even notice that TAB was bound to
log-view-msg-next in log-view-mode until now.  I usually use n and p to
move between entries.

> Does this sound more preferable to have separate navigation spaces?
> So when point is already on the link, then TAB could go to the next
> goto-address-mode link, skipping all other link types.
> And when point is on plain text, TAB could move to the next commit message.

Hm, I guess personally I'd prefer TAB to only move between buttons, even
when point isn't on a button, since I use n and p to move between
entries.  But others may certainly disagree.

>> Perhaps this is just something the individual major mode should
>> implement, though?  But maybe there's some opportunity for sharing some
>> code to do the task "turn some text matching a regex into a
>> button/widget"?
>
> There is e.g. 'browse-url-add-buttons' that uses 'browse-url-button-regexp'.
> However, there is danger of breaking user configurations while rewriting
> goto-addr.el to use 'browse-url-button-regexp' and button.el functions.
>
> If the goal is to have TAB navigate to the next link, it's safer to write
> specific function that searches the next overlay with the property 'goto-address',

Yes, seems hard to do in a robust way.

I also don't really even like button.el that much - I dislike how C-h k
RET points you to the generic push-button command, which is useless for
figuring out what the button will actually do.

The only real reason to use button.el is for the TAB behavior.  And that
is also fairly primitive...

So all of this is not really that important.  But maybe we'll think of
something better eventually.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#74792; Package emacs. Full text available.

Message received at 74792 <at> debbugs.gnu.org:


Received: (at 74792) by debbugs.gnu.org; 12 Sep 2025 16:20:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 12 12:20:33 2025
Received: from localhost ([127.0.0.1]:50828 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ux6Vl-0000ly-GG
	for submit <at> debbugs.gnu.org; Fri, 12 Sep 2025 12:20:33 -0400
Received: from mout-p-202.mailbox.org ([80.241.56.172]:51378)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1ux6VZ-0000ks-42
 for 74792 <at> debbugs.gnu.org; Fri, 12 Sep 2025 12:20:24 -0400
Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4cNflx2f0Dz9tV3;
 Fri, 12 Sep 2025 18:20:13 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkov.net; s=MBO0001; 
 t=1757694013;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=QFlhzXeUiPG+TAYy2NHINxaaP7uowXzcrMWtGXVWh8E=;
 b=yxshEmMnkczqy2JgG93UvZQokwrAtNUC8i6Il4eeze1MTLb3OCysejfvY16kgsdvFoqKUL
 GtalASDMvxP9+vyyig23cQvzQyXaXEhs455LpVRmFyYcj44MtictlblpVzw5AXyAhgk19P
 G2K3afZ/TAWeiAR11y2oYtjsNQVcQmgMKckDPz0LhsozGvKjRjTtmkH8yJTOEW4OGVd15z
 jI3FBIVUdoHbgpYqadBIEHHnL6lt8F+hjiRIFPUE6JDuwUEOgk55bFp1DWMZWpQC9ZDwXO
 HuEKUTzR3ed+ST5HDXcl8B6Gs22UvDkbDJ/hB5wXpcgcjyCnJ3bsDx8gn+AE5Q==
From: Juri Linkov <juri@HIDDEN>
To: Spencer Baugh <sbaugh@HIDDEN>
Subject: Re: bug#74792: 29.2.50; goto-address-mode should support RET in
 special-mode buffers
In-Reply-To: <iertt77ttgg.fsf@HIDDEN>
Organization: LINKOV.NET
References: <ierzfl22oaa.fsf@HIDDEN> <iertt77ttgg.fsf@HIDDEN>
Date: Fri, 12 Sep 2025 19:18:02 +0300
Message-ID: <875xdnvjol.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 74792
Cc: dmitry@HIDDEN, 74792 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

> As a more broad change which might also be useful, it would be nice if
> there was a way to get goto-address-mode to use button.el buttons
> instead of its own custom overlays.  Or perhaps to use wid-edit.el
> widgets.
>
> I say this because if I have:
> - A buffer that has buttons or widgets
> - where TAB is bound to button-forward or widget-forward to navigate
>   between buttons,
> - and which also contains some arbitrary stretches of text (e.g. commit messages)
> - and which wants to make URLs in that text clickable
>
> It would be nice to be able to use goto-address-mode to do this.  But it
> would also be nice if goto-address-mode made the URLs into button.el
> buttons or widgets, so that TAB navigated to the URLs too.

This means mixing different navigation spaces.  Currently TAB always navigates
to the next commit message.  After using button.el for goto-address-mode links,
the users will need to type more TABs, since to be able to navigate to the
next commit message, TAB first needs to traverse all goto-address-mode
links in the currently open commit message.

Also when 'bug-reference-mode' is enabled, will need to go through all
bug references before arriving at the next commit message.

Does this sound more preferable to have separate navigation spaces?
So when point is already on the link, then TAB could go to the next
goto-address-mode link, skipping all other link types.
And when point is on plain text, TAB could move to the next commit message.

> Perhaps this is just something the individual major mode should
> implement, though?  But maybe there's some opportunity for sharing some
> code to do the task "turn some text matching a regex into a
> button/widget"?

There is e.g. 'browse-url-add-buttons' that uses 'browse-url-button-regexp'.
However, there is danger of breaking user configurations while rewriting
goto-addr.el to use 'browse-url-button-regexp' and button.el functions.

If the goal is to have TAB navigate to the next link, it's safer to write
specific function that searches the next overlay with the property 'goto-address',




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#74792; Package emacs. Full text available.

Message received at 74792 <at> debbugs.gnu.org:


Received: (at 74792) by debbugs.gnu.org; 12 Sep 2025 16:20:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 12 12:20:33 2025
Received: from localhost ([127.0.0.1]:50826 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1ux6Vk-0000lq-In
	for submit <at> debbugs.gnu.org; Fri, 12 Sep 2025 12:20:33 -0400
Received: from mout-p-201.mailbox.org ([80.241.56.171]:43054)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1ux6VX-0000kS-6K
 for 74792 <at> debbugs.gnu.org; Fri, 12 Sep 2025 12:20:24 -0400
Received: from smtp102.mailbox.org (smtp102.mailbox.org
 [IPv6:2001:67c:2050:b231:465::102])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
 (No client certificate requested)
 by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4cNflt27Rrz9tLf;
 Fri, 12 Sep 2025 18:20:10 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linkov.net; s=MBO0001; 
 t=1757694010;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=Vi1OepRZMoV4/MAaDu11bhuHFMO7I33M2pZi7bFa/BU=;
 b=Fv9QDk8/TSe4k68UX+q7TkMWImrwIRUYKISZrAnOQ0nlTkofCkrQDhrkT6AFSs9NqrUPC1
 uM75ff+anaWUWgaqeygN1yfwM/Gwz+8sNpJSthPrt6QSu+mknItmYVI80G3zEbxPvphn5K
 vVBQ0vv/ADtiD2U3dbkaa/58bpgv3Hs4VLAQl0hjFFEFjho6KYU623o6adrwRBdPywz9es
 ENTNi9o4zM9wZIA3AlmeDx0QIkNQsGAMsYl5P7tagJ1S3p4yKjijGRFYVNGeGaD+dJL7ku
 kflDt3MMBtWW9y7yRE2yUFDQTiHfUb95rxAtglizsByDWW3ig+iu8z1coa+R9g==
Authentication-Results: outgoing_mbo_mout; dkim=none;
 spf=pass (outgoing_mbo_mout: domain of juri@HIDDEN designates
 2001:67c:2050:b231:465::102 as permitted sender)
 smtp.mailfrom=juri@HIDDEN
From: Juri Linkov <juri@HIDDEN>
To: Spencer Baugh <sbaugh@HIDDEN>
Subject: Re: bug#74792: 29.2.50; goto-address-mode should support RET in
 special-mode buffers
In-Reply-To: <ierzfl22oaa.fsf@HIDDEN>
Organization: LINKOV.NET
References: <ierzfl22oaa.fsf@HIDDEN>
Date: Fri, 12 Sep 2025 19:14:05 +0300
Message-ID: <874it7wz2y.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
X-Rspamd-Queue-Id: 4cNflt27Rrz9tLf
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 74792
Cc: dmitry@HIDDEN, 74792 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

--=-=-=
Content-Type: text/plain

> This could be done with an extended-menu-item binding with a filter
> which checks (derived-mode-p 'special-mode), but maybe there's a better
> way?

Using the filter function will allow the users to tune the required behavior
depending on the context.  So now such filter is added here to be used
in next 4 keymaps:


--=-=-=
Content-Type: text/x-diff
Content-Disposition: inline; filename=browse-url-keymap-bind.patch

diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index 63ed7283949..16fe506110b 100644
--- a/lisp/net/browse-url.el
+++ b/lisp/net/browse-url.el
@@ -1759,9 +1759,24 @@ browse-url-elinks-sentinel
 
 ;;; Adding buttons to a buffer to call `browse-url' when you hit them.
 
+;;;###autoload
+(defun browse-url-keymap-filter (cmd)
+  "Return CMD if `browse-url' button bindings should be active.
+By default they are active only in special-mode buffers."
+  (when (derived-mode-p 'special-mode)
+    cmd))
+
+;;;###autoload
+(defun browse-url-keymap-bind (binding)
+  "Use BINDING according to `browse-url-keymap-filter'."
+  `(menu-item
+    "" ,binding
+    :filter ,#'browse-url-keymap-filter))
+
 (defvar-keymap browse-url-button-map
   :doc "The keymap used for `browse-url' buttons."
-  "RET"       #'browse-url-button-open
+  "RET"       (browse-url-keymap-bind #'browse-url-button-open)
+  "C-c RET"   #'browse-url-button-open
   "<mouse-2>" #'browse-url-button-open
   "w"         #'browse-url-button-copy)
 
diff --git a/lisp/net/goto-addr.el b/lisp/net/goto-addr.el
index d803a050e90..b603cc04f8d 100644
--- a/lisp/net/goto-addr.el
+++ b/lisp/net/goto-addr.el
@@ -121,6 +121,7 @@ goto-address-url-regexp
 (defvar-keymap goto-address-highlight-keymap
   :doc "Keymap to hold goto-addr's mouse key defs under highlighted URLs."
   "<mouse-2>" #'goto-address-at-point
+  "RET"       (browse-url-keymap-bind #'goto-address-at-point)
   "C-c RET"   #'goto-address-at-point)
 
 (defun goto-address-context-menu (menu click)
diff --git a/lisp/progmodes/bug-reference.el b/lisp/progmodes/bug-reference.el
index 9901d5df245..f91e7536c6d 100644
--- a/lisp/progmodes/bug-reference.el
+++ b/lisp/progmodes/bug-reference.el
@@ -45,6 +45,7 @@ bug-reference
 (defvar-keymap bug-reference-map
   :doc "Keymap used by bug reference buttons."
   "<mouse-2>" #'bug-reference-push-button
+  "RET"       (browse-url-keymap-bind #'bug-reference-push-button)
   "C-c RET"   #'bug-reference-push-button)
 
 ;; E.g., "https://gcc.gnu.org/PR%s"
diff --git a/lisp/ansi-osc.el b/lisp/ansi-osc.el
index 83fcd0d184a..d3c066cfdba 100644
--- a/lisp/ansi-osc.el
+++ b/lisp/ansi-osc.el
@@ -146,6 +146,7 @@ ansi-osc-directory-tracker
 
 (defvar-keymap ansi-osc-hyperlink-map
   :doc "Keymap used by OSC 8 hyperlink buttons."
+  "RET"           (browse-url-keymap-bind #'browse-url-button-open)
   "C-c RET"       #'browse-url-button-open
   "<mouse-2>"     #'browse-url-button-open
   "<follow-link>" 'mouse-face)

--=-=-=--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#74792; Package emacs. Full text available.

Message received at 74792 <at> debbugs.gnu.org:


Received: (at 74792) by debbugs.gnu.org; 4 Apr 2025 06:52:04 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Apr 04 02:52:04 2025
Received: from localhost ([127.0.0.1]:36854 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1u0auK-0006hD-4u
	for submit <at> debbugs.gnu.org; Fri, 04 Apr 2025 02:52:04 -0400
Received: from relay2-d.mail.gandi.net ([217.70.183.194]:55961)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <juri@HIDDEN>) id 1u0auG-0006gW-Rr
 for 74792 <at> debbugs.gnu.org; Fri, 04 Apr 2025 02:52:01 -0400
Received: by mail.gandi.net (Postfix) with ESMTPSA id 568A2442A9;
 Fri,  4 Apr 2025 06:51:53 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Spencer Baugh <sbaugh@HIDDEN>
Subject: Re: bug#74792: 29.2.50; goto-address-mode should support RET in
 special-mode buffers
In-Reply-To: <iertt77ttgg.fsf@HIDDEN>
Organization: LINKOV.NET
References: <ierzfl22oaa.fsf@HIDDEN> <iertt77ttgg.fsf@HIDDEN>
Date: Fri, 04 Apr 2025 09:51:14 +0300
Message-ID: <87iknk8lnh.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-State: clean
X-GND-Score: -100
X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduledtjeejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufgjohhffffkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpeffgeetfeevlefhleejfeeuheeiudeitdffhfdutdekfeffgffhveehteegueekheenucfkphepledurdduvdelrddutdehrdduudejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrddutdehrdduudejpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohepgedprhgtphhtthhopegvlhhiiiesghhnuhdrohhrghdprhgtphhtthhopegumhhithhrhiesghhuthhovhdruggvvhdprhgtphhtthhopeejgeejledvseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepshgsrghughhhsehjrghnvghsthhrvggvthdrtghomh
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 74792
Cc: dmitry@HIDDEN, 74792 <at> debbugs.gnu.org, Eli Zaretskii <eliz@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

> As a more broad change which might also be useful, it would be nice if
> there was a way to get goto-address-mode to use button.el buttons
> instead of its own custom overlays.  Or perhaps to use wid-edit.el
> widgets.
>
> I say this because if I have:
> - A buffer that has buttons or widgets
> - where TAB is bound to button-forward or widget-forward to navigate
>   between buttons,
> - and which also contains some arbitrary stretches of text (e.g. commit messages)
> - and which wants to make URLs in that text clickable
>
> It would be nice to be able to use goto-address-mode to do this.  But it
> would also be nice if goto-address-mode made the URLs into button.el
> buttons or widgets, so that TAB navigated to the URLs too.
>
> Perhaps this is just something the individual major mode should
> implement, though?  But maybe there's some opportunity for sharing some
> code to do the task "turn some text matching a regex into a
> button/widget"?

Allowing TAB to navigate to the next URL would be nice.
I don't know how easy is to add button.el buttons to goto-addr.el.
Alternatively, goto-address-highlight-keymap could have
a goto-address specific command to go to the next
'goto-address' overlay.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#74792; Package emacs. Full text available.

Message received at 74792 <at> debbugs.gnu.org:


Received: (at 74792) by debbugs.gnu.org; 1 Apr 2025 22:20:23 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 01 18:20:23 2025
Received: from localhost ([127.0.0.1]:52045 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tzjy2-0003my-GH
	for submit <at> debbugs.gnu.org; Tue, 01 Apr 2025 18:20:22 -0400
Received: from mxout5.mail.janestreet.com ([64.215.233.18]:42365)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <sbaugh@HIDDEN>)
 id 1tzjy1-0003j9-00
 for 74792 <at> debbugs.gnu.org; Tue, 01 Apr 2025 18:20:21 -0400
From: Spencer Baugh <sbaugh@HIDDEN>
To: 74792 <at> debbugs.gnu.org
Subject: Re: bug#74792: 29.2.50; goto-address-mode should support RET in
 special-mode buffers
In-Reply-To: <ierzfl22oaa.fsf@HIDDEN> (Spencer Baugh's message of
 "Wed, 11 Dec 2024 11:10:53 -0500")
References: <ierzfl22oaa.fsf@HIDDEN>
Date: Tue, 01 Apr 2025 18:20:15 -0400
Message-ID: <iertt77ttgg.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com;
 s=waixah; t=1743546015;
 bh=s6cUs5sodvAbeomoX6YIFeRY7I/57a7ZejKDZQDkQAc=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=JiECAbaGjAZjbAhQsdQJHuVCjmKVl4ec8htnYKksk+kwgRqzPJ37hkto6Fod8tU+k
 XK5JsT05nn2M5JWTXfVIuQSERe6B1JWW3xZBSMSeRUbRhBCQDxt8qROFGd8BNCxDZp
 YvoHFIVt/IbO2aqm9cQK5O4rZvyXVLu+NzbXmvS8URy4LCbYBS73h+58//h1Dvmll3
 Afq980mALQAB2C5OzV7xD9PuFfNvd/pk30HX1u3/MJ9j2mrygkvM1MrRDjlPBj45S5
 wb5eN5WGL5mkwTRBiTwL42tf0wH5E1DkTuZH8HVjcEQl//K23FU/EpWUGtJktKKig8
 RA/na0Gqo3quA==
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 74792
Cc: dmitry@HIDDEN, Eli Zaretskii <eliz@HIDDEN>,
 Juri Linkov <juri@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)


As a more broad change which might also be useful, it would be nice if
there was a way to get goto-address-mode to use button.el buttons
instead of its own custom overlays.  Or perhaps to use wid-edit.el
widgets.

I say this because if I have:
- A buffer that has buttons or widgets
- where TAB is bound to button-forward or widget-forward to navigate
  between buttons,
- and which also contains some arbitrary stretches of text (e.g. commit messages)
- and which wants to make URLs in that text clickable

It would be nice to be able to use goto-address-mode to do this.  But it
would also be nice if goto-address-mode made the URLs into button.el
buttons or widgets, so that TAB navigated to the URLs too.

Perhaps this is just something the individual major mode should
implement, though?  But maybe there's some opportunity for sharing some
code to do the task "turn some text matching a regex into a
button/widget"?





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#74792; Package emacs. Full text available.

Message received at 74792 <at> debbugs.gnu.org:


Received: (at 74792) by debbugs.gnu.org; 16 Dec 2024 17:56:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Dec 16 12:56:48 2024
Received: from localhost ([127.0.0.1]:55979 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tNFKq-00080k-8h
	for submit <at> debbugs.gnu.org; Mon, 16 Dec 2024 12:56:48 -0500
Received: from relay3-d.mail.gandi.net ([217.70.183.195]:38179)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1tNFKo-00080S-2M
 for 74792 <at> debbugs.gnu.org; Mon, 16 Dec 2024 12:56:47 -0500
Received: by mail.gandi.net (Postfix) with ESMTPSA id 7478860002;
 Mon, 16 Dec 2024 17:56:36 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Spencer Baugh <sbaugh@HIDDEN>
Subject: Re: bug#74792: 29.2.50; goto-address-mode should support RET in
 special-mode buffers
In-Reply-To: <87a5d06ntm.fsf@HIDDEN> (Juri Linkov's message of "Fri, 
 13 Dec 2024 09:31:49 +0200")
Organization: LINKOV.NET
References: <ierzfl22oaa.fsf@HIDDEN> <86ldwm2lko.fsf@HIDDEN>
 <CAO=BR8MtXJewQBhrJmvQZTS2T3nxAu6+UCG-=hYnwPTYbdYXtQ@HIDDEN>
 <86ed2e2gnm.fsf@HIDDEN> <87v7vp6vfd.fsf@HIDDEN>
 <ierikror5m7.fsf@HIDDEN> <87a5d06ntm.fsf@HIDDEN>
Date: Mon, 16 Dec 2024 19:54:43 +0200
Message-ID: <87seqnecnw.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 74792
Cc: dmitry@HIDDEN, Eli Zaretskii <eliz@HIDDEN>, 74792 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

> 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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#74792; Package emacs. Full text available.

Message received at 74792 <at> debbugs.gnu.org:


Received: (at 74792) by debbugs.gnu.org; 13 Dec 2024 07:37:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Dec 13 02:37:51 2024
Received: from localhost ([127.0.0.1]:41391 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tM0FD-0006PQ-7X
	for submit <at> debbugs.gnu.org; Fri, 13 Dec 2024 02:37:51 -0500
Received: from relay8-d.mail.gandi.net ([217.70.183.201]:42071)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1tM0F8-0006P6-PJ
 for 74792 <at> debbugs.gnu.org; Fri, 13 Dec 2024 02:37:50 -0500
Received: by mail.gandi.net (Postfix) with ESMTPSA id C7B9A1BF206;
 Fri, 13 Dec 2024 07:37:39 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Spencer Baugh <sbaugh@HIDDEN>
Subject: Re: bug#74792: 29.2.50; goto-address-mode should support RET in
 special-mode buffers
In-Reply-To: <ierikror5m7.fsf@HIDDEN> (Spencer Baugh's message of
 "Thu, 12 Dec 2024 15:47:12 -0500")
Organization: LINKOV.NET
References: <ierzfl22oaa.fsf@HIDDEN> <86ldwm2lko.fsf@HIDDEN>
 <CAO=BR8MtXJewQBhrJmvQZTS2T3nxAu6+UCG-=hYnwPTYbdYXtQ@HIDDEN>
 <86ed2e2gnm.fsf@HIDDEN> <87v7vp6vfd.fsf@HIDDEN>
 <ierikror5m7.fsf@HIDDEN>
Date: Fri, 13 Dec 2024 09:31:49 +0200
Message-ID: <87a5d06ntm.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 74792
Cc: dmitry@HIDDEN, Eli Zaretskii <eliz@HIDDEN>, 74792 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>> 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 means disabling RET on links in etc/TODO and all other
link-rich files that use 'view-help-file':

(defun describe-distribution ()
  "Display info on how to obtain the latest version of GNU Emacs."
  (interactive)
  (view-help-file "DISTRIB"))

(defun describe-copying ()
  "Display info on how you may redistribute copies of GNU Emacs."
  (interactive)
  (view-help-file "COPYING"))

(defun view-emacs-problems ()
  "Display info on known problems with Emacs and possible workarounds."
  (interactive)
  (view-help-file "PROBLEMS"))

(defun view-emacs-debugging ()
  "Display info on how to debug Emacs problems."
  (interactive)
  (view-help-file "DEBUG"))

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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#74792; Package emacs. Full text available.

Message received at 74792 <at> debbugs.gnu.org:


Received: (at 74792) by debbugs.gnu.org; 12 Dec 2024 23:21:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 12 18:21:06 2024
Received: from localhost ([127.0.0.1]:40833 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tLsUP-0007qF-QS
	for submit <at> debbugs.gnu.org; Thu, 12 Dec 2024 18:21:06 -0500
Received: from fhigh-a6-smtp.messagingengine.com ([103.168.172.157]:48189)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dmitry@HIDDEN>) id 1tLsUJ-0007pb-3e
 for 74792 <at> debbugs.gnu.org; Thu, 12 Dec 2024 18:20:59 -0500
Received: from phl-compute-06.internal (phl-compute-06.phl.internal
 [10.202.2.46])
 by mailfhigh.phl.internal (Postfix) with ESMTP id 3EFDF114015A;
 Thu, 12 Dec 2024 18:20:49 -0500 (EST)
Received: from phl-mailfrontend-01 ([10.202.2.162])
 by phl-compute-06.internal (MEProxy); Thu, 12 Dec 2024 18:20:49 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc
 :cc:content-transfer-encoding:content-type:content-type:date
 :date:from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to; s=fm3; t=1734045649;
 x=1734132049; bh=BGHbVV3SNbf8N3ieswCAfjgWdfng+o8vAei9hnuk0uo=; b=
 AjYckKowsAz8383RjAuIgKqNBIO8ZOHxk9t/v7hRAaRHA+BiZt/n6YIKBx77RQ0c
 +hsW6G0nT5ctBw6jjWoSvix2Rkza+A8OntXffaa1z9FIcJagjG6+vkCBRusSlwNT
 ffQqwpOp8qQQ+DvWxwpUBulUnePJ+whvh2s1SPwy1L7L/+eKLznzgsy1rFveyKam
 Taj6SpGHjGn5hfPyQmAKokyAOGwBzlSwzs5fUkOJkVQHExPB2L1/u/sscX56zL59
 io3d+7ulHuFsYiD57HSoM7+V4Z5jvk5+5g0/YxDU6jq30mnhpt9EbIjGcgDUBWFm
 8vDtdsXVZvJvIx9tR76bmw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-transfer-encoding
 :content-type:content-type:date:date:feedback-id:feedback-id
 :from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1734045649; x=
 1734132049; bh=BGHbVV3SNbf8N3ieswCAfjgWdfng+o8vAei9hnuk0uo=; b=s
 7TdIHjZwOBbfHu3rMoDYKve5MpKQDqrLO/0qTqV4hAFCG32Bc0Ky9dxrsy7tIjv9
 HZTAlIGB0jtC7FHxvCUkVfkJAQVQvzRY6vWNOs7E98tJxzlnAYyKRv/TFMGRlrac
 2ofDvroIr7m4XbE1HSS9r4I9r9dto7djS8YBfFy3v0rm43R9/SB9376Mw22gbyB7
 IFYmmm2byj2NGSlOX/38YzYqTHVu5wfrRQBVJG6e7akyDzyxPujIuVCDsb5n+ljT
 91vM7LV1NUqIcQN8luoktTONdR/M+yw/LhRGKV3DitkBTZTCace5TRdPpzvhbqKD
 mgTRAY/RzZ5BGaNFMeLrQ==
X-ME-Sender: <xms:0G9bZz_FflwqKB6qhbCQ0MUQQaVsQXKsI809dBme85N8Xrz1oFhVXQ>
 <xme:0G9bZ_uxOgcfcEOY1222FPbUOyFvKgg86HCM4sZBOxPmwp-gfeee2dWkk331JDP4k
 Nf06T8cVT1QrXj0grA>
X-ME-Received: <xmr:0G9bZxCiqYS7bwUn5Fp0qvgv1h_2aJlytPulN3o9l6wBO-oxNcfuke8lnc-XsCMOBbQk>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrkeeigddtlecutefuodetggdotefrodftvf
 curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr
 tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth
 hsucdlqddutddtmdenucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeen
 ucfhrhhomhepffhmihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvg
 hvqeenucggtffrrghtthgvrhhnpeetudeljeegheetgfehgeejkeeuhedvveeikeeufedt
 vddtveefhfdvveegudejheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh
 grihhlfhhrohhmpegumhhithhrhiesghhuthhovhdruggvvhdpnhgspghrtghpthhtohep
 fedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepvghlihiisehgnhhurdhorhhgpd
 hrtghpthhtohepshgsrghughhhsehjrghnvghsthhrvggvthdrtghomhdprhgtphhtthho
 peejgeejledvseguvggssghughhsrdhgnhhurdhorhhg
X-ME-Proxy: <xmx:0W9bZ_fMd29wfxB2M6UKaH0GrGaPRwgS5nQoW1KxAjkQxspVQXNxzg>
 <xmx:0W9bZ4PzH3pWNQESXU84liiZkrIBk41dO2_7e_Q3vx1Xlw98FaR3Wg>
 <xmx:0W9bZxn9DExP6WsGXKFoRSe9cfYNM-hRhMOdpdBxprNtogbew3x19w>
 <xmx:0W9bZyvLlYCOwLCFHE0_gYWJOZBksrTh-xrXRJMZCHGpqHTvrVDFjQ>
 <xmx:0W9bZ9qMJOCHOB6lSo3OOHinUE4pcJlm2zebM68IJjNiW9DWqq0j7jZf>
Feedback-ID: i07de48aa:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu,
 12 Dec 2024 18:20:47 -0500 (EST)
Message-ID: <98c617e8-ee0d-4228-9bd4-411051427765@HIDDEN>
Date: Fri, 13 Dec 2024 01:20:45 +0200
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Subject: Re: bug#74792: 29.2.50; goto-address-mode should support RET in
 special-mode buffers
To: Eli Zaretskii <eliz@HIDDEN>, Spencer Baugh <sbaugh@HIDDEN>
References: <ierzfl22oaa.fsf@HIDDEN> <86ldwm2lko.fsf@HIDDEN>
 <CAO=BR8MtXJewQBhrJmvQZTS2T3nxAu6+UCG-=hYnwPTYbdYXtQ@HIDDEN>
 <86ed2e2gnm.fsf@HIDDEN>
Content-Language: en-US
From: Dmitry Gutov <dmitry@HIDDEN>
In-Reply-To: <86ed2e2gnm.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 74792
Cc: 74792 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 11/12/2024 20:55, Eli Zaretskii wrote:

>>   > 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.

I also regularly try RET in such cases, notice it does not work, and 
then have to reach for the mouse. Just not often enough to look up and 
remember the alternative.

>> 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.

The same option could affect other "C-c RET" bindings as well, such as 
browse-url-button-open in ansi-osc-hyperlink-map and 
bug-reference-push-button in bug-reference-map.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#74792; Package emacs. Full text available.

Message received at 74792 <at> debbugs.gnu.org:


Received: (at 74792) by debbugs.gnu.org; 12 Dec 2024 20:47:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 12 15:47:27 2024
Received: from localhost ([127.0.0.1]:40557 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tLq5l-0008Jl-RK
	for submit <at> debbugs.gnu.org; Thu, 12 Dec 2024 15:47:27 -0500
Received: from mxout5.mail.janestreet.com ([64.215.233.18]:51751)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sbaugh@HIDDEN>) id 1tLq5d-0008JK-Ui
 for 74792 <at> debbugs.gnu.org; Thu, 12 Dec 2024 15:47:22 -0500
From: Spencer Baugh <sbaugh@HIDDEN>
To: Juri Linkov <juri@HIDDEN>
Subject: Re: bug#74792: 29.2.50; goto-address-mode should support RET in
 special-mode buffers
In-Reply-To: <87v7vp6vfd.fsf@HIDDEN> (Juri Linkov's message of "Thu, 
 12 Dec 2024 18:35:18 +0200")
References: <ierzfl22oaa.fsf@HIDDEN> <86ldwm2lko.fsf@HIDDEN>
 <CAO=BR8MtXJewQBhrJmvQZTS2T3nxAu6+UCG-=hYnwPTYbdYXtQ@HIDDEN>
 <86ed2e2gnm.fsf@HIDDEN> <87v7vp6vfd.fsf@HIDDEN>
Date: Thu, 12 Dec 2024 15:47:12 -0500
Message-ID: <ierikror5m7.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com;
 s=waixah; t=1734036432;
 bh=A0wmlVpZsItNO/0mT+VqnYh+wYWR3d8oAytWHSEGadc=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date;
 b=VnNZeOxH3mPTY+rfwxm1Agz1TMgAcadODMzhltRDINJtYN9yyguGlZfEO/IZTZo2o
 yS+uXabyjNVjlGNdLgeEHBHGmwq1dUEcnS196Xo2o8AkOJEQDF9w0qNLuVugvD2ta8
 3lMQwvjH8bHNwF9E/Vp0deDfW04AIkxzur2Q76JjQ3aV4F+7KEd/8FqKx5gADuDM71
 D7IEtZuM9EWwiGLOpagFLhUkpfpRWAz3yDHHQo8+Shsc3IMHK4moKcChZo61Jl+YSl
 JGbZVMqJ4SC28gN+04/D+Im7rpuLRmD9e4MBzEB4qQ1sHLiNsM9VDVVmv0NUcvqQp3
 ewXUBTAkS+TUA==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 74792
Cc: dmitry@HIDDEN, Eli Zaretskii <eliz@HIDDEN>, 74792 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Juri Linkov <juri@HIDDEN> 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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#74792; Package emacs. Full text available.

Message received at 74792 <at> debbugs.gnu.org:


Received: (at 74792) by debbugs.gnu.org; 12 Dec 2024 16:45:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Dec 12 11:45:27 2024
Received: from localhost ([127.0.0.1]:40078 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tLmJa-0003nR-GY
	for submit <at> debbugs.gnu.org; Thu, 12 Dec 2024 11:45:27 -0500
Received: from relay7-d.mail.gandi.net ([217.70.183.200]:37275)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <juri@HIDDEN>) id 1tLmJW-0003lm-8I
 for 74792 <at> debbugs.gnu.org; Thu, 12 Dec 2024 11:45:25 -0500
Received: by mail.gandi.net (Postfix) with ESMTPSA id BA0BA20003;
 Thu, 12 Dec 2024 16:44:54 +0000 (UTC)
From: Juri Linkov <juri@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#74792: 29.2.50; goto-address-mode should support RET in
 special-mode buffers
In-Reply-To: <86ed2e2gnm.fsf@HIDDEN> (Eli Zaretskii's message of "Wed, 11 Dec
 2024 20:55:41 +0200")
Organization: LINKOV.NET
References: <ierzfl22oaa.fsf@HIDDEN> <86ldwm2lko.fsf@HIDDEN>
 <CAO=BR8MtXJewQBhrJmvQZTS2T3nxAu6+UCG-=hYnwPTYbdYXtQ@HIDDEN>
 <86ed2e2gnm.fsf@HIDDEN>
Date: Thu, 12 Dec 2024 18:35:18 +0200
Message-ID: <87v7vp6vfd.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu)
MIME-Version: 1.0
Content-Type: text/plain
X-GND-Sasl: juri@HIDDEN
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 74792
Cc: Spencer Baugh <sbaugh@HIDDEN>, 74792 <at> debbugs.gnu.org,
 dmitry@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

>>  > 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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#74792; Package emacs. Full text available.

Message received at 74792 <at> debbugs.gnu.org:


Received: (at 74792) by debbugs.gnu.org; 11 Dec 2024 18:58:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Dec 11 13:58:37 2024
Received: from localhost ([127.0.0.1]:36258 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tLRuu-0006je-Mz
	for submit <at> debbugs.gnu.org; Wed, 11 Dec 2024 13:58:37 -0500
Received: from eggs.gnu.org ([209.51.188.92]:37744)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1tLRus-0006jJ-82
 for 74792 <at> debbugs.gnu.org; Wed, 11 Dec 2024 13:58:35 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1tLRsf-00031h-IE; Wed, 11 Dec 2024 13:56:17 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=Yb86CThAEF06j/kYNrUeCgfZAeRGwww5udJKjYk6k6c=; b=Pz8SlyHpsh5Z0l3rPHpe
 N1Mmvz7Vm6m67wWk+xTn3I9CklEEjCNnhVsOLkOmbv8ZZfSUvY/+NFD1Rb9jFS0cbek2svgD3dGG+
 unUNK7SuuuB2MgAqp8PvIbPTZu9AIRHlwMfnIBZBh1can2xB5teQG0XMqhKkuo/rLjllvbyglyWWH
 GZfoUGdCelsiq1tolPsui/cXiCvZcU0dpppDcf+KQ8Hf3u9k7OGXT5c6rTm1C+7JGDCauFnPnbHxY
 h1/A3feMtfxuFQvW6swvsxDPC1mfV9YCXNizuTOcFQ3SB2T1nLqQg4kBrPIUFQ0bk3Y8831AZogbF
 oqzP1AGiesp+7w==;
Date: Wed, 11 Dec 2024 20:55:41 +0200
Message-Id: <86ed2e2gnm.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Spencer Baugh <sbaugh@HIDDEN>
In-Reply-To: <CAO=BR8MtXJewQBhrJmvQZTS2T3nxAu6+UCG-=hYnwPTYbdYXtQ@HIDDEN>
 (message from Spencer Baugh on Wed, 11 Dec 2024 12:39:59 -0500)
Subject: Re: bug#74792: 29.2.50; goto-address-mode should support RET in
 special-mode buffers
References: <ierzfl22oaa.fsf@HIDDEN> <86ldwm2lko.fsf@HIDDEN>
 <CAO=BR8MtXJewQBhrJmvQZTS2T3nxAu6+UCG-=hYnwPTYbdYXtQ@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: 74792
Cc: dmitry@HIDDEN, 74792 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

> From: Spencer Baugh <sbaugh@HIDDEN>
> Date: Wed, 11 Dec 2024 12:39:59 -0500
> Cc: 74792 <at> debbugs.gnu.org, Dmitry Gutov <dmitry@HIDDEN>
> 
> On Wed, Dec 11, 2024, 12:09 PM Eli Zaretskii <eliz@HIDDEN> wrote:
> 
>  > Cc: dmitry@HIDDEN
>  > Date: Wed, 11 Dec 2024 11:10:53 -0500
>  > From:  Spencer Baugh via "Bug reports for GNU Emacs,
>  >  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
>  > 
>  > 
>  > 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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#74792; Package emacs. Full text available.

Message received at 74792 <at> debbugs.gnu.org:


Received: (at 74792) by debbugs.gnu.org; 11 Dec 2024 17:40:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Dec 11 12:40:20 2024
Received: from localhost ([127.0.0.1]:36147 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tLQh9-0000h9-RX
	for submit <at> debbugs.gnu.org; Wed, 11 Dec 2024 12:40:20 -0500
Received: from mxout1.mail.janestreet.com ([38.105.200.78]:39343)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sbaugh@HIDDEN>) id 1tLQh5-0000g7-B8
 for 74792 <at> debbugs.gnu.org; Wed, 11 Dec 2024 12:40:17 -0500
Received: from mail-ej1-f69.google.com ([209.85.218.69])
 by mxgoog2.mail.janestreet.com with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128)
 (Exim 4.98) id 1tLQgz-00000009n71-1ccz for 74792 <at> debbugs.gnu.org;
 Wed, 11 Dec 2024 12:40:09 -0500
Received: by mail-ej1-f69.google.com with SMTP id
 a640c23a62f3a-aa6a1595fdaso203951066b.0
 for <74792 <at> debbugs.gnu.org>; Wed, 11 Dec 2024 09:40:09 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=janestreet.com; s=google; t=1733938809; x=1734543609; darn=debbugs.gnu.org; 
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=DTBRTbEnX3hkSgUS4crfPn9QwxWwQhQq9eA14mV50Uc=;
 b=Ao14rwK6wfMOBvC8BRFXSfA9lUKE+S5oNvLk9NnaIhJZVNSPbqD7B63mQzvu232ndx
 i8sg4DsXwu6L2NV314YuYFV9BYg9nxp46sV6JCGLIsq4zBGTTMKmCuTsuPC8Dppod3y1
 GHnUZ3GezatueWtxHlShga+eozOhY9+sl1nNk=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com;
 s=waixah; t=1733938809;
 bh=DTBRTbEnX3hkSgUS4crfPn9QwxWwQhQq9eA14mV50Uc=;
 h=References:In-Reply-To:From:Date:Subject:To:Cc;
 b=G1+bpD+1iTaRRCrfk6zYyO1mfFO291T83Ffj8PGon8M68p+E5ydkzKxAuPOyKNwJH
 dOnoDc+nQiSCXW+WsoFdu4fMFDuNl58IgmjTnE3BJujqG8yN+rnjJ4NBjqN5CJgfdt
 BM8k92/baE2h/X3tzXP5IrjU4VB/qPpRc9zejHA7IfxMbx1NVJIqJy2QFhAru5Uvvy
 YjbqvnkK9+gWtR63wCEvuBAJfBH7QT9T+LTeRefJnMpTPuJXW4dpRvvtyANUoyCQft
 FYyiGh628uW+nnqyI2ikUXVuRJ905nYMPrRFSVr59f3SV10M2djhbuif6MpD1Pm3ln
 2x6QGgG8P4p1w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1733938809; x=1734543609;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=DTBRTbEnX3hkSgUS4crfPn9QwxWwQhQq9eA14mV50Uc=;
 b=do/M3FJxMypjJCQnHaMqT/Ed7gOxKQ+8XkQrxtE6IpsD+7A5wCi3vAdbzBKQG2qEV/
 fZnxvZ5iaD41Y2m9xknvsNi//pOfrZhKcK8PV3LkaPVZR1arsqVpMBF5DgF7siozpX3v
 U1fOIQ8sb9B7Ws6rSv9WO3MfbLtRGA3ulOlKv3fQaVkUjjL73VzGJaAVWSUE/V/Fllu6
 xoXx1H9XAuQ4Kv1ByvdJG74uqZ3Q2NXITD+vbmgXcrIWadWBHA2iTnDX+ZLNMj2spwGS
 j+Vw0rI3sHpwvf3gCS8G4bqCDNSp8eyiLQFEM08VEb7Knf/EcmYJdD6fZM4zpdMeVJYA
 bwNw==
X-Gm-Message-State: AOJu0YwOpdDVzNcOeWCn4EPCPJOB+vQ1KTlNdfI1f155W6EuaA3GjJYf
 g3bpw3sLwMY93bJMkt7+dLOodWUSTsRQlbht5RNV56RKCDQxQCuvHAog4B/RAzQkfHRV7VjGqMu
 CrT5anS5NlTO+8Cm5/zx/qmmCWFa8SWvotSDhFU6YGbnrPZhdiyuYSzKCmYyPvbgdZPlbr1XCxz
 brThV/ZxP4kj7qg/reKmJEYtXXrLBiTQAETQ==
X-Gm-Gg: ASbGnct8jOnYho/Y3jrJoH5wDja7+RI5rv1OCk57mXF1ZBRmvGIQMCzk2ePslldw0Bd
 cajFVRrkidpiNUopY+yUxyHYplVKaOTLhQpA=
X-Received: by 2002:a17:906:2922:b0:aa6:aa89:6d5e with SMTP id
 a640c23a62f3a-aa6b115ecbdmr373367066b.18.1733938808809; 
 Wed, 11 Dec 2024 09:40:08 -0800 (PST)
X-Google-Smtp-Source: AGHT+IFXR+lOGVWl07Asv8/ZrLce5AOHvLuLXSkf2HHXsonBCshLr770Qt9j2yTRgpgCvpZpuc8JqpJgxqIDk2QgUmc=
X-Received: by 2002:a17:906:2922:b0:aa6:aa89:6d5e with SMTP id
 a640c23a62f3a-aa6b115ecbdmr373364566b.18.1733938808418; Wed, 11 Dec 2024
 09:40:08 -0800 (PST)
MIME-Version: 1.0
References: <ierzfl22oaa.fsf@HIDDEN> <86ldwm2lko.fsf@HIDDEN>
In-Reply-To: <86ldwm2lko.fsf@HIDDEN>
From: Spencer Baugh <sbaugh@HIDDEN>
Date: Wed, 11 Dec 2024 12:39:59 -0500
Message-ID: <CAO=BR8MtXJewQBhrJmvQZTS2T3nxAu6+UCG-=hYnwPTYbdYXtQ@HIDDEN>
Subject: Re: bug#74792: 29.2.50; goto-address-mode should support RET in
 special-mode buffers
To: Eli Zaretskii <eliz@HIDDEN>
Content-Type: multipart/alternative; boundary="000000000000bd25eb062902164a"
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: 74792
Cc: Dmitry Gutov <dmitry@HIDDEN>, 74792 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)

--000000000000bd25eb062902164a
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

On Wed, Dec 11, 2024, 12:09=E2=80=AFPM Eli Zaretskii <eliz@HIDDEN> wrote:

> > Cc: dmitry@HIDDEN
> > Date: Wed, 11 Dec 2024 11:10:53 -0500
> > From:  Spencer Baugh via "Bug reports for GNU Emacs,
> >  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> >
> >
> > 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.

But this sounds like something that may differ between users, so perhaps we
could add this controlled by a defcustom?

>

--000000000000bd25eb062902164a
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div><div class=3D"gmail_quote gmail_quote_container"><di=
v dir=3D"ltr" class=3D"gmail_attr">On Wed, Dec 11, 2024, 12:09=E2=80=AFPM E=
li Zaretskii &lt;<a href=3D"mailto:eliz@HIDDEN">eliz@HIDDEN</a>&gt; wrote=
:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bor=
der-left:1px #ccc solid;padding-left:1ex">&gt; Cc: <a href=3D"mailto:dmitry=
@gutov.dev" target=3D"_blank" rel=3D"noreferrer">dmitry@HIDDEN</a><br>
&gt; Date: Wed, 11 Dec 2024 11:10:53 -0500<br>
&gt; From:=C2=A0 Spencer Baugh via &quot;Bug reports for GNU Emacs,<br>
&gt;=C2=A0 the Swiss army knife of text editors&quot; &lt;<a href=3D"mailto=
:bug-gnu-emacs@HIDDEN" target=3D"_blank" rel=3D"noreferrer">bug-gnu-emacs@=
gnu.org</a>&gt;<br>
&gt; <br>
&gt; <br>
&gt; goto-address-mode binds C-c RET to goto-address-at-point when point is=
<br>
&gt; on a URL or email address.=C2=A0 In special-mode buffers (or maybe any=
<br>
&gt; read-only buffer?) it should also bind RET while point is on the URL o=
r<br>
&gt; email address.<br>
<br>
I don&#39;t think it&#39;s a good idea, since many special-mode descendants=
<br>
bind RET to useful commands.=C2=A0 For goto-address-at-point to override<br=
>
that would be a nuisance, I think.<br></blockquote></div></div><div dir=3D"=
auto"><br></div><div dir=3D"auto">True, but when I&#39;ve specifically move=
d point to a URL it is usually because I want to follow the URL, not do wha=
tever is bound to RET in the mode.</div><div dir=3D"auto"><br></div><div di=
r=3D"auto">But this sounds like something that may differ between users, so=
 perhaps we could add this controlled by a defcustom?</div><div dir=3D"auto=
"><div class=3D"gmail_quote gmail_quote_container"><blockquote class=3D"gma=
il_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-lef=
t:1ex">
</blockquote></div></div></div>

--000000000000bd25eb062902164a--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#74792; Package emacs. Full text available.

Message received at 74792 <at> debbugs.gnu.org:


Received: (at 74792) by debbugs.gnu.org; 11 Dec 2024 17:09:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Dec 11 12:09:39 2024
Received: from localhost ([127.0.0.1]:36089 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tLQDT-0006I9-BG
	for submit <at> debbugs.gnu.org; Wed, 11 Dec 2024 12:09:39 -0500
Received: from eggs.gnu.org ([209.51.188.92]:44704)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1tLQDR-0006HE-U5
 for 74792 <at> debbugs.gnu.org; Wed, 11 Dec 2024 12:09:38 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1tLQDM-0007kk-53; Wed, 11 Dec 2024 12:09:32 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=Hm2Dx22FvLT+E5goXJ1crM1azqHguRk/XidtSL6hekA=; b=VfgYVMIlOIpD
 i04ouBjsVZN2pOQnQe6l3vWLTIw9O59gtP0IPFY+izJ7Cs/Fc+4PrwzHySMzqn6S7V0tMPBbbiOk2
 SmfIgq7pVwkqmhbOahYWgDt4D9wIXJNZjSHiDfwckHuDQPEDRLpSXFpk5F5iUiU8cPNa0EbPjyMqS
 l1XFSrPib4br7q/bVzl7U79hXns6nagj0HFc7OoP4cgXOIxfXtS5zlWiFM+OgUB2dK7PICkaFsZ8s
 DRbOUXjYjv/eEBlVsLVITjTlWnSfN7iWPJgmuGWuMSxgW4/kE3dl1ilIt3tv9Q6XgDgRgHXCgeezl
 kwXclI86Zq/1VTfU2iUGig==;
Date: Wed, 11 Dec 2024 19:09:27 +0200
Message-Id: <86ldwm2lko.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Spencer Baugh <sbaugh@HIDDEN>
In-Reply-To: <ierzfl22oaa.fsf@HIDDEN> (bug-gnu-emacs@HIDDEN)
Subject: Re: bug#74792: 29.2.50;
 goto-address-mode should support RET in special-mode buffers
References: <ierzfl22oaa.fsf@HIDDEN>
X-Spam-Score: -1.6 (-)
X-Debbugs-Envelope-To: 74792
Cc: dmitry@HIDDEN, 74792 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.6 (--)

> Cc: dmitry@HIDDEN
> Date: Wed, 11 Dec 2024 11:10:53 -0500
> From:  Spencer Baugh via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@HIDDEN>
> 
> 
> 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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#74792; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 11 Dec 2024 16:11:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Dec 11 11:11:07 2024
Received: from localhost ([127.0.0.1]:35845 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tLPIp-0001mJ-3V
	for submit <at> debbugs.gnu.org; Wed, 11 Dec 2024 11:11:07 -0500
Received: from lists.gnu.org ([209.51.188.17]:54060)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <sbaugh@HIDDEN>) id 1tLPIl-0001lr-NI
 for submit <at> debbugs.gnu.org; Wed, 11 Dec 2024 11:11:06 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <sbaugh@HIDDEN>)
 id 1tLPIf-000618-4F
 for bug-gnu-emacs@HIDDEN; Wed, 11 Dec 2024 11:10:58 -0500
Received: from mxout6.mail.janestreet.com ([64.215.233.21])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <sbaugh@HIDDEN>)
 id 1tLPIc-00062U-Ug
 for bug-gnu-emacs@HIDDEN; Wed, 11 Dec 2024 11:10:56 -0500
From: Spencer Baugh <sbaugh@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 29.2.50; goto-address-mode should support RET in special-mode buffers
Date: Wed, 11 Dec 2024 11:10:53 -0500
Message-ID: <ierzfl22oaa.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com;
 s=waixah; t=1733933453;
 bh=PBDwK6awLFEZUM25hGwHR51GMbuAJh4nrd8U8iA3Vro=;
 h=From:To:Cc:Subject:Date;
 b=l0JU5Pn0MbZgB1sWkNCorGejJ5T2x90OeJF/n1evTnIP8Kgmf/b3sWRR4PSo7lfSp
 INFafV20qn+lECPVLeG0wIDb70Em8mugHeiOFBZyqNNoPy5FW4j/uVVAtnQiotpYO6
 XrMA3ktbioKJEvzhCodEFWOl33GuI0Y41wjSxZxFRU1BXHKafHOzmgB0zcBE7BFREN
 fB31IesliQq8Lw2T7JltoDQ+tG/UVVQqBGyuztbOud8pLpVHiQDVOVvZ60PDrh+rmX
 pSYDDxq4P83ZSSzNOoxXZRSusx52F2dNLu6WaNWYbNhId6ySZghEUH0DwmDZBoWgxJ
 X4iggWzxzFzLQ==
Received-SPF: pass client-ip=64.215.233.21; envelope-from=sbaugh@HIDDEN;
 helo=mxout6.mail.janestreet.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,
 SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
Cc: dmitry@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)


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.

This would improve functionality for packages which create special-mode
buffers showing arbitrary text that may contain URLs.

For example, commit messages may contain URLs, and enabling
goto-message-mode in vc-log buffers highlights those URLs, but RET
doesn't work to follow them.  Similarly, magit enables goto-address-mode
in buffers showing a commit message, but it implements separate handling
for RET on URLs since goto-address-mode doesn't provide that as a
binding.

This could be done with an extended-menu-item binding with a filter
which checks (derived-mode-p 'special-mode), but maybe there's a better
way?




Acknowledgement sent to Spencer Baugh <sbaugh@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#74792; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 16 Sep 2025 15:30:02 UTC

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