all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Gabriel <gabriel376@hotmail.com>
To: 59443@debbugs.gnu.org
Subject: bug#59443: 29.0.50; [PATCH] Allow goto-address-at-point to use secondary browser
Date: Mon, 21 Nov 2022 15:31:13 -0300	[thread overview]
Message-ID: <SJ0PR06MB86092AC2A6C27FE8B9CB65B68B0A9@SJ0PR06MB8609.namprd06.prod.outlook.com> (raw)
In-Reply-To: <87v8n8dze6.fsf@gmail.com> (Visuwesh's message of "Mon, 21 Nov 2022 22:21:29 +0530")

[-- Attachment #1: Type: text/plain, Size: 602 bytes --]

Visuwesh <visuweshm@gmail.com> writes:

> [திங்கள் நவம்பர் 21, 2022] Gabriel wrote:
>
>> [...]
>> From 2151f92bf5d07106d7f322ea69bfc745b0bf1d28 Mon Sep 17 00:00:00 2001
>> From: Gabriel do Nascimento Ribeiro <gabriel376@hotmail.com>
>> Date: Mon, 21 Nov 2022 08:08:52 -0300
>> Subject: [PATCH 1/1] Allow goto-address-at-point to use secondary browser
>>
>> * lisp/net/dictionary.el (goto-address-at-point): Call
>     ^^^^^^^^^^^^^^^^^^^^^^
> Hmm, the patch touches lisp/net/goto-addr.el but the commit message
> refers to another file.
>

Thanks, fixed.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Allow-goto-address-at-point-to-use-secondary-browser.patch --]
[-- Type: text/x-diff, Size: 2453 bytes --]

>From 2151f92bf5d07106d7f322ea69bfc745b0bf1d28 Mon Sep 17 00:00:00 2001
From: Gabriel do Nascimento Ribeiro <gabriel376@hotmail.com>
Date: Mon, 21 Nov 2022 08:08:52 -0300
Subject: [PATCH 1/1] Allow goto-address-at-point to use secondary browser

* lisp/net/goto-addr.el (goto-address-at-point): Call
`browse-url-button-open-url', so a prefix argument uses
`browse-url-secondary-browser-function'.
---
 lisp/net/goto-addr.el | 31 +++++++++++++++++--------------
 1 file changed, 17 insertions(+), 14 deletions(-)

diff --git a/lisp/net/goto-addr.el b/lisp/net/goto-addr.el
index 86cf98004b..03e14c9268 100644
--- a/lisp/net/goto-addr.el
+++ b/lisp/net/goto-addr.el
@@ -222,25 +222,28 @@ goto-address-fontify-region
 
 ;;;###autoload
 (defun goto-address-at-point (&optional event)
-  "Send to the e-mail address or load the URL at point.
-Send mail to address at point.  See documentation for
-`goto-address-find-address-at-point'.  If no address is found
-there, then load the URL at or before point."
+  "Start composing a new message to the e-mail address at point or
+open URL at point.
+
+If no e-mail address is found at point, use the URL at or before
+point.  See `goto-address-find-address-at-point'.
+
+With prefix argument, use the secondary browser to open the URL.
+See `browse-url-button-open-url'."
   (interactive (list last-input-event))
   (save-excursion
     (if event (posn-set-point (event-end event)))
     (let ((address (save-excursion (goto-address-find-address-at-point))))
       (if (and address
-	       (save-excursion
-		 (goto-char (previous-single-char-property-change
-			     (point) 'goto-address nil
-			     (line-beginning-position)))
-		 (not (looking-at goto-address-url-regexp))))
-	  (compose-mail address)
-	(let ((url (browse-url-url-at-point)))
-	  (if url
-	      (browse-url url)
-	    (error "No e-mail address or URL found")))))))
+               (save-excursion
+                 (goto-char (previous-single-char-property-change
+                             (point) 'goto-address nil
+                             (line-beginning-position)))
+                 (not (looking-at goto-address-url-regexp))))
+          (compose-mail address)
+        (if-let ((url (browse-url-url-at-point)))
+            (browse-url-button-open-url url)
+          (error "No e-mail address or URL found"))))))
 
 (defun goto-address-find-address-at-point ()
   "Find e-mail address around or before point.
-- 
2.34.1


[-- Attachment #3: Type: text/plain, Size: 13 bytes --]


---
Gabriel

  reply	other threads:[~2022-11-21 18:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-21 11:45 bug#59443: 29.0.50; [PATCH] Allow goto-address-at-point to use secondary browser Gabriel
2022-11-21 13:52 ` Stefan Kangas
2022-11-21 15:03   ` Gabriel
2022-11-21 16:51     ` Visuwesh
2022-11-21 18:31       ` Gabriel [this message]
2022-11-25  0:34         ` Stefan Kangas

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=SJ0PR06MB86092AC2A6C27FE8B9CB65B68B0A9@SJ0PR06MB8609.namprd06.prod.outlook.com \
    --to=gabriel376@hotmail.com \
    --cc=59443@debbugs.gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.