[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#58118: 29.0.50; Follow #target links in eww without re-rendering pag
From: |
Visuwesh |
Subject: |
bug#58118: 29.0.50; Follow #target links in eww without re-rendering page |
Date: |
Wed, 28 Sep 2022 08:12:51 +0530 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
[செவ்வாய் செப்டம்பர் 27, 2022] Lars Ingebrigtsen wrote:
> Visuwesh <visuweshm@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
Description: Text Data