From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.bugs Subject: bug#40532: 28.0.50; eww/shr: Anchor link does not work Date: Wed, 22 Apr 2020 16:44:18 +0100 Message-ID: <87h7xbjzjh.fsf@tcd.ie> References: <87sghckn7p.fsf@milkypond.org> <87o8rk597f.fsf@milkypond.org> <87blnj92dy.fsf@tcd.ie> <83wo67eien.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="61640"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: larsi@gnus.org, 40532@debbugs.gnu.org, arnau@mini-dweeb.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Apr 22 17:45:51 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jRHZP-000FtB-Fr for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 22 Apr 2020 17:45:51 +0200 Original-Received: from localhost ([::1]:53112 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRHZO-0001zZ-Jj for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 22 Apr 2020 11:45:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43898) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRHYr-0001s5-NA for bug-gnu-emacs@gnu.org; Wed, 22 Apr 2020 11:45:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRHYc-0003qV-EZ for bug-gnu-emacs@gnu.org; Wed, 22 Apr 2020 11:45:17 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41406) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jRHYc-0003q3-1F for bug-gnu-emacs@gnu.org; Wed, 22 Apr 2020 11:45:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jRHYb-00025M-Uh for bug-gnu-emacs@gnu.org; Wed, 22 Apr 2020 11:45:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 Apr 2020 15:45:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 40532 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 40532-submit@debbugs.gnu.org id=B40532.15875702757964 (code B ref 40532); Wed, 22 Apr 2020 15:45:01 +0000 Original-Received: (at 40532) by debbugs.gnu.org; 22 Apr 2020 15:44:35 +0000 Original-Received: from localhost ([127.0.0.1]:52952 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRHY7-00024L-As for submit@debbugs.gnu.org; Wed, 22 Apr 2020 11:44:35 -0400 Original-Received: from mail-pj1-f65.google.com ([209.85.216.65]:55205) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jRHY5-000242-Q0 for 40532@debbugs.gnu.org; Wed, 22 Apr 2020 11:44:30 -0400 Original-Received: by mail-pj1-f65.google.com with SMTP id y6so1095659pjc.4 for <40532@debbugs.gnu.org>; Wed, 22 Apr 2020 08:44:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=bvsvNY8Wqb6JWTtsq16C0B0RrurWO+diA0TIsqXxlT4=; b=BOdjlaza5/xreBoJzFCxq9WLzu5ZG11DxVvcZRxS8T6xtrGXBbKs1W6crmUIZORDIX LkOhpXFYOL2sH2PgCDrJs1MfKvggBMAfQkOUkwyex8zZAJfMmPPnFIKfPqdUDIm5ufcC KEeF+9H1A07dzVd/WycxiOXV0rpa0FkVE5eLTeGu/jyT0yQjgHBW56o372GQ0Tx1UT2V l3iFMG18p6j1RF0WWNajMjJUSEfA2DSS+lHq49AjzxroWMG5KuIwu6V3roVUki4rVDXq PSqwIf8yfayXvlLhNuZRB5WhLna0rTX+p3H9+1NU9p8V308etpJaEfB7sLeKNoYhdvwK FVBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=bvsvNY8Wqb6JWTtsq16C0B0RrurWO+diA0TIsqXxlT4=; b=Vr6MFDTQSBKl1/PAGJpprbNcz6CRtr2w+q9sErDW1OrNdNQWnETFK4c0wcBFd/OlEy YcAXp/U34Z+FTRMmEZcvG89N/Ve7YyKIGz7g/sPVfvEUDLV45af9g7cIoe3wJDu71Lel bOVIBzc0rHWQiSI7pB/8gVvK/aZ7SDZf8Guou2QLUT8YxFYGM2Onu5ZJ6f47WdZbfAs6 ER9FSsGuyfr6UOcpNYNc15mdM6YgdEqLRHrN6xABo+2/+/B/15NDmOX4yrU5hnQQVjCj 35KUy6y2f0Cj6jXskeEhfLtupzL6qRi0seo0v79iq6ms+DyOMNtcxRIDhL+233Tr3Abn znVA== X-Gm-Message-State: AGi0PuY71+GU5M8vfrFJGQT5k+pC1Tuffl4t3eOmhXAPzUgc4rMUDJRw 8F5ZgGxsOBISGJMO9Dhe9NYaQg== X-Google-Smtp-Source: APiQypIIZH4G2sjEZm7SU8Yknzg4pCtkMfe9UlKD41DF356gZV/nFxor1uJ0SjorTRI3F3KDGCDj3Q== X-Received: by 2002:a17:90b:3843:: with SMTP id nl3mr4897188pjb.72.1587570263047; Wed, 22 Apr 2020 08:44:23 -0700 (PDT) Original-Received: from localhost ([2a02:8084:20e2:c380:92bd:1bfd:38fc:fae2]) by smtp.gmail.com with ESMTPSA id 10sm5812649pfn.204.2020.04.22.08.44.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Apr 2020 08:44:22 -0700 (PDT) In-Reply-To: <83wo67eien.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 22 Apr 2020 16:53:20 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:178798 Archived-At: Eli Zaretskii writes: >> From: "Basil L. Contovounesios" >> Date: Wed, 22 Apr 2020 12:38:17 +0100 >> Cc: 40532@debbugs.gnu.org >> >> Arnaud Fontaine 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))