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 13:55:05 +0100 Message-ID: <87imhr65p2.fsf@tcd.ie> References: <87sghckn7p.fsf@milkypond.org> <87o8rk597f.fsf@milkypond.org> <87blnj92dy.fsf@tcd.ie> 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="73561"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Lars Ingebrigtsen , 40532@debbugs.gnu.org To: Arnaud Fontaine Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 22 14:56:12 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 1jREvD-000J1H-Ue for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 22 Apr 2020 14:56:11 +0200 Original-Received: from localhost ([::1]:49962 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jREvC-0007bo-V6 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 22 Apr 2020 08:56:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43106) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jREv6-0007bg-Ac for bug-gnu-emacs@gnu.org; Wed, 22 Apr 2020 08:56:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jREv5-0002AB-6M for bug-gnu-emacs@gnu.org; Wed, 22 Apr 2020 08:56:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39960) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jREv4-00028x-PM for bug-gnu-emacs@gnu.org; Wed, 22 Apr 2020 08:56:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jREv4-0007yi-NA for bug-gnu-emacs@gnu.org; Wed, 22 Apr 2020 08:56: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 12:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40532 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 40532-submit@debbugs.gnu.org id=B40532.158756011830600 (code B ref 40532); Wed, 22 Apr 2020 12:56:02 +0000 Original-Received: (at 40532) by debbugs.gnu.org; 22 Apr 2020 12:55:18 +0000 Original-Received: from localhost ([127.0.0.1]:51506 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jREuM-0007xU-2n for submit@debbugs.gnu.org; Wed, 22 Apr 2020 08:55:18 -0400 Original-Received: from mail-pg1-f196.google.com ([209.85.215.196]:40536) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jREuJ-0007xF-BA for 40532@debbugs.gnu.org; Wed, 22 Apr 2020 08:55:16 -0400 Original-Received: by mail-pg1-f196.google.com with SMTP id n16so1031897pgb.7 for <40532@debbugs.gnu.org>; Wed, 22 Apr 2020 05:55:15 -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=H54QftUW5zlYpX/8GXjycbsAJzcQiwqEmSrTQc+Fku0=; b=o+Pv24HfPLzPoXRHprITn/8Dns0YzK6LSLs4APn/0l9MS6SFEa+XihcOZ41rlg6mRX SYp1y85zjhmzdFey8tQQXsM2yFq8VaZzMy4PBGr+8OCJ8/p9AQvFb8O4vwCEK+LiZwBq J7gkwQORNtZmbe7ZXLesR6G9F0DUz7IvnmDc8Ohq9b7M0ohpSM6ljqpIdPnGtVSdTKbd QuEXxSJSwRKuCtzaGzqLv/XUxES8Ig/oZnwdbUlWj4Kixvk3uxPPe5pF7YH7tA0UNnhl nz2CiOd1bTX5qEQ8wIK756KRLpVBYtR36eM8X+Ze1fN/162Ti0j2MWQ+cS+GRDz3zqSz 5dLQ== 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=H54QftUW5zlYpX/8GXjycbsAJzcQiwqEmSrTQc+Fku0=; b=LFaHsPAM/PiNxc0ef7y0G453e0sKfWpFr2+FCPaPDzMbd98koUc751mONbK24423lE t5RBuj4gkf61MKwwKUIljVx1cdP8ieiyG49jZm0ugFv9lUQmUatAvi3arBXcIvn+K22G D2q0T0AGyP8bQTMuNNL+bXcVKyzqLUU36yr6yIk3GZKKuJiKbqxHiA4RIBKqFMNTyiwJ sv7Rok2dR5p2TK8KpvvVjg/EZJVX6fxWgNzFfV9kP3DvpS4f2TmlUPFPDDWrH4tGmyPa fivav+iNEqQXKJoDDF5kggL75jLKIxHHacz34kYpHRt3FMXjXaLpyqX52yFKYdFWVbfE fDqQ== X-Gm-Message-State: AGi0Pub3z4MIXGm7yyrjjzjST3iDKVG6EfOF2VnKd1JwjW8ePQ+e/J6T pH2OxXg5fwUUXY6VFL3/GMLTAw== X-Google-Smtp-Source: APiQypKI+5YPDNtHwo1f+2SwoA2LWE5lhSyX0H5N+gRQbVN/D49qMNmyCFVTKBiEvPUI1MfovttqyQ== X-Received: by 2002:a62:2b06:: with SMTP id r6mr25968647pfr.249.1587560109280; Wed, 22 Apr 2020 05:55:09 -0700 (PDT) Original-Received: from localhost ([2a02:8084:20e2:c380:92bd:1bfd:38fc:fae2]) by smtp.gmail.com with ESMTPSA id 185sm5506632pfv.9.2020.04.22.05.55.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Apr 2020 05:55:08 -0700 (PDT) In-Reply-To: <87blnj92dy.fsf@tcd.ie> (Basil L. Contovounesios's message of "Wed, 22 Apr 2020 12:38:17 +0100") 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:178786 Archived-At: --=-=-= Content-Type: text/plain "Basil L. Contovounesios" writes: > 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. [...] > Lars, Eli, how's the following fix for emacs-27? Here's an even better fix for the regression IMO: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Fix-eww-follow-link-on-URLs-with-target.patch >From 541a85fd17193a67883a36876fb982710abe4f7d Mon Sep 17 00:00:00 2001 From: "Basil L. Contovounesios" Date: Wed, 22 Apr 2020 11:42:17 +0100 Subject: [PATCH] Fix eww-follow-link on URLs with #target * lisp/net/eww.el (eww-display-html): Ensure shr-target-id is set as callers depend on this (bug#28441, bug#40532). --- lisp/net/eww.el | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lisp/net/eww.el b/lisp/net/eww.el index c83884fd25..1be499172b 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -518,6 +518,10 @@ eww-display-html (plist-put eww-data :dom document) (let ((inhibit-read-only t) (inhibit-modification-hooks t) + ;; Possibly set by the caller, e.g., `eww-render' which + ;; preserves the old URL #target before chasing redirects. + (shr-target-id (or shr-target-id + (url-target (url-generic-parse-url url)))) (shr-external-rendering-functions (append shr-external-rendering-functions -- 2.26.1 --=-=-= Content-Type: text/plain WDYT? -- Basil --=-=-=--