aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/net/browse-url.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/net/browse-url.el')
-rw-r--r--lisp/net/browse-url.el28
1 files changed, 28 insertions, 0 deletions
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el
index 6dc9f8961a8..d7b8521563a 100644
--- a/lisp/net/browse-url.el
+++ b/lisp/net/browse-url.el
@@ -929,6 +929,34 @@ Optional prefix argument ARG non-nil inverts the value of the option
929 (error "No URL found")))) 929 (error "No URL found"))))
930 930
931;;;###autoload 931;;;###autoload
932(defun browse-url-with-browser-kind (kind url &optional arg)
933 "Browse URL with a browser of the given browser KIND.
934KIND is either `internal' or `external'.
935
936When called interactively, the default browser kind is the
937opposite of the browser kind of `browse-url-browser-function'."
938 (interactive
939 (let* ((url-arg (browse-url-interactive-arg "URL: "))
940 ;; Default to the inverse kind of the default browser.
941 (default (if (eq (browse-url--browser-kind
942 browse-url-browser-function (car url-arg))
943 'internal)
944 'external
945 'internal))
946 (k (completing-read
947 (format "Browser kind (default %s): " default)
948 '(internal external)
949 nil t nil nil
950 default)))
951 (cons k url-arg)))
952 (let ((function (browse-url-select-handler url kind)))
953 (unless function
954 (setq function (if (eq kind 'external)
955 #'browse-url-default-browser
956 #'eww)))
957 (funcall function url arg)))
958
959;;;###autoload
932(defun browse-url-at-mouse (event) 960(defun browse-url-at-mouse (event)
933 "Ask a WWW browser to load a URL clicked with the mouse. 961 "Ask a WWW browser to load a URL clicked with the mouse.
934The URL is the one around or before the position of the mouse click 962The URL is the one around or before the position of the mouse click