From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.bugs Subject: bug#40532: 28.0.50; eww/shr: Anchor link does not work Date: Wed, 22 Apr 2020 12:38:17 +0100 Message-ID: <87blnj92dy.fsf@tcd.ie> References: <87sghckn7p.fsf@milkypond.org> <87o8rk597f.fsf@milkypond.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="128169"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 40532@debbugs.gnu.org To: Arnaud Fontaine , Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 22 13:39:24 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jRDit-000XCr-Ro for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 22 Apr 2020 13:39:23 +0200 Original-Received: from localhost ([::1]:48614 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRDis-0008Ij-Tc for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 22 Apr 2020 07:39:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36912) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRDiZ-00082G-La for bug-gnu-emacs@gnu.org; Wed, 22 Apr 2020 07:39:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRDiY-0007W0-Sh for bug-gnu-emacs@gnu.org; Wed, 22 Apr 2020 07:39:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39876) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jRDiY-0007Up-DS for bug-gnu-emacs@gnu.org; Wed, 22 Apr 2020 07:39:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jRDiY-00043f-85 for bug-gnu-emacs@gnu.org; Wed, 22 Apr 2020 07:39:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 Apr 2020 11:39:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40532 X-GNU-PR-Package: emacs Original-Received: via spool by 40532-submit@debbugs.gnu.org id=B40532.158755550815552 (code B ref 40532); Wed, 22 Apr 2020 11:39:02 +0000 Original-Received: (at 40532) by debbugs.gnu.org; 22 Apr 2020 11:38:28 +0000 Original-Received: from localhost ([127.0.0.1]:51420 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRDi0-00042l-GW for submit@debbugs.gnu.org; Wed, 22 Apr 2020 07:38:28 -0400 Original-Received: from mail-pg1-f194.google.com ([209.85.215.194]:42762) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRDhy-00042R-OT for 40532@debbugs.gnu.org; Wed, 22 Apr 2020 07:38:27 -0400 Original-Received: by mail-pg1-f194.google.com with SMTP id g6so931953pgs.9 for <40532@debbugs.gnu.org>; Wed, 22 Apr 2020 04:38:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=IwBtvi3MhQDHldrwYF1uuiYOG1m7NSDfNfz12Fslhcc=; b=cczsFLPa7uyby36PFpPw/qC4S/emicX3KlXNyq9pq84oGw741E8D+tatWiKi0eyHOb NlezgXGM0++4Zh0yLu8fzE9SBR+A2P8EujmcDPqfUmZZHMT/YW4wnvDgzvPiACbl69Ai wgImEB83BmULWP9fcaH504tJCtGL4pkPnvEuTfssTz3qZkBttHlzCc8WaxYV4hnv51SP eBC2mI0J2iN8LVpJf2J9h0Ta0gbIr5j0knsfrV8ZNFU5VBMS/u98v2IalCDqbuLDTmGv SnMRD98oT/Y13yNEHlgM2kHBTF18+/QJrNibqEcOqLaO9oF88a9VDm9EzjBrn0dmdfSQ WUzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=IwBtvi3MhQDHldrwYF1uuiYOG1m7NSDfNfz12Fslhcc=; b=rdlMSANwn9P8ykKcQZ6Lu021OvX0cjLP9S3R41Pkg8blbA7oBGcFL/zyzEbURChFO1 7KlIFdD0iHOjh4WQkMj1QnMcDJApBd70ym5qG9UqKHwfee45g7YGj2pB83mdxSicgsQC i0xYLPCtdBcKiFy/usqN3KXP2d0RrnNTMITXO8GVgurcybMZR5e4cn+ofCmQ5LT8dihy x5C9F9GAPYRWiNi1Rgc+C5bnXkD6rKg+FWBekITVXKOQanRI2JpCngI5TSTG4/vnKUnU 4+DgEOAmoliu29nmPHmPAHqHpMfARS7bT6O6slpyNhpSfEuguZfn32kLufIJn7xiuEFK skiw== X-Gm-Message-State: AGi0PuZzrNPqG+70lmbmc9/DOenWzT/UcjOLSBbFLRVRejijFknLa0vz SZkVYc24xVizzZq4GACtVDCFwp7WG6Q= X-Google-Smtp-Source: APiQypIk/AvXLKSqM24LHhMoQmJd2tZDObJ1SKl16gGILzhbGwRhfv59aV9VeM9e4nfuXMzNVPuN1g== X-Received: by 2002:a62:1984:: with SMTP id 126mr3687645pfz.158.1587555500694; Wed, 22 Apr 2020 04:38:20 -0700 (PDT) Original-Received: from localhost ([2a02:8084:20e2:c380:92bd:1bfd:38fc:fae2]) by smtp.gmail.com with ESMTPSA id j26sm5262178pfr.215.2020.04.22.04.38.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Apr 2020 04:38:19 -0700 (PDT) In-Reply-To: <87o8rk597f.fsf@milkypond.org> (Arnaud Fontaine's message of "Wed, 22 Apr 2020 15:24:36 +0900") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:178784 Archived-At: --=-=-= Content-Type: text/plain found 40532 27.0.50 tags 40532 + patch quit Arnaud Fontaine writes: > I have investigated a little and it seems to be because of a bug in > eww-follow-link (bound to RET key). Indeed; I think it's a regression in Emacs 27 caused by the following fix for bug#28441: Make #anchors work again in eww fa41693799 2018-04-13 14:55:55 +0200 https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=fa416937997a113d84ab4e4910d730ce5d77613d Previously, eww-follow-link depended on eww-display-html to set shr-target-id, but following this change that's no longer the case. This doesn't affect eww-reload, which also calls eww-display-html, because it passes it an explicit position to jump to. > It goes to the anchor link by clicking on it () or with 'v' key > as it actually calls shr-browse-url (but this has the side-effect of > reloading the whole page though). Yes, we wouldn't want eww-follow-link to do that, and in fact it already contains logic to avoid reloading the whole page, modulo the aforementioned regression in Emacs 27. Lars, Eli, how's the following fix for emacs-27? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Fix-following-target-on-same-page-in-EWW.patch >From 213264081a827e9041dbab294a5ff72fdc71b45f Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Wed, 22 Apr 2020 11:42:17 +0100 Subject: [PATCH] Fix following target on same page in EWW * lisp/net/eww.el (eww-follow-link): Set shr-target-id before calling eww-display-html as the latter no longer does so for us (bug#28441, bug#40532). --- lisp/net/eww.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/net/eww.el b/lisp/net/eww.el index c83884fd25..8bbbcae9c2 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -1578,7 +1578,8 @@ eww-follow-link ;; This is a #target url in the same page as the current one. ((and (url-target (url-generic-parse-url url)) (eww-same-page-p url (plist-get eww-data :url))) - (let ((dom (plist-get eww-data :dom))) + (let ((dom (plist-get eww-data :dom)) + (shr-target-id (url-target (url-generic-parse-url url)))) (eww-save-history) (plist-put eww-data :url url) (eww-display-html 'utf-8 url dom nil (current-buffer)))) -- 2.26.1 --=-=-= Content-Type: text/plain Thanks, -- Basil --=-=-=--