From: Ivan Kanis Date: Sun, 23 Jun 2013 18:27:58 +0000 (+0200) Subject: eww.el: Add a command to browse using and external browser X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~1992^2~70 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f865b4741cebe50ef8778e751c2aea7a89a0e18b;p=emacs.git eww.el: Add a command to browse using and external browser (eww-external-browser): New variable. (eww-mode-map): New keystroke. (eww-browse-with-external-browser): New command. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 521827cb03c..6f696afbbaf 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -2,6 +2,9 @@ * net/eww.el (eww-search-prefix): New variable. (eww): Use it. + (eww-external-browser): New variable. + (eww-mode-map): New keystroke. + (eww-browse-with-external-browser): New command. 2013-06-23 Juanma Barranquero diff --git a/lisp/net/eww.el b/lisp/net/eww.el index eb1b0a2b659..2653d489f81 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -50,6 +50,18 @@ :group 'eww :type 'string) +(defcustom eww-external-browser + (cond ((eq system-type 'windows-nt) + 'browse-url-default-windows-browser) + ((eq system-type 'darwin) + 'browse-url-default-macosx-browser) + (t + 'browse-url-netscape)) + "Function used to launch an external browser." + :version "24.4" + :group 'eww + :type 'function) + (defface eww-form-submit '((((type x w32 ns) (class color)) ; Like default mode line :box (:line-width 2 :style released-button) @@ -317,6 +329,7 @@ word(s) will be searched for via `eww-search-prefix'." (define-key map "p" 'eww-previous-url) (define-key map "u" 'eww-up-url) (define-key map "t" 'eww-top-url) + (define-key map "w" 'eww-browse-with-external-browser) map)) (define-derived-mode eww-mode nil "eww" @@ -823,6 +836,12 @@ appears in a or tag." "?" (mm-url-encode-www-form-urlencoded values)))))) +(defun eww-browse-with-external-browser () + "Browse the current URL with an external browser. +The browser to used is specified by the `eww-external-browser' variable." + (interactive) + (funcall eww-external-browser eww-current-url)) + (provide 'eww) ;;; eww.el ends here