branch: elpa/magit commit 7c842b8ac0a904049fc68b321b47e42d642e5c51 Author: Jonas Bernoulli <jo...@bernoul.li> Commit: Jonas Bernoulli <jo...@bernoul.li>
magit-{browse,visit}-thing: Only recognize true urls `browse-url-url-at-point' returns non-nil if there is any word at point, with point on "point", for example, it would return "https://point". Use a lower-level function, which only returns non-nil if there actually is a URL. Closes #5245. --- lisp/magit-mode.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lisp/magit-mode.el b/lisp/magit-mode.el index 9fd5cc5fe0b..2d3370af2a7 100644 --- a/lisp/magit-mode.el +++ b/lisp/magit-mode.el @@ -435,7 +435,7 @@ which actually visits the thing at point." (interactive) (if (eq transient-current-command 'magit-dispatch) (call-interactively (key-binding (this-command-keys))) - (if-let ((url (browse-url-url-at-point))) + (if-let ((url (thing-at-point 'url t))) (browse-url url) (user-error "There is no thing at point that could be visited")))) (put 'magit-visit-thing 'completion-predicate #'ignore) @@ -456,7 +456,7 @@ buffer." Where applicable, other keymaps remap this command to another, which actually visits thing at point using `browse-url'." (interactive) - (if-let ((url (browse-url-url-at-point))) + (if-let ((url (thing-at-point 'url t))) (browse-url url) (user-error "There is no thing at point that could be browsed"))) (put 'magit-browse-thing 'completion-predicate #'ignore)