From bdaa086b7769c48ea9813e283478d826a09762a4 Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Mon, 24 Jun 2013 16:03:26 +0200 Subject: [PATCH] * net/shr.el (shr-browse-url): Use an external browser if given a prefix. --- lisp/ChangeLog | 3 +++ lisp/net/shr.el | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c3300fe645c..9a2086976e7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2013-06-24 Lars Magne Ingebrigtsen + * net/shr.el (shr-browse-url): Use an external browser if given a + prefix. + * net/eww.el (eww-external-browser): Moved to shr. 2013-06-24 Ivan Kanis diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 7c48ceeee80..bb58a99ce10 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -645,9 +645,10 @@ size, and full-buffer size." (forward-line 1) (goto-char end)))))) -(defun shr-browse-url () - "Browse the URL under point." - (interactive) +(defun shr-browse-url (&optional external) + "Browse the URL under point. +If EXTERNAL, browse the URL using `shr-external-browser'." + (interactive "p") (let ((url (get-text-property (point) 'shr-url))) (cond ((not url) @@ -655,7 +656,9 @@ size, and full-buffer size." ((string-match "^mailto:" url) (browse-url-mail url)) (t - (browse-url url))))) + (if external + (funcall shr-external-browser url) + (browse-url url)))))) (defun shr-save-contents (directory) "Save the contents from URL in a file." -- 2.39.2