bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#40532: 28.0.50; eww/shr: Anchor link does not work


From: Basil L. Contovounesios
Subject: bug#40532: 28.0.50; eww/shr: Anchor link does not work
Date: Wed, 22 Apr 2020 16:44:18 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Eli Zaretskii <eliz@gnu.org> writes:

>> From: "Basil L. Contovounesios" <contovob@tcd.ie>
>> Date: Wed, 22 Apr 2020 12:38:17 +0100
>> Cc: 40532@debbugs.gnu.org
>> 
>> 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
>
> Then how come I cannot reproduce it in today's master?

0. emacs -Q
1. M-x eww RET https://en.wikipedia.org/wiki/Emacs RET
2. C-s Cul RET (place point on ToC entry "3 Culture")
3. RET         (eww-follow-link)

Expected: Point jumps to heading "Culture[edit]" at pos 21205 on L324
Observed: Point jumps to point-min
Emacs version details follow my signature.
What do you see on your end?

>> 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?
>
> I need first to understand what is going on, and in particular why it
> doesn't happen to me.

What's going on: shr.el currently requires its users to set
shr-target-id before rendering a DOM, so that it knows where to place
the eponymous text property.

The only user of this text property in the Emacs sources is
eww-display-html, which leaves point where the text property was placed
after shr is done rendering the DOM.

Prior to the patch for bug#28441, eww-display-html would always set
shr-target-id to the current url-target (or nil) prior to invoking shr.

The patch for bug#28441 removed the setting of shr-target-id from
eww-display-html and moved it to eww-render, so that it's set before any
URL redirections strip the original url-target away.

Since eww-follow-link calls eww-display-html directly, rather than going
through eww-render (which is a url-retrieve callback), shr-target-id is
no longer set appropriately when eww-follow-link is invoked on a URL
with a #target.  So shr.el doesn't know to insert the corresponding text
property, and eww-display-html leaves point at point-min rather than the
correct #target.

-- 
Basil

In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 
1.16.0, Xaw3d scroll bars)
 of 2020-04-22 built on thunk
Repository revision: ab214143bbc633bcbe1ae146647c2fdc882122f0
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12008000
System Description: Debian GNU/Linux bullseye/sid

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Contacting host: en.wikipedia.org:443
uncompressing publicsuffix.txt.gz...done
Mark saved where search started

Configured using:
 'configure 'CC=ccache gcc' 'CFLAGS=-O2 -march=native' --config-cache
 --prefix=/home/blc/.local --with-x-toolkit=lucid
 --with-file-notification=yes --with-x'

Configured features:
XAW3D XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB
NOTIFY INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT
LIBOTF ZLIB TOOLKIT_SCROLL_BARS LUCID X11 XDBE XIM MODULES THREADS
LIBSYSTEMD JSON PDUMPER LCMS2 GMP

Important settings:
  value of $LANG: en_IE.UTF-8
  locale-coding-system: utf-8-unix

Major mode: eww

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message dired dired-loaddefs rfc822 mml
mml-sec epa derived epg epg-config mm-decode mm-bodies mm-encode
mailabbrev gmm-utils mailheader sendmail misearch multi-isearch
shr-color color cl-extra help-mode jka-compr gnutls network-stream
url-http mail-parse rfc2231 url-gw nsm rmc url-cache url-auth eww
easymenu mm-url gnus nnheader gnus-util rmail rmail-loaddefs rfc2047
rfc2045 ietf-drums time-date mail-utils wid-edit mm-util mail-prsvr
thingatpt url-queue url url-proxy url-privacy url-expand url-methods
url-history mailcap shr text-property-search url-cookie url-domsuf
url-util url-parse auth-source cl-seq eieio eieio-core cl-macs
eieio-loaddefs password-cache json subr-x map url-vars puny svg xml seq
byte-opt gv bytecomp byte-compile cconv dom browse-url format-spec
cl-loaddefs cl-lib tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type 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 elisp-mode lisp-mode prog-mode register page tab-bar menu-bar
rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core term/tty-colors frame minibuffer cl-generic
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 charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads dbusbind
inotify lcms2 dynamic-setting system-font-setting font-render-setting
cairo x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 289451 9169)
 (symbols 48 9994 1)
 (strings 32 49262 2043)
 (string-bytes 1 2896806)
 (vectors 16 16043)
 (vector-slots 8 290544 20084)
 (floats 8 137 326)
 (intervals 56 32031 257)
 (buffers 992 11))





reply via email to

[Prev in Thread] Current Thread [Next in Thread]