]> git.eshelyaron.com Git - emacs.git/commitdiff
Add a new conveniency function to browse-url
authorLars Ingebrigtsen <larsi@gnus.org>
Tue, 30 Jul 2019 14:06:00 +0000 (16:06 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 30 Jul 2019 14:07:44 +0000 (16:07 +0200)
* lisp/net/browse-url.el (browse-url-button-open-url): Add a new
conveniency function.

lisp/net/browse-url.el

index 37995a46604e9a646dd41106f987588d0b0c3609..c5bd415fe74f03d50a7992fe6f89cc43025ee924 100644 (file)
@@ -1690,6 +1690,14 @@ external browser instead of the default one."
         (funcall browse-url-secondary-browser-function url)
       (browse-url url))))
 
+(defun browse-url-button-open-url (url)
+  "Open URL using `browse-url'.
+If `current-prefix-arg' is non-nil, use
+`browse-url-secondary-browser-function' instead."
+  (if current-prefix-arg
+      (funcall browse-url-secondary-browser-function url)
+    (browse-url url)))
+
 (defun browse-url-button-copy ()
   "Copy the URL under point"
   (interactive)