From: Lars Ingebrigtsen Date: Tue, 30 Jul 2019 14:06:00 +0000 (+0200) Subject: Add a new conveniency function to browse-url X-Git-Tag: emacs-27.0.90~1817^2~2 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8bd6245e56f04181286620d8497e68e8b1c4f684;p=emacs.git Add a new conveniency function to browse-url * lisp/net/browse-url.el (browse-url-button-open-url): Add a new conveniency function. --- 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)