From unknown Mon Aug 11 18:19:24 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#58118 <58118@debbugs.gnu.org> To: bug#58118 <58118@debbugs.gnu.org> Subject: Status: 29.0.50; Follow #target links in eww without re-rendering page Reply-To: bug#58118 <58118@debbugs.gnu.org> Date: Tue, 12 Aug 2025 01:19:24 +0000 retitle 58118 29.0.50; Follow #target links in eww without re-rendering page reassign 58118 emacs submitter 58118 Visuwesh severity 58118 wishlist tag 58118 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 27 11:38:54 2022 Received: (at submit) by debbugs.gnu.org; 27 Sep 2022 15:38:54 +0000 Received: from localhost ([127.0.0.1]:56566 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odCfe-0002hu-0l for submit@debbugs.gnu.org; Tue, 27 Sep 2022 11:38:54 -0400 Received: from lists.gnu.org ([209.51.188.17]:42678) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odCfZ-0002hk-R7 for submit@debbugs.gnu.org; Tue, 27 Sep 2022 11:38:52 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35780) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odCfZ-0002Z7-Ks for bug-gnu-emacs@gnu.org; Tue, 27 Sep 2022 11:38:49 -0400 Received: from mail-pj1-x1043.google.com ([2607:f8b0:4864:20::1043]:56274) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1odCfW-0006Ug-Po for bug-gnu-emacs@gnu.org; Tue, 27 Sep 2022 11:38:49 -0400 Received: by mail-pj1-x1043.google.com with SMTP id fs14so9651177pjb.5 for ; Tue, 27 Sep 2022 08:38:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date; bh=AYNY6SV5ra8TyuFKtqXidQlQJGz+E5c42xqbQYHIRco=; b=NpW96jQpiW1OTgpsooQLOSCKIR3u6La+52A6DQh1tPYPwaN9FVyxQSY3BoaTPNo9oN +GqjHSiPuPj9niDYS766vpPAJa712uQXp0XRThUt0tBODMSX5EGhXYUqWOxnOomGeMtU OpFz11OZXvQDoN4F6FgW+T/iGIVPeGFhtFmOzdWdWqj0Vs/xuQNyAKwWMtO46cuslPJt oSgldtelp0TVXs9MJTVbiGaxyZqOyf66kKT/aDM92bjqckvrfimPJbPnQ53ObCrlFktH 3y8Pxm62GU7kDlP6pMAQsA+T7T7+26WzeGfr1XCYXcAptT0KhU1XRj6DEUbrv4RBGeWI t9Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date; bh=AYNY6SV5ra8TyuFKtqXidQlQJGz+E5c42xqbQYHIRco=; b=ib5Uwu4WH1G+jbfldf1wbHeBM8uLs6UCtdO46S0rilgsZ4jf9rPSa7zIfwyRi7p/iC QVHMPxmzlxjDCqnqyY8YYI05D9e1piHAtBx7y2rr9Wue1OhGFWbf/H6T+LLB1fbbsqRu FChS1GSPjxQXDeeDHCqEsoDNxfaJHDGbM+pPxeLGap3epwdWZ8+cXpIT3HAGkxb+E01o uOAUXZuRJR+SKRj81+0IBkbK8JYcr/n/OVhtJ/tVkWH0vGroNyC5F5y9fkRpNWYdpc7b LIV90HE2U9DyM7rV6YmM7ka8iPWVoutMCic6gqUmNrQxih28kCkSwFv830JERB/djI+7 ribg== X-Gm-Message-State: ACrzQf2IHqko2/OF82NlKPGFrMPplAB2lMCXTKHoWrQPMuHfe1gDVMUN tIgVwoEypmVFyQg7pUy3mj/GuQtXeww= X-Google-Smtp-Source: AMsMyM4ROX3nnOqPXQy9Uy1ZkOyWUjEbEAVw3L4xIa29OolQuHwy+phY1LQRBerEfkQlHWJENNPOJA== X-Received: by 2002:a17:90a:67c1:b0:202:e10a:4f14 with SMTP id g1-20020a17090a67c100b00202e10a4f14mr5318891pjm.238.1664293124753; Tue, 27 Sep 2022 08:38:44 -0700 (PDT) Received: from localhost ([118.185.152.162]) by smtp.gmail.com with ESMTPSA id y23-20020a17090264d700b00176a579fae8sm1661865pli.210.2022.09.27.08.38.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Sep 2022 08:38:43 -0700 (PDT) From: Visuwesh To: bug-gnu-emacs@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-ID: <87leq4rfno.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::1043; envelope-from=visuweshm@gmail.com; helo=mail-pj1-x1043.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain 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, --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=eww-target.patch diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 61b1b75068..6ac198099a 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -315,7 +315,8 @@ eww-accept-content-types (defvar-keymap eww-link-keymap :parent shr-map - "RET" #'eww-follow-link) + "RET" #'eww-follow-link + "" #'eww-follow-link) (defvar-keymap eww-image-link-keymap :parent shr-map @@ -1901,7 +1902,8 @@ eww-follow-link eww-mode) (mouse-set-point mouse-event) (let* ((orig-url (get-text-property (point) 'shr-url)) - (url (eww--transform-url orig-url))) + (url (eww--transform-url orig-url)) + target) (cond ((not url) (message "No link under point")) @@ -1913,12 +1915,17 @@ eww-follow-link (funcall browse-url-secondary-browser-function url) (shr--blink-link)) ;; This is a #target url in the same page as the current one. - ((and (url-target (url-generic-parse-url url)) + ((and (setq target (url-target (url-generic-parse-url url))) (eww-same-page-p url (plist-get eww-data :url))) - (let ((dom (plist-get eww-data :dom))) + (let ((dom (plist-get eww-data :dom)) + match) (eww-save-history) (plist-put eww-data :url url) - (eww-display-html 'utf-8 url dom nil (current-buffer)))) + (goto-char (point-min)) + (setq match (text-property-search-forward 'shr-target-id target #'member)) + (if match + (goto-char (prop-match-beginning match)) + (eww-display-html 'utf-8 url dom nil (current-buffer))))) (t (eww-browse-url orig-url external))))) --=-=-= Content-Type: text/plain 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)) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 27 12:24:05 2022 Received: (at 58118) by debbugs.gnu.org; 27 Sep 2022 16:24:05 +0000 Received: from localhost ([127.0.0.1]:56627 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odDNN-0003ut-6R for submit@debbugs.gnu.org; Tue, 27 Sep 2022 12:24:05 -0400 Received: from quimby.gnus.org ([95.216.78.240]:54396) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odDNJ-0003uL-AD for 58118@debbugs.gnu.org; Tue, 27 Sep 2022 12:24:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=pwAHGaat+7gKBcrSFEPkkK03pGQcHPic4uN4VkRruJQ=; b=k7sIUMpgILHu4ZH0RhW7ezM2sO tAbgP9d8kRYU8VRbgjPNjQ/6NBj9BkBX4PhSa3w73F3HQbOIXIIth1n95Rq7rGn7R2jLcuev7RBkG /1WZ2RyzJpkuqWab7+VguD+e0/gMfbt+Fty2dNZs7bN+/7njzk/VsZS1qCypaHjhQvKw=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1odDNA-0003YV-Pk; Tue, 27 Sep 2022 18:23:54 +0200 From: Lars Ingebrigtsen To: Visuwesh Subject: Re: bug#58118: 29.0.50; Follow #target links in eww without re-rendering page In-Reply-To: <87leq4rfno.fsf@gmail.com> (Visuwesh's message of "Tue, 27 Sep 2022 21:08:35 +0530") References: <87leq4rfno.fsf@gmail.com> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAD1BMVEWRcmFMSE4qHB5X LCP///9RTAUoAAAAAWJLR0QEj2jZUQAAAAd0SU1FB+YJGxAOO7VvhwoAAAFNSURBVDjLlZNRtsMg CESt2UC1G4iwAQv739sbRE1s8k5P+dCaG2aAmvBIz9TikcID2zNYpBQiJVpDVbCGWEpO+QSZNhYD 2XTy6Tm/qBhIeQXpjbMBw2swNQ8zX5k6SGXxHuHmzYJVVK0gnhkdkAqLTCks4p6MUkXw2Ptg1uhA oIXFNA3UunkGwQLj0OYGELTKGJJZqKWomgePxnCulqEO0uwCOlW55ar1kcvROW/q0aebaBeBlHCd oE094VUTEKo8gAkUtG4ZKPxJfAJNnAUG9PKiDlAiGvRWV0Cm1q6Bax1gzPIeFBpad+CSAcI35vYm ZaZ6AWx/w47priD4vdnjZ+e1p11AOQq4AWpAL1X1jN+A/AB4CMkKuO+7+jXhCWTMK2Iy0m/7GUhs DcoE/S5y3fS9VtU+F9xR95gZ+D12F/0KuJ/HTh+dj+IA/os/Cl2at+vNgCYAAAAldEVYdGRhdGU6 Y3JlYXRlADIwMjItMDktMjdUMTY6MTQ6NTkrMDA6MDD9vVC7AAAAJXRFWHRkYXRlOm1vZGlmeQAy MDIyLTA5LTI3VDE2OjE0OjU5KzAwOjAwjODoBwAAAABJRU5ErkJggg== X-Now-Playing: Peter, Paul and Mary's _Peter, Paul and Mary_: "Sorrow" Date: Tue, 27 Sep 2022 18:23:52 +0200 Message-ID: <87v8p823c7.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Visuwesh 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 [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58118 Cc: 58118@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Visuwesh 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))) From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 27 13:37:11 2022 Received: (at control) by debbugs.gnu.org; 27 Sep 2022 17:37:11 +0000 Received: from localhost ([127.0.0.1]:56715 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odEW3-00080p-C2 for submit@debbugs.gnu.org; Tue, 27 Sep 2022 13:37:11 -0400 Received: from quimby.gnus.org ([95.216.78.240]:55030) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odEW1-00080G-Kk for control@debbugs.gnu.org; Tue, 27 Sep 2022 13:37:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Subject:From:To:Message-Id:Date:Sender:Reply-To:Cc: MIME-Version:Content-Type:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=suSmcON0bnvjhFs29coSOiF+kA2cf3cD0JWXIOz5o/s=; b=a8+YKNIRls9ybPodQogPw8qNNt YZjXsrXRBHA+2gN85rEZ4DoH/dF/0WgKd7oYo4/fxXtw/9LqvSq+e2rOMS/cveH7OHpwThi2t1UO9 vZl6q3qCKNmstS4ne2yY1mda7Ot3j2sDcYJCk8p0KE0XOwiwsTz3PNjw96s4iBqxJdIM=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1odEVt-00044r-R9 for control@debbugs.gnu.org; Tue, 27 Sep 2022 19:36:59 +0200 Date: Tue, 27 Sep 2022 19:36:57 +0200 Message-Id: <878rm41zye.fsf@gnus.org> To: control@debbugs.gnu.org From: Lars Ingebrigtsen Subject: control message for bug #58118 X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: tags 58118 + patch quit Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) tags 58118 + patch quit From debbugs-submit-bounces@debbugs.gnu.org Tue Sep 27 22:43:16 2022 Received: (at 58118) by debbugs.gnu.org; 28 Sep 2022 02:43:16 +0000 Received: from localhost ([127.0.0.1]:57150 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odN2Z-0000h7-Nr for submit@debbugs.gnu.org; Tue, 27 Sep 2022 22:43:16 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:46035) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odN2W-0000gt-RP for 58118@debbugs.gnu.org; Tue, 27 Sep 2022 22:43:13 -0400 Received: by mail-pg1-f195.google.com with SMTP id r62so7202348pgr.12 for <58118@debbugs.gnu.org>; Tue, 27 Sep 2022 19:43:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date; bh=Z8S7uwACd9zN1za3YLs7+75M5fRG1KqmE/B/N0qwXfg=; b=Smhpgbsrq0heT6XnsLBpPRKuvB9Sk144rQEgDlaOMWwXisvHAf3HTzaySFCbk3mF9P EoGrayQeCALohHX2DvloKR7DoRNPbjrVTg8Ae5trEXW+smaBfvFD+lEih3mW0z1MGPpS o37Ldb9JvFd2mzjGpi8zlBd2riCgyx+oECv2wVXU1RL3T4CZh91OhopTlqxsBrK0Qlev Y6Yr85BsiVZNSLf1NWjydMIINJdCC+6npDz2FB+2eM/DhqwvvwvWH8wzuuqJOazzrSxx DLOLOY8FDHZI5hR5It1rQzGscdhWdG3Ban0riPYg6HC+oBO+b5OsAayV/9RCpOAdK0Uf 2N0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date; bh=Z8S7uwACd9zN1za3YLs7+75M5fRG1KqmE/B/N0qwXfg=; b=Ge6kAEshM+NAf/NrhA867xMb/8KnAMULkl3QjKIZGYI2kuEdG9oB56JtrS3hS6QSjY 5sxdkgzuviEviEBJM+eKclTwiFZYdih+i4W65qSpbA9yRu6GwHB/EeXN/KzlKLaW44Xq WiWiMfuV2MZ7ly+G3CkCZplDiE6KyXoinD+zvgCDJ5HhrGVoIkBKzwfEU/BRLOKjdppX BRzefuG3SHzCMtsi9Uxu2DHp0ObL98hb0Sshx5aAhQW21nyHgNMi48bIrsIvfhHESZY7 p2/PknBlMQbVDgCZBpicC+x0Q6aSZfoso0QVlhC2DYyTIDS56z0juSl+C4vzLhsvQQ4k FWCg== X-Gm-Message-State: ACrzQf0uptKkrpZRskiMr8BL69zlVHgTUl8iqKkvY5UA8Y4+c8wuGMt2 LBAT+YWUaa9E9ogQnewFdmY= X-Google-Smtp-Source: AMsMyM4PGaSFjOUh2ifLuSpjw4ZLX41pqjV+13U8sWcFMkgY7jfsu29guUlzU5A4Mnwd6Mqdsc3EGQ== X-Received: by 2002:a05:6a00:190d:b0:550:6db3:b9be with SMTP id y13-20020a056a00190d00b005506db3b9bemr32571609pfi.1.1664332986866; Tue, 27 Sep 2022 19:43:06 -0700 (PDT) Received: from localhost ([115.240.90.130]) by smtp.gmail.com with ESMTPSA id p1-20020a17090a348100b001fabcd994c1sm270332pjb.9.2022.09.27.19.43.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Sep 2022 19:43:05 -0700 (PDT) From: Visuwesh To: Lars Ingebrigtsen Subject: Re: bug#58118: 29.0.50; Follow #target links in eww without re-rendering page In-Reply-To: <87v8p823c7.fsf@gnus.org> (Lars Ingebrigtsen's message of "Tue, 27 Sep 2022 18:23:52 +0200") References: <87leq4rfno.fsf@gmail.com> <87v8p823c7.fsf@gnus.org> Date: Wed, 28 Sep 2022 08:12:51 +0530 Message-ID: <87v8p8z0b8.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 58118 Cc: 58118@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable [=E0=AE=9A=E0=AF=86=E0=AE=B5=E0=AF=8D=E0=AE=B5=E0=AE=BE=E0=AE=AF=E0=AF=8D = =E0=AE=9A=E0=AF=86=E0=AE=AA=E0=AF=8D=E0=AE=9F=E0=AE=AE=E0=AF=8D=E0=AE=AA=E0= =AE=B0=E0=AF=8D 27, 2022] Lars Ingebrigtsen wrote: > Visuwesh 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, --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Follow-target-links-in-eww-without-re-rendering.patch >From 4b7280340de897137e1f4272219dddde292e5a4b Mon Sep 17 00:00:00 2001 From: Visuwesh Date: Wed, 28 Sep 2022 08:11:42 +0530 Subject: [PATCH] Follow #target links in eww without re-rendering * lisp/net/eww.el (eww-follow-link): Do a text property search instead of re-rendering to follow #target links in the same page. (bug#58118) (eww-link-keymap): Bind to eww-follow-link as well. --- lisp/net/eww.el | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 61b1b75068..624958915a 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -315,7 +315,8 @@ eww-accept-content-types (defvar-keymap eww-link-keymap :parent shr-map - "RET" #'eww-follow-link) + "RET" #'eww-follow-link + "" #'eww-follow-link) (defvar-keymap eww-image-link-keymap :parent shr-map @@ -1901,7 +1902,8 @@ eww-follow-link eww-mode) (mouse-set-point mouse-event) (let* ((orig-url (get-text-property (point) 'shr-url)) - (url (eww--transform-url orig-url))) + (url (eww--transform-url orig-url)) + target) (cond ((not url) (message "No link under point")) @@ -1913,12 +1915,17 @@ eww-follow-link (funcall browse-url-secondary-browser-function url) (shr--blink-link)) ;; This is a #target url in the same page as the current one. - ((and (url-target (url-generic-parse-url url)) + ((and (setq target (url-target (url-generic-parse-url url))) (eww-same-page-p url (plist-get eww-data :url))) - (let ((dom (plist-get eww-data :dom))) + (let ((point (point))) (eww-save-history) (plist-put eww-data :url url) - (eww-display-html 'utf-8 url dom nil (current-buffer)))) + (goto-char (point-min)) + (if-let ((match (text-property-search-forward 'shr-target-id target #'member))) + (goto-char (prop-match-beginning match)) + (goto-char (if (equal target "top") + (point-min) + point))))) (t (eww-browse-url orig-url external))))) -- 2.35.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 28 06:59:27 2022 Received: (at 58118) by debbugs.gnu.org; 28 Sep 2022 10:59:27 +0000 Received: from localhost ([127.0.0.1]:60338 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odUmk-0001ZC-TJ for submit@debbugs.gnu.org; Wed, 28 Sep 2022 06:59:27 -0400 Received: from quimby.gnus.org ([95.216.78.240]:34334) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odUmj-0001Z0-95 for 58118@debbugs.gnu.org; Wed, 28 Sep 2022 06:59:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=uPXk1N2CABxcIEEVqzqBE5CXpSaodedUNCyxXoB9tcE=; b=s0rQmhyoV/srZGlVHDHP93Mg7j 2L+9tL9escQSU6uhfHeeM9tbVI9Dbcr9NdLsBBMFSs246TK9y4n08v31IPsR3wmvbs6fVjpR6Hbkb cs6c45/4OE/6mgt/jS0uvEmEZt3f/zGzlvQsNcZkwIPfUnx98wU9NJcw0xQ8SRP9DUvQ=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1odUmb-0002xt-8Y; Wed, 28 Sep 2022 12:59:19 +0200 From: Lars Ingebrigtsen To: Visuwesh Subject: Re: bug#58118: 29.0.50; Follow #target links in eww without re-rendering page In-Reply-To: <87v8p8z0b8.fsf@gmail.com> (Visuwesh's message of "Wed, 28 Sep 2022 08:12:51 +0530") References: <87leq4rfno.fsf@gmail.com> <87v8p823c7.fsf@gnus.org> <87v8p8z0b8.fsf@gmail.com> X-Now-Playing: Dorothy Ashby's _Afro-Harping_: "The Look Of Love" Date: Wed, 28 Sep 2022 12:59:16 +0200 Message-ID: <87a66jzrwb.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Visuwesh writes: > Thanks. Revised patch attached, Thanks; pushed to Emacs 29. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 58118 Cc: 58118@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Visuwesh writes: > Thanks. Revised patch attached, Thanks; pushed to Emacs 29. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 11 08:28:24 2022 Received: (at 58118-done) by debbugs.gnu.org; 11 Nov 2022 13:28:24 +0000 Received: from localhost ([127.0.0.1]:45330 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1otU51-0002p5-VJ for submit@debbugs.gnu.org; Fri, 11 Nov 2022 08:28:24 -0500 Received: from mail-oa1-f49.google.com ([209.85.160.49]:38827) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1otU50-0002ob-04 for 58118-done@debbugs.gnu.org; Fri, 11 Nov 2022 08:28:22 -0500 Received: by mail-oa1-f49.google.com with SMTP id 586e51a60fabf-1322d768ba7so5417219fac.5 for <58118-done@debbugs.gnu.org>; Fri, 11 Nov 2022 05:28:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=jFa4xIw9lURQyj+l8AtzqHX96zg3p6Dly0P1MQ8kYbQ=; b=VqtoleQw5KtJf9dUfxf0ecdCXVOAmDM5di85SP5l0chplzEFlQ6leWMKXNNn2wqcel In+/KgPOu+r/7iizta/X22L0nxLfO9t4qbOnnOQPA7MHHD1Ypfs5QmUFkuE1njscDMqI xIUd93kFi37z7T8FNBQFYDefSo4F++3HL1vHF1h38eoamM2VOHIOe9tav7FPbaKnFT5R IavImof3Jq3TW7hU6nAVOZnwmrae36V9BMSJ0dpQz0mc+cE3lyNQwpl8M/H6TUF9f5cX PvZQIvlq8TbuHpp//+gY1Q/NcRakPrqIvk353ge6a/NMm0bWE6gb5/FbigFIs9obR2eK KViA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jFa4xIw9lURQyj+l8AtzqHX96zg3p6Dly0P1MQ8kYbQ=; b=wM+GF+7GWFzJlcU8kUhOm92vJUbtpZZMnEPNgCWnXwv2rGC2esrTMz/x3B8LDVNKgR z9g9CLenBoQgrZhiqnEc57JXjIr0d2IlfKphganCLSAfgmPMYm+3jzxq3UFr6K1ihIgG cVhzJIKnTs8JbNxlV0GHBkiTUeC3pDTKxin/K/O2PIuTRu5d9Xz7F13ASaExErZ4teaH MicpKi5kE76cmvJZxysQ2Kjr3em2GtTGYpw2Cy5De9dnIqBwaDS5zC55yEQltEi0nna1 yEXqKZprun670Kk7z2Nt7/4Et0YrpDHh3OKaxqQSde+L3/c5Slv4b3ysKg93oPn/Uh6m bVJA== X-Gm-Message-State: ANoB5pkdZ+425hcHOIxXkyNYQAj4VxtSLwMeX2e81pWGZXxVYuvWV3LH qCSvCh0QgpqSyYcG/0kJ/8K65cyfITpQLbRvqAQ= X-Google-Smtp-Source: AA0mqf76ym6muGBwvV8rMtcF8uxNCl7RLtqeyINS1J55NaciySd2XrORs0DtUzSE22eynvsxktMLAHHPlTSPQQDtYZA= X-Received: by 2002:a05:6871:480a:b0:12b:fbe7:b793 with SMTP id qc10-20020a056871480a00b0012bfbe7b793mr827401oab.92.1668173296591; Fri, 11 Nov 2022 05:28:16 -0800 (PST) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Fri, 11 Nov 2022 05:28:16 -0800 From: Stefan Kangas In-Reply-To: <87a66jzrwb.fsf@gnus.org> (Lars Ingebrigtsen's message of "Wed, 28 Sep 2022 12:59:16 +0200") References: <87leq4rfno.fsf@gmail.com> <87v8p823c7.fsf@gnus.org> <87v8p8z0b8.fsf@gmail.com> <87a66jzrwb.fsf@gnus.org> X-Hashcash: 1:20:221111:58118-done@debbugs.gnu.org::pEAV7GHz4bfpz2i+:8SZ MIME-Version: 1.0 Date: Fri, 11 Nov 2022 05:28:16 -0800 Message-ID: Subject: Re: bug#58118: 29.0.50; Follow #target links in eww without re-rendering page To: Lars Ingebrigtsen Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 58118-done Cc: 58118-done@debbugs.gnu.org, Visuwesh X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Lars Ingebrigtsen writes: > Visuwesh writes: > >> Thanks. Revised patch attached, > > Thanks; pushed to Emacs 29. This was never closed; closing now. From unknown Mon Aug 11 18:19:24 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 10 Dec 2022 12:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator