unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Basil L. Contovounesios" <contovob@tcd.ie>
To: Arnaud Fontaine <arnau@mini-dweeb.org>,
	Lars Ingebrigtsen <larsi@gnus.org>
Cc: 40532@debbugs.gnu.org
Subject: bug#40532: 28.0.50; eww/shr: Anchor link does not work
Date: Wed, 22 Apr 2020 12:38:17 +0100	[thread overview]
Message-ID: <87blnj92dy.fsf@tcd.ie> (raw)
In-Reply-To: <87o8rk597f.fsf@milkypond.org> (Arnaud Fontaine's message of "Wed, 22 Apr 2020 15:24:36 +0900")

[-- Attachment #1: Type: text/plain, Size: 1129 bytes --]

found 40532 27.0.50
tags 40532 + patch
quit

Arnaud Fontaine <arnau@mini-dweeb.org> 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 (<mouse-2>) 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?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-following-target-on-same-page-in-EWW.patch --]
[-- Type: text/x-diff, Size: 1072 bytes --]

From 213264081a827e9041dbab294a5ff72fdc71b45f Mon Sep 17 00:00:00 2001
From: "Basil L. Contovounesios" <contovob@tcd.ie>
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


[-- Attachment #3: Type: text/plain, Size: 20 bytes --]


Thanks,

-- 
Basil

  reply	other threads:[~2020-04-22 11:38 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-10  3:56 bug#40532: 28.0.50; eww/shr: Anchor link does not work Arnaud Fontaine
2020-04-22  6:24 ` Arnaud Fontaine
2020-04-22 11:38   ` Basil L. Contovounesios [this message]
2020-04-22 12:55     ` Basil L. Contovounesios
2020-04-25 14:46       ` Arnaud Fontaine
2020-04-25 20:28         ` Basil L. Contovounesios
2020-04-30  4:11           ` Lars Ingebrigtsen
2020-04-30 10:20             ` Basil L. Contovounesios
2020-05-08  1:10               ` Basil L. Contovounesios
2020-05-12  4:57                 ` Arnaud Fontaine
2020-05-21 22:34                   ` Basil L. Contovounesios
2020-05-19 12:23                 ` Lars Ingebrigtsen
2020-05-21 22:34                   ` Basil L. Contovounesios
2020-06-13 15:06                     ` Basil L. Contovounesios
2020-06-18 15:54                       ` Basil L. Contovounesios
2020-04-22 13:53     ` Eli Zaretskii
2020-04-22 15:44       ` Basil L. Contovounesios
2020-04-22 15:57         ` Eli Zaretskii
2020-04-22 16:15           ` Basil L. Contovounesios
2020-04-22 16:21             ` Eli Zaretskii
2020-04-22 22:32               ` Basil L. Contovounesios
2020-04-22 20:10           ` Arnaud Fontaine
2020-04-22 22:32             ` Basil L. Contovounesios
2020-04-25 10:14           ` Eli Zaretskii
2020-04-30  4:13             ` Lars Ingebrigtsen
2020-04-30 10:15               ` Basil L. Contovounesios
2020-04-30 22:09                 ` Lars Ingebrigtsen
2020-05-03 23:49                   ` Basil L. Contovounesios
2020-05-07  4:02                     ` Arnaud Fontaine

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87blnj92dy.fsf@tcd.ie \
    --to=contovob@tcd.ie \
    --cc=40532@debbugs.gnu.org \
    --cc=arnau@mini-dweeb.org \
    --cc=larsi@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).