summaryrefslogtreecommitdiff
path: root/lisp/net
diff options
context:
space:
mode:
authorGabriel do Nascimento Ribeiro <gabriel376@hotmail.com>2022-11-21 08:08:52 -0300
committerStefan Kangas <stefankangas@gmail.com>2022-11-25 01:21:40 +0100
commit29a262bfa7b33859e8215aee06a674dab85689fc (patch)
treef8dcb9b758c5e8714e4971cc10ef4b2c678cf2dc /lisp/net
parent2b123edcf6704952447dcba95c18f324397c17c6 (diff)
downloademacs-29a262bfa7b33859e8215aee06a674dab85689fc.tar.gz
emacs-29a262bfa7b33859e8215aee06a674dab85689fc.tar.bz2
emacs-29a262bfa7b33859e8215aee06a674dab85689fc.zip
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'. (Bug#59443)
Diffstat (limited to 'lisp/net')
-rw-r--r--lisp/net/goto-addr.el31
1 files changed, 17 insertions, 14 deletions
diff --git a/lisp/net/goto-addr.el b/lisp/net/goto-addr.el
index 86cf98004ba..03e14c92682 100644
--- a/lisp/net/goto-addr.el
+++ b/lisp/net/goto-addr.el
@@ -222,25 +222,28 @@ and `goto-address-fontify-p'."
;;;###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.