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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 58118 in the body.
You can then email your comments to 58118 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#58118; Package emacs. (Tue, 27 Sep 2022 15:39:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Visuwesh <visuweshm <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 27 Sep 2022 15:39:01 GMT) Full text and rfc822 format available.

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

From: Visuwesh <visuweshm <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; Follow #target links in eww without re-rendering page
Date: Tue, 27 Sep 2022 21:08:35 +0530
[Message part 1 (text/plain, inline)]
Severity: wishlist

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.
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?
By non-existent targets, I mean to say that

    (goto-char (point-min))
    (text-property-search-forward 'shr-target-id "invalid" #'member)

returns nil for a non-existent "#invalid" target.

Tentative patch attached,

[eww-target.patch (text/x-diff, attachment)]
[Message part 3 (text/plain, inline)]
In GNU Emacs 29.0.50 (build 31, x86_64-pc-linux-gnu, X toolkit, cairo
 version 1.16.0, Xaw scroll bars) of 2022-09-27 built on astatine
Repository revision: 51ec68b3182914c6c95d6ddcd88ae75239ec2904
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101004
System Description: Debian GNU/Linux bookworm/sid

Configured using:
 'configure --with-x-toolkit=lucid --without-xaw3d'
Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY PDUMPER
PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS WEBP X11
XDBE XIM XINPUT2 XPM LUCID ZLIB
Important settings:
  value of $LC_MONETARY: ta_IN.UTF-8
  value of $LC_NUMERIC: ta_IN.UTF-8
  value of $LANG: en_GB.UTF-8
  locale-coding-system: utf-8-unix

Major mode: ELisp/l

Minor modes in effect:
  shell-dirtrack-mode: t
  recentf-mode: t
  bug-reference-prog-mode: t
  paredit-mode: t
  eros-mode: t
  flymake-mode: t
  pdf-occur-global-minor-mode: t
  minibuffer-depth-indicate-mode: t
  repeat-mode: t
  display-time-mode: t
  display-battery-mode: t
  winner-mode: t
  vz/acme-tag-minor-mode: t
  delete-selection-mode: t
  xterm-mouse-mode: t
  straight-use-package-mode: t
  straight-package-neutering-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  use-hard-newlines: t
  tab-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  undelete-frame-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  abbrev-mode: t

Load-path shadows:
None found.

Features:
(shadow sort flyspell ispell ecomplete mail-extr emacsbug message
yank-media rfc822 mml mml-sec epa epg rfc6068 epg-config mm-decode
mm-bodies mm-encode mailabbrev gmm-utils mailheader sendmail sh-script
smie files-x shell-command+ shell pcomplete gnutls network-stream
url-http url-gw nsm shortdoc help-fns radix-tree textsec uni-scripts
idna-mapping uni-confusable textsec-check ucs-normalize shr-color
mail-parse rfc2231 rfc2047 rfc2045 ietf-drums url-cache url-auth eww xdg
url-queue shr pixel-fill kinsoku url-file svg puny mm-url gnus nnheader
gnus-util mail-utils range mm-util mail-prsvr executable recentf
tree-widget vc-backup log-view pcvs-util vc diff pulse color avy
misearch multi-isearch noutline outline vc-git diff-mode vc-dispatcher
bug-reference cursor-sensor face-remap server paredit edmacro kmacro
eros time-date checkdoc lisp-mnt flymake-proc flymake project warnings
thingatpt wordel-autoloads sokoban-autoloads ement-autoloads
svg-lib-autoloads taxy-magit-section-autoloads magit-section-autoloads
dash-autoloads taxy-autoloads plz-autoloads nov-autoloads
esxml-autoloads kv-autoloads transmission-autoloads lua-mode-autoloads
nix-mode-autoloads gnuplot-autoloads racket-mode-autoloads
eros-autoloads flymake-shellcheck-autoloads writegood-mode-autoloads
siege-mode-autoloads paredit-autoloads puni-autoloads
expand-region-autoloads filladapt-autoloads compose scroll-other-window
org-pdftools-autoloads org-noter-autoloads change-env-autoloads
math-delimiters-autoloads doct-autoloads ob-async-autoloads
async-autoloads emacs-ob-racket-autoloads valign-autoloads
cdlatex-autoloads auctex-autoloads tex-site pdf-occur ibuf-ext ibuffer
ibuffer-loaddefs tablist advice tablist-filter semantic/wisent/comp
semantic/wisent semantic/wisent/wisent semantic/util-modes semantic/util
semantic semantic/tag semantic/lex semantic/fw mode-local find-func
cedet pdf-isearch let-alist pdf-misc imenu pdf-tools package browse-url
url url-proxy url-privacy url-expand url-methods url-history url-cookie
generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse
auth-source eieio eieio-core json map byte-opt url-vars compile comint
osc ansi-color cus-edit icons wid-edit pdf-view password-cache jka-compr
pdf-cache pdf-info tq pdf-util pdf-macs image-mode dired-x dired
dired-loaddefs exif pdf-tools-autoloads tablist-autoloads mb-depth
repeat visual-fill-autoloads olivetti-autoloads time format-spec battery
dbus filenotify xml dom tamil99 quail disp-table lacarte-autoloads
shell-command-plus-autoloads winner ring delsel easy-mmode xt-mouse
cus-load avy-autoloads finder-inf vc-backup-autoloads compat-autoloads
icalendar diary-lib diary-loaddefs cal-menu calendar cal-loaddefs
filecache imenu-xref-autoloads derived chemtable-autoloads
molar-mass-autoloads rx saveplace-pdf-view saveplace bookmark
text-property-search pp saveplace-pdf-view-autoloads pcase
inspector-autoloads xr-autoloads straight-autoloads cl-seq info cl-extra
help-mode straight subr-x cl-macs gv cl-loaddefs cl-lib bytecomp
byte-compile cconv vz-nh-theme vz-options-theme rmc iso-transl tooltip
eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type
elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd
fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow
isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
faces cus-face macroexp files window text-properties overlay sha1 md5
base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify
dynamic-setting system-font-setting font-render-setting cairo x-toolkit
xinput2 x multi-tty make-network-process emacs)

Memory information:
((conses 16 616972 46438)
 (symbols 48 23834 4)
 (strings 32 146028 7174)
 (string-bytes 1 13261806)
 (vectors 16 77190)
 (vector-slots 8 1720887 205584)
 (floats 8 378 535)
 (intervals 56 73815 211)
 (buffers 1000 37))

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58118; Package emacs. (Tue, 27 Sep 2022 16:25:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Visuwesh <visuweshm <at> gmail.com>
Cc: 58118 <at> debbugs.gnu.org
Subject: Re: bug#58118: 29.0.50; Follow #target links in eww without
 re-rendering page
Date: Tue, 27 Sep 2022 18:23:52 +0200
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.)

> 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.

> +        (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)))




Added tag(s) patch. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 27 Sep 2022 17:38:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58118; Package emacs. (Wed, 28 Sep 2022 02:44:02 GMT) Full text and rfc822 format available.

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)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#58118; Package emacs. (Wed, 28 Sep 2022 11:00:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Visuwesh <visuweshm <at> gmail.com>
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 12:59:16 +0200
Visuwesh <visuweshm <at> gmail.com> writes:

> Thanks.  Revised patch attached,

Thanks; pushed to Emacs 29.




Reply sent to Stefan Kangas <stefankangas <at> gmail.com>:
You have taken responsibility. (Fri, 11 Nov 2022 13:29:01 GMT) Full text and rfc822 format available.

Notification sent to Visuwesh <visuweshm <at> gmail.com>:
bug acknowledged by developer. (Fri, 11 Nov 2022 13:29:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 58118-done <at> debbugs.gnu.org, Visuwesh <visuweshm <at> gmail.com>
Subject: Re: bug#58118: 29.0.50; Follow #target links in eww without
 re-rendering page
Date: Fri, 11 Nov 2022 05:28:16 -0800
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Visuwesh <visuweshm <at> gmail.com> writes:
>
>> Thanks.  Revised patch attached,
>
> Thanks; pushed to Emacs 29.

This was never closed; closing now.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 10 Dec 2022 12:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 138 days ago.

Previous Next


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