summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--lisp/+browse-url.el17
1 files changed, 10 insertions, 7 deletions
diff --git a/lisp/+browse-url.el b/lisp/+browse-url.el index dee1466..68fb7b0 100644 --- a/lisp/+browse-url.el +++ b/lisp/+browse-url.el
@@ -11,15 +11,18 @@
11 11
12;;; URL Handlers 12;;; URL Handlers
13 13
14(defun +browse-url-set-handlers (handlers) 14(defun +browse-url-set-handlers (&optional handlers)
15 "Set handlers for `browse-url'. 15 "Set HANDLERS for `browse-url'.
16Set `browse-url-handlers', if they exist; else 16Set `browse-url-handlers', if they exist; else
17`browse-url-browser-function'. The reason for this switch is 17`browse-url-browser-function'. The reason for this switch is
18that the latter is deprecated in Emacs 28+." 18that the latter is deprecated in Emacs 28+.
19 (set-default (if (boundp 'browse-url-handlers) 19
20 'browse-url-handlers 20If HANDLERS is absent or nil, recompute handlers. This can be
21 'browse-url-browser-function) 21useful when changing the default browser."
22 handlers)) 22 (let ((h (if (boundp 'browse-url-handlers)
23 'browse-url-handlers
24 'browse-url-browser-function)))
25 (set-default h (or handlers (symbol-value h)))))
23 26
24(cl-defmacro +browse-url-make-external-viewer-handler 27(cl-defmacro +browse-url-make-external-viewer-handler
25 (viewer default-args &optional (prompt "URL: ") 28 (viewer default-args &optional (prompt "URL: ")