GNU bug report logs - #58118
29.0.50; Follow #target links in eww without re-rendering page

Previous Next

Package: emacs;

Reported by: Visuwesh <visuweshm <at> gmail.com>

Date: Tue, 27 Sep 2022 15:39:01 UTC

Severity: wishlist

Tags: patch

Found in version 29.0.50

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #13 received at 58118 <at> debbugs.gnu.org (full text, mbox):

From: Visuwesh <visuweshm <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 58118 <at> debbugs.gnu.org
Subject: Re: bug#58118: 29.0.50; Follow #target links in eww without
 re-rendering page
Date: Wed, 28 Sep 2022 08:12:51 +0530
[Message part 1 (text/plain, inline)]
[செவ்வாய் செப்டம்பர் 27, 2022] Lars Ingebrigtsen wrote:

> Visuwesh <visuweshm <at> gmail.com> writes:
>
>> eww-follow-link currently follows #target links in the same URL by
>> re-rendering the page.  Whilst this is fine for small HTML files, the
>> 1.9M HTML file that I'm currently visiting takes a couple seconds to
>> render.
>
> That's a regression, I think -- following #target links used to work
> without re-rendering.  (At least it did at one point.)

That's what I seem to remember as well.

>> I see that eww-display-html follows #target links by a text property
>> search, why don't we do the same in eww-follow-link as well?  I have one
>> question though: what do we about non-existent #targets?  Chrome and
>> Firefox seem to not scroll when I add a non-existent #target to the
>> current URL and say RET, and it seems to specially handle #top to mean
>> to go to the top even if the HTML has no hits for "#top".  Should we
>> handle the special #top target?
>
> Sure, makes sense.

Now done.

>> +        (setq match (text-property-search-forward 'shr-target-id target #'member))
>> +        (if match
>> +            (goto-char (prop-match-beginning match))
>
> This is more conveniently expressed as
>
> (when-let ((text-property-search-forward 'shr-target-id target #'member))
>   (goto-char (prop-match-beginning match)))

Thanks.  Revised patch attached,

[0001-Follow-target-links-in-eww-without-re-rendering.patch (text/x-diff, attachment)]

This bug report was last modified 2 years and 248 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.