emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/magit 7c842b8ac0 1/4: magit-{browse, visit}-thing: Only re


From: Jonas Bernoulli
Subject: [nongnu] elpa/magit 7c842b8ac0 1/4: magit-{browse, visit}-thing: Only recognize true urls
Date: Sat, 2 Nov 2024 09:11:12 -0400 (EDT)

branch: elpa/magit
commit 7c842b8ac0a904049fc68b321b47e42d642e5c51
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@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 9fd5cc5fe0..2d3370af2a 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]