summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eww-conf.el13
1 files changed, 11 insertions, 2 deletions
diff --git a/eww-conf.el b/eww-conf.el
index 157dded..3faa82d 100644
--- a/eww-conf.el
+++ b/eww-conf.el
@@ -5,14 +5,14 @@
;;; Commentary:
-;; Simply configurations for the great Emacs Web Wowser
+;; Simple configurations for the great Emacs Web Wowser
;;; Code:
(require 'eww)
(require 'shr)
-(setq browse-url-browser-function #'eww-browse-url)
+(setq browse-url-browser-function #'durand-browse-url)
(setq browse-url-secondary-browser-function 'browse-url-default-browser)
(setq eww-bookmarks-directory load-file-directory)
@@ -23,6 +23,15 @@
(setq eww-suggest-uris '(eww-links-at-point thing-at-point-url-at-point))
(setq eww-browse-url-new-window-is-tab nil)
+;;; Open URL in an external browser if given a prefix argument.
+
+(defun durand-browse-url (url &optional arg)
+ "Open URL in a browser.
+If ARG is nil, open in EWW. Otherwise, open in an external browser."
+ (cond
+ (arg (funcall browse-url-secondary-browser-function url))
+ ((eww-browse-url url))))
+
;;; Use pdf-view to view PDF files if available.
(setq mailcap-prefer-mailcap-viewers nil)