>From 361b9d970631b3547bd859fb8686597e651447ce Mon Sep 17 00:00:00 2001 From: Daniel Mendler Date: Sat, 7 Dec 2024 22:56:15 +0100 Subject: [PATCH] eww: Use browse-url-browser-kind for external browsing Guarantee that an external browser is used by Eww even if `browse-url-secondary-browser-function' is set to `eww-browse-url'. * lisp/net/eww.el (eww-browse-with-external-browser): Use `browse-url-with-browser-kind'. (eww-follow-link): Use `browse-url-with-browser-kind' if the EXTERNAL prefix argument is non-nil. --- lisp/net/eww.el | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 4d4d4d6beac..bace519c7c4 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -2141,12 +2141,11 @@ eww-submit (mm-url-encode-www-form-urlencoded values)))))) (defun eww-browse-with-external-browser (&optional url) - "Browse the current URL with an external browser. -The browser to used is specified by the -`browse-url-secondary-browser-function' variable." + "Browse the current URL with an external browser." (interactive nil eww-mode) - (funcall browse-url-secondary-browser-function - (or url (plist-get eww-data :url)))) + (browse-url-with-browser-kind + 'external + (or url (plist-get eww-data :url)))) (defun eww-remove-tracking (url) "Remove the commong utm_ tracking cookies from URLs." @@ -2161,9 +2160,7 @@ eww--transform-url (defun eww-follow-link (&optional external mouse-event) "Browse the URL under point. -If EXTERNAL is single prefix, browse the URL using -`browse-url-secondary-browser-function'. - +If EXTERNAL is single prefix, browse the URL using an external browser. If EXTERNAL is double prefix, browse in new buffer." (interactive (list current-prefix-arg last-nonmenu-event) @@ -2180,7 +2177,7 @@ eww-follow-link ;; and `browse-url-mailto-function'. (browse-url url)) ((and (consp external) (<= (car external) 4)) - (funcall browse-url-secondary-browser-function url) + (browse-url-with-browser-kind 'external url) (shr--blink-link)) ;; This is a #target url in the same page as the current one. ((and (setq target (url-target (url-generic-parse-url url))) -- 2.45.2