unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Basil L. Contovounesios" <contovob@tcd.ie>
To: Eli Zaretskii <eliz@gnu.org>
Cc: larsi@gnus.org, 40532@debbugs.gnu.org, arnau@mini-dweeb.org
Subject: bug#40532: 28.0.50; eww/shr: Anchor link does not work
Date: Wed, 22 Apr 2020 16:44:18 +0100	[thread overview]
Message-ID: <87h7xbjzjh.fsf@tcd.ie> (raw)
In-Reply-To: <83wo67eien.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 22 Apr 2020 16:53:20 +0300")

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	other threads:[~2020-04-22 15:44 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
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 [this message]
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=87h7xbjzjh.fsf@tcd.ie \
    --to=contovob@tcd.ie \
    --cc=40532@debbugs.gnu.org \
    --cc=arnau@mini-dweeb.org \
    --cc=eliz@gnu.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).