From 8bd6245e56f04181286620d8497e68e8b1c4f684 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 30 Jul 2019 16:06:00 +0200 Subject: [PATCH] Add a new conveniency function to browse-url * lisp/net/browse-url.el (browse-url-button-open-url): Add a new conveniency function. --- lisp/net/browse-url.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 37995a46604..c5bd415fe74 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -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) -- 2.39.2