* net/shr.el (shr-browse-url): Use an external browser if given a prefix.

This commit is contained in:
Lars Magne Ingebrigtsen 2013-06-24 16:03:26 +02:00
parent 0ebd92a3e9
commit bdaa086b77
2 changed files with 10 additions and 4 deletions

View file

@ -1,5 +1,8 @@
2013-06-24 Lars Magne Ingebrigtsen <larsi@gnus.org>
* 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 <ivan@kanis.fr>

View file

@ -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."