From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: James Thomas via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#71450: [PATCH] Wrong eww-history-position after desktop restore if within history Date: Sun, 09 Jun 2024 17:53:29 +0530 Message-ID: <86h6e21f0e.fsf@outlook.com> Reply-To: James Thomas Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18288"; mail-complaints-to="usenet@ciao.gmane.io" Cc: jporterbugs@gmail.com To: 71450@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 09 14:41:53 2024 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 1sGHrs-0004WW-NZ for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 09 Jun 2024 14:41:52 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sGHqq-0006tf-Nf; Sun, 09 Jun 2024 08:40:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sGHqo-0006sz-Pw for bug-gnu-emacs@gnu.org; Sun, 09 Jun 2024 08:40:46 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sGHqo-0006E8-HH for bug-gnu-emacs@gnu.org; Sun, 09 Jun 2024 08:40:46 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sGHr4-0008Ay-R0; Sun, 09 Jun 2024 08:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: James Thomas Original-Sender: "Debbugs-submit" Resent-CC: jporterbugs@gmail.com, bug-gnu-emacs@gnu.org Resent-Date: Sun, 09 Jun 2024 12:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 71450 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: jporterbugs@gmail.com Original-Received: via spool by submit@debbugs.gnu.org id=B.171793685431345 (code B ref -1); Sun, 09 Jun 2024 12:41:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 Jun 2024 12:40:54 +0000 Original-Received: from localhost ([127.0.0.1]:35372 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGHqw-00089T-7l for submit@debbugs.gnu.org; Sun, 09 Jun 2024 08:40:54 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:34332) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGHms-0007wG-FN for submit@debbugs.gnu.org; Sun, 09 Jun 2024 08:36:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sGHaS-0002Gh-JM for bug-gnu-emacs@gnu.org; Sun, 09 Jun 2024 08:23:52 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sGHaQ-00039a-DF for bug-gnu-emacs@gnu.org; Sun, 09 Jun 2024 08:23:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1717935820; x=1718540620; i=jimjoe@gmx.net; bh=BFEcJm51aE/ajT24Wne/OO5E6hF15fDU3khLRj03qLA=; h=X-UI-Sender-Class:From:To:Subject:Date:Message-ID:MIME-Version: Content-Type:cc:content-transfer-encoding:content-type:date:from: message-id:mime-version:reply-to:subject:to; b=g16YVhUbHiwh81lv6EOcaPKjt3isDKwgtrlEGFNfcKlGLglgqg2QEwm/+9rVIeYQ BBELBsZquv+3ZtThLxPC3g0UFLnED7Cv2kzzHYFgKNykHD3XsaNuu2c1+bjX1nK0F xvVwOq4apy7CyE63vY8qr4L7pGoj6YpGI4bglkrVfRlw7mo8Fe7LuNoAC8YFaDfMZ uA4E48CbWzRO4J0nvV+nPsf8WvpOOaUATA4vUfSt/m6CfDtAQmnL7d4hmf8T7Px+K KLT8lQqnczqRe6ni9w4wQzk15S81ffN/oSxC6noCdKSbbqIM941QFhVrPOhN2AnGM LefSgYRoGWPhaQMslw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from user-Inspiron-3493 ([42.108.15.42]) by mail.gmx.net (mrgmx104 [212.227.17.174]) with ESMTPSA (Nemesis) id 1N5GE1-1sNfX53uCr-013Xbq for ; Sun, 09 Jun 2024 14:23:40 +0200 X-Provags-ID: V03:K1:8b33xqQ11Jy4UJqpDXjfPw1XPPHFjZR1DhvpSQJQq04PPS+Y1z1 reKicNd4yjZQJDK0IILYSpeJTmmqvmgE1VQi7hvubdyt5TS1zndyNsaTQXNG2YhH2rawINu I2/wWWiacFRUIcIijS9dE6Jitz+J85cIf8CIAtKHzQRS1jjEi1BbJD65sFQQY6JqHmA7NLd b9Dv8nHQ5q8PDtC3RG9UQ== UI-OutboundReport: notjunk:1;M01:P0:KPcdkBLSEIQ=;xCq6MX3UbrIc+Y/LgNFxvYkFuU+ NofSoAy+1L9h0tgzaZgFUggI0KzxnSzIM4xEC0NACmlgQzNZwDYmgNriCmCzmaWt/cK7kBVul hN7JJHhuiO/KOZr3ezDMF/mWv4/uWZnUyi8I8zKjxpdOar24XbwaVdbINA6i7ZR6XWItoi9Yi qHYRYHtUIFdUCooUCF2k+GJ7rZ5Mvxblmh9PQyHBuY8FVU4xMWWwMVaGo/hbRnG5Kd66Ta+CL pT92sKAphS095/kpL7BFPUmetUzLeXihUpyRMhV5kpXF3/AVX58Aqnu62gGiTQEDm/Y7egGbP 28GmlOLXQqDicYmNVLMTCTV+SjzPth/Z0KS1a+YMsKShaWdg1ES637o9u/LBpp3v64vXWVKaa fo9xHEK212LgQdufNafQUshg6nV5JqP/dTV/GGDshwA9a7Ku+ZejehgE4BixR8Jnp44pV7MiM xokJvLZuPV1aPQFz3XXJswBHk1X9IBiAn5gpexLVL9dQX+dPGHauVRMJd9thE2ppRh1VfX3td cY9oy4J00RkI8jfUftyCjUHCwnzQZ4lagRVCSWsUZ3J9Awa+wEV5uXBpAex7hzoHdHyK3JRyf Kgz9G+VzkyifYZckODgTU8bDieqMLmHcks3nj28KQ1cfgTzMa1gmzIM5rjVYOdp+xdUjg/LUt Nc+OB1GWYJbdgYyoyYCRR3XS+By4vD2mZ+IYzA9Zbf1wkRtwsxGXk9UnrAWLPFhDdE8idBOts 4wTiOQWglDrZwlbgEJzCqDBjmXn2CfQ0w4JLk2977IrK/FIZjeDk59D5JRoRRFcP0ZGGKfy1 Received-SPF: pass client-ip=212.227.17.20; envelope-from=jimjoe@gmx.net; helo=mout.gmx.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:286937 Archived-At: --=-=-= Content-Type: text/plain - emacs -Q - M-x eww RET RET - RET (on any link) - l - M-x desktop-save RET RET - C-x C-c (exit) - emacs -Q - M-x desktop-read RET RET - g (to reload the webpage) - RET (on any link) fails In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.18.0) of 2024-06-09 built on user-Inspiron-3493 Repository revision: e9a0256a556622474bcbb015f88d790666db2cc9 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101007 System Description: Ubuntu 23.10 Configured using: 'configure --with-native-compilation=aot' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings: value of $LANG: en_IN value of $XMODIFIERS: @im=ibus locale-coding-system: iso-latin-1-unix Major mode: VC dir Minor modes in effect: rcirc-track-minor-mode: t display-time-mode: t pdf-occur-global-minor-mode: t vc-dir-git-mode: t global-git-commit-mode: t magit-auto-revert-mode: t desktop-environment-mode: t server-mode: t erc-track-mode: t erc-ring-mode: t erc-netsplit-mode: t erc-menu-mode: t erc-match-mode: t erc-log-mode: t erc-list-mode: t erc-irccontrols-mode: t erc-noncommands-mode: t erc-move-to-prompt-mode: t erc-readonly-mode: t erc-button-mode: t erc-fill-mode: t erc-stamp-mode: t erc-autojoin-mode: t savehist-mode: t midnight-mode: t icomplete-mode: t fido-mode: t erc-networks-mode: t display-battery-mode: t desktop-save-mode: t override-global-mode: t tooltip-mode: t global-eldoc-mode: t show-paren-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 minibuffer-regexp-mode: t buffer-read-only: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t This is a patch that I think is simple enough to forgo the extensive testing which it hasn't been subjected to. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Correct-eww-history-position-in-desktop-restore.patch Content-Description: [PATCH] Correct eww-history-position in desktop restore Content-Transfer-Encoding: quoted-printable =46rom c5a9be613fb2c0a96db0dadb11ff2584c4ebbc8c Mon Sep 17 00:00:00 2001 From: James Thomas Date: Sun, 9 Jun 2024 17:35:21 +0530 Subject: [PATCH] Correct eww-history-position in desktop restore Account for duplicate removal from eww-history. * lisp/net/eww.el (eww-desktop-misc-data): Add :history-position (eww-restore-desktop): Use it. (desktop-locals-to-save): Remove the raw variable. =2D-- lisp/net/eww.el | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 977210e9cc8..bd63e52ee77 100644 =2D-- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -2754,11 +2754,17 @@ eww-desktop-misc-data Generally, the list should not include the (usually overly large) :dom, :source and :text properties." (let ((history (mapcar #'eww-desktop-data-1 - (cons eww-data eww-history)))) - (list :history (if eww-desktop-remove-duplicates - (cl-remove-duplicates - history :test #'eww-desktop-history-duplicate) - history)))) + (cons eww-data eww-history))) + rval) + (list :history + (setq rval (if eww-desktop-remove-duplicates + (cl-remove-duplicates + history :test #'eww-desktop-history-duplicate) + history)) + :history-position + (cl-position + (elt history eww-history-position) + rval :test #'eww-desktop-history-duplicate)))) (defun eww-restore-desktop (file-name buffer-name misc-data) "Restore an eww buffer from its desktop file record. @@ -2772,7 +2778,8 @@ eww-restore-desktop (setq eww-history (cdr (plist-get misc-data :history)) eww-data (or (car (plist-get misc-data :history)) ;; backwards compatibility - (list :url (plist-get misc-data :uri)))) + (list :url (plist-get misc-data :uri))) + eww-history-position (plist-get misc-data :history-position)) (unless file-name (when (plist-get eww-data :url) (cl-case eww-restore-desktop @@ -2784,8 +2791,6 @@ eww-restore-desktop ;; . (current-buffer))) -(add-to-list 'desktop-locals-to-save - 'eww-history-position) (add-to-list 'desktop-buffer-mode-handlers '(eww-mode . eww-restore-desktop)) =2D- 2.40.1 --=-=-=--