From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tom Tromey Newsgroups: gmane.emacs.devel Subject: Re: eww Date: Wed, 19 Jun 2013 11:13:39 -0600 Message-ID: <87y5a610sc.fsf@fleche.redhat.com> References: <87d2rkb1pi.fsf@fleche.redhat.com> <87fvwfa3ev.fsf@fleche.redhat.com> <874ncv8kbf.fsf@fleche.redhat.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1371662035 2214 80.91.229.3 (19 Jun 2013 17:13:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 19 Jun 2013 17:13:55 +0000 (UTC) Cc: emacs-devel To: Lars Magne Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 19 19:13:56 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 1UpLx7-0003nw-3Y for ged-emacs-devel@m.gmane.org; Wed, 19 Jun 2013 19:13:49 +0200 Original-Received: from localhost ([::1]:50712 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpLx6-00082a-Lj for ged-emacs-devel@m.gmane.org; Wed, 19 Jun 2013 13:13:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33158) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpLx1-00082G-5H for emacs-devel@gnu.org; Wed, 19 Jun 2013 13:13:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UpLx0-0002C7-4C for emacs-devel@gnu.org; Wed, 19 Jun 2013 13:13:43 -0400 Original-Received: from mx1.redhat.com ([209.132.183.28]:47811) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UpLwz-0002Bv-TA for emacs-devel@gnu.org; Wed, 19 Jun 2013 13:13:42 -0400 Original-Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r5JHDfWZ024322 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 19 Jun 2013 13:13:41 -0400 Original-Received: from barimba (ovpn-113-102.phx2.redhat.com [10.3.113.102]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r5JHDdKL016239 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 19 Jun 2013 13:13:40 -0400 X-Attribution: Tom In-Reply-To: (Lars Magne Ingebrigtsen's message of "Wed, 19 Jun 2013 08:50:59 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 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:160689 Archived-At: Lars> Could you re-send the patch against the current tree? Here you go. I can push directly if you prefer. I think it would be best if you reviewed patches, though. Tom === modified file 'lisp/ChangeLog' --- lisp/ChangeLog 2013-06-19 13:14:24 +0000 +++ lisp/ChangeLog 2013-06-19 17:13:17 +0000 @@ -1,3 +1,12 @@ +2013-06-19 Tom Tromey + + * net/eww.el (eww-top-url): Remove. + (eww-home-url, eww-start-url, eww-contents-url): New defvars. + (eww-render): Set new variables. Don't set eww-top-url. + (eww-handle-link): Handle "prev", "home", and "contents". + Downcase the rel text. + (eww-top-url): Choose best top URL. + 2013-06-19 Michael Albinus * net/tramp-adb.el (tramp-adb-get-toolbox): Remove function, it is === modified file 'lisp/net/eww.el' --- lisp/net/eww.el 2013-06-18 22:38:34 +0000 +++ lisp/net/eww.el 2013-06-19 17:10:12 +0000 @@ -59,7 +59,9 @@ (defvar eww-next-url nil) (defvar eww-previous-url nil) (defvar eww-up-url nil) -(defvar eww-top-url nil) +(defvar eww-home-url nil) +(defvar eww-start-url nil) +(defvar eww-contents-url nil) ;;;###autoload (defun eww (url) @@ -82,7 +84,9 @@ (set (make-local-variable 'eww-next-url) nil) (set (make-local-variable 'eww-previous-url) nil) (set (make-local-variable 'eww-up-url) nil) - (set (make-local-variable 'eww-top-url) nil) + (set (make-local-variable 'eww-home-url) nil) + (set (make-local-variable 'eww-start-url) nil) + (set (make-local-variable 'eww-contents-url) nil) (let* ((headers (eww-parse-headers)) (shr-target-id (and (string-match "#\\(.*\\)" url) @@ -171,10 +175,22 @@ (defun eww-handle-link (cont) (let* ((rel (assq :rel cont)) (href (assq :href cont)) - (where (assoc (cdr rel) + (where (assoc + ;; The text associated with :rel is case-insensitive. + (if rel (downcase (cdr rel))) '(("next" . eww-next-url) + ;; Texinfo uses "previous", but HTML specifies + ;; "prev", so recognize both. ("previous" . eww-previous-url) - ("start" . eww-top-url) + ("prev" . eww-previous-url) + ;; HTML specifies "start" but also "contents", + ;; and Gtk seems to use "home". Recognize + ;; them all; but store them in different + ;; variables so that we can readily choose the + ;; "best" one. + ("start" . eww-start-url) + ("home" . eww-home-url) + ("contents" . eww-contents-url) ("up" . eww-up-url))))) (and href where @@ -317,12 +333,15 @@ (defun eww-top-url () "Go to the page marked `top'. -A page is marked `top' if rel=\"start\" appears in a -or tag." +A page is marked `top' if rel=\"start\", rel=\"home\", or rel=\"contents\" +appears in a or tag." (interactive) - (if eww-top-url - (eww-browse-url (shr-expand-url eww-top-url eww-current-url)) - (error "No `top' on this page"))) + (let ((best-url (or eww-start-url + eww-contents-url + eww-home-url))) + (if best-url + (eww-browse-url (shr-expand-url best-url eww-current-url)) + (error "No `top' for this page")))) (defun eww-reload () "Reload the current page."