From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: joakim@verona.se Newsgroups: gmane.emacs.devel,gmane.emacs.gnus.general Subject: Re: eww Date: Tue, 18 Jun 2013 13:32:19 +0200 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1371555172 17972 80.91.229.3 (18 Jun 2013 11:32:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 18 Jun 2013 11:32:52 +0000 (UTC) Cc: ding@gnus.org, emacs-devel To: Lars Magne Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 18 13:32:52 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Uou9b-0005pF-Ul for ged-emacs-devel@m.gmane.org; Tue, 18 Jun 2013 13:32:52 +0200 Original-Received: from localhost ([::1]:52621 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uou9b-0001IP-Hm for ged-emacs-devel@m.gmane.org; Tue, 18 Jun 2013 07:32:51 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51359) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uou9V-0001Cj-LM for emacs-devel@gnu.org; Tue, 18 Jun 2013 07:32:48 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uou9Q-0006kL-5i for emacs-devel@gnu.org; Tue, 18 Jun 2013 07:32:45 -0400 Original-Received: from mx1.bahnhof.se ([213.80.101.11]:58659) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uou9P-0006kD-W8 for emacs-devel@gnu.org; Tue, 18 Jun 2013 07:32:40 -0400 Original-Received: from localhost (mf.bahnhof.se [213.80.101.20]) by mx1-reinject (Postfix) with ESMTP id 95B4A29552C; Tue, 18 Jun 2013 13:32:42 +0200 (CEST) X-Virus-Scanned: by amavisd-new using ClamAV at bahnhof.se (MF4) Original-Received: from mf4.bahnhof.se ([127.0.0.1]) by localhost (mf4.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id h9FYJ6WUiqzC; Tue, 18 Jun 2013 13:32:34 +0200 (CEST) Original-Received: from mta.verona.se (h-235-102.a149.priv.bahnhof.se [85.24.235.102]) by mf4.bahnhof.se (Postfix) with ESMTP id 8E17CE43457; Tue, 18 Jun 2013 13:32:34 +0200 (CEST) Original-Received: from localhost (unknown [127.0.0.1]) by mta.verona.se (Postfix) with ESMTP id 7BAA24E3917; Tue, 18 Jun 2013 11:32:24 +0000 (UTC) X-Virus-Scanned: amavisd-new at verona.se Original-Received: from mta.verona.se ([127.0.0.1]) by localhost (exodia.verona.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id G32KlaI-p0QL; Tue, 18 Jun 2013 13:32:19 +0200 (CEST) Original-Received: from exodia.verona.se (www.verona.se [192.168.200.15]) by mta.verona.se (Postfix) with ESMTP id 50BC54E15A7; Tue, 18 Jun 2013 13:32:19 +0200 (CEST) In-Reply-To: (Lars Magne Ingebrigtsen's message of "Sun, 16 Jun 2013 16:53:57 +0200") User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Mac OS X 10.x X-Received-From: 213.80.101.11 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:160562 gmane.emacs.gnus.general:83359 Archived-At: Lars Magne Ingebrigtsen writes: > eww probably has a lot of stuff that could still be fixed up, but the > basics are working now. That is, you can search for stuff on Google and > visit Wikipedia. :-) > > I wrote it up a bit here: > > http://lars.ingebrigtsen.no/2013/06/eww.html While you are at it, could you implement something like the patch below? I use it in the xwidget branch for simplifying browsing in emacs. diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 695b7a1..1fa52ce 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el @@ -667,7 +667,7 @@ regarding its parameter treatment." ;; functions allows them to be stand-alone commands, making it easier ;; to switch between browsers. -(defun browse-url-interactive-arg (prompt) +(defun browse-url-interactive-arg (prompt &optional default-url) "Read a URL from the minibuffer, prompting with PROMPT. If `transient-mark-mode' is non-nil and the mark is active, it defaults to the current region, else to the URL at or before @@ -684,7 +684,8 @@ for use in `interactive'." "[\t\r\f\n ]+" "" (buffer-substring-no-properties (region-beginning) (region-end)))) - (browse-url-url-at-point))) + (browse-url-url-at-point) + default-url)) (not (eq (null browse-url-new-window-flag) (null current-prefix-arg))))) @@ -791,6 +792,13 @@ narrowed." ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Browser-independent commands +(defun url-tidy (url) + "Tidy up URL as much as possible." + (if (equal 0 (string-match ".*://" url)) + url + (concat "http://" url) ;;TODO guess more url forms, like mailto + )) + ;; A generic command to call the current browse-url-browser-function ;;;###autoload @@ -803,6 +811,7 @@ first, if that exists." (interactive (browse-url-interactive-arg "URL: ")) (unless (called-interactively-p 'interactive) (setq args (or args (list browse-url-new-window-flag)))) + (setq url (url-tidy url)) (let ((process-environment (copy-sequence process-environment)) (function (or (and (string-match "\\`mailto:" url) browse-url-mailto-function) -- Joakim Verona