Fix void-function on push-button in goto-address-mode

* lisp/net/goto-addr.el (goto-address--button-action):
New function (bug#81419).
(goto-address-fontify): Use it as the button action.

Copyright-paperwork-exempt: yes
This commit is contained in:
Aaron L. Zeng 2026-07-15 15:10:01 -04:00 committed by Juri Linkov
parent 429336b409
commit 58e4dc3c53

View file

@ -191,6 +191,7 @@ and `goto-address-fontify-p'."
(overlay-put this-overlay
'keymap goto-address-highlight-keymap)
(overlay-put this-overlay 'button this-overlay)
(overlay-put this-overlay 'action #'goto-address--button-action)
(overlay-put this-overlay 'category 'goto-address)
(overlay-put this-overlay 'goto-address t))))
(goto-char (or start (point-min)))
@ -250,6 +251,12 @@ using `browse-url-secondary-browser-function' instead."
(browse-url-button-open-url url)
(error "No e-mail address or URL found"))))))
(defun goto-address--button-action (button)
"Open the URL represented by BUTTON."
(save-excursion
(goto-char (overlay-start button))
(goto-address-at-point)))
(defun goto-address-find-address-at-point ()
"Find e-mail address around or before point.
Then search backwards to beginning of line for the start of an e-mail