From unknown Tue Jun 17 01:48:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#71450: [PATCH] Wrong eww-history-position after desktop restore if within history 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 To: 71450@debbugs.gnu.org Cc: jporterbugs@gmail.com X-Debbugs-Original-To: bug-gnu-emacs@gnu.org X-Debbugs-Original-Xcc: jporterbugs@gmail.com Received: via spool by submit@debbugs.gnu.org id=B.171793685431345 (code B ref -1); Sun, 09 Jun 2024 12:41:02 +0000 Received: (at submit) by debbugs.gnu.org; 9 Jun 2024 12:40:54 +0000 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 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 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 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 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 From: James Thomas Date: Sun, 09 Jun 2024 17:53:29 +0530 Message-ID: <86h6e21f0e.fsf@outlook.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K1:8b33xqQ11Jy4UJqpDXjfPw1XPPHFjZR1DhvpSQJQq04PPS+Y1z1 reKicNd4yjZQJDK0IILYSpeJTmmqvmgE1VQi7hvubdyt5TS1zndyNsaTQXNG2YhH2rawINu I2/wWWiacFRUIcIijS9dE6Jitz+J85cIf8CIAtKHzQRS1jjEi1BbJD65sFQQY6JqHmA7NLd b9Dv8nHQ5q8PDtC3RG9UQ== X-Spam-Flag: NO 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/FIZjeDk59D5JRoRRFcP0ZGGKfy1t MIvmNhhie2e8Cy017vrVJZxdnMQ2j6DGY1uggAP0Mwbb8= 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-Spam-Score: 0.7 (/) 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 - 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 --=-=-=-- From unknown Tue Jun 17 01:48:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#71450: [PATCH] Wrong eww-history-position after desktop restore if within history Resent-From: Jim Porter Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 09 Jun 2024 21:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71450 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: James Thomas , 71450@debbugs.gnu.org Received: via spool by 71450-submit@debbugs.gnu.org id=B71450.17179692311151 (code B ref 71450); Sun, 09 Jun 2024 21:41:02 +0000 Received: (at 71450) by debbugs.gnu.org; 9 Jun 2024 21:40:31 +0000 Received: from localhost ([127.0.0.1]:34445 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGQH9-0000IQ-4W for submit@debbugs.gnu.org; Sun, 09 Jun 2024 17:40:31 -0400 Received: from mail-qv1-f43.google.com ([209.85.219.43]:53322) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGQ63-00088H-Bl for 71450@debbugs.gnu.org; Sun, 09 Jun 2024 17:29:05 -0400 Received: by mail-qv1-f43.google.com with SMTP id 6a1803df08f44-6afbbc87967so24571006d6.2 for <71450@debbugs.gnu.org>; Sun, 09 Jun 2024 14:28:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717968460; x=1718573260; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=Ha864EUr7cuK03oR6ERahNFKaRnhAA3Q5laEd0FiVso=; b=QgyZZC2VPB4Uqh3e5HyaAHo5IbVickwG3JQgKkSlqbOs3OcIbo4Sg2KVdsRPNdJkOz JjKEDQ3jR2C5rF0ZeA0ngjiIWusQZYYkPmTfaeVLzAqNuC+ec46c7Okgvv/Qfs8N4RVB Q3QEs7jFCFtZnl2+kA4ycEsPnqoKMpy+VVaSwznbFSqtdTzZEdgjLZxGqudDiMc1Wgw9 mRbQEZRPxh4dMGp3pAUXHs9yWHqJWagEQjYULFAMPC+w3KyZAuQrfJQRww3OSHCHJI7g DHVIF2tSJPjhtlseWh4witUZ6ra25L6dRx2Ei/Ux/oCanbAb9DYjdy7SMZHM8p0RaaAh SJ5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717968460; x=1718573260; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ha864EUr7cuK03oR6ERahNFKaRnhAA3Q5laEd0FiVso=; b=ZyxDREUsgwfvEjba+Qx9Hk04z954jZojGruK69OsGFC09Jv58wlUGUF9mR+PemuLR2 Y6ME3kzCHK6SL8MBJPzEjwVNecL7LDkL8r70lHvgkVpKKLx5vOF2kelfNvgW/UYGFbJs rHno7XIXicLyFOf/YWq1Q6pYfhWaLBp/QESRE3utb6Yolwd3pDexzhpjdk70gu8L0Bcs YodUDRmHlsqyofjCrrNvPHh0NrkcBT90c0StpG/nRLZ7kQHyagnmhL9VzvyHuEZtzjDF djTx5K5qL3MrdNcDRTkvLyU+NKITHZZFko/2qPgvzoosJDn+wK1Z2xIzS5YLDHTmVTB8 jN3g== X-Forwarded-Encrypted: i=1; AJvYcCXWxH1WI2+KAwIZJQyYlwvyNKOgMMd6LwAseNJTu2tx1tcklfQkjW3+GiemkGeqLu64gfw1b4FfWPZJJ6oHNlpc6kWEtxo= X-Gm-Message-State: AOJu0YyVA4WzBNDp78S1uxkbz00Gd2s+WdHot3shfEcxlYclVSH2Hj9I p7Vk7qtQyhWYY49YMYcq71otZ+lci+hbB5Fb1Hwpte5/Mcxz+RJBNvBt+Q== X-Google-Smtp-Source: AGHT+IG/ItrnMqi+BmBmqdPJZ6VECRYBvzd+mrjRBZr/5h0LA2WnnUxEDbQYcxod9JC8jITVqyxO9w== X-Received: by 2002:a05:6a00:2e9b:b0:704:32f6:8986 with SMTP id d2e1a72fcca58-70432f6ac4amr3002567b3a.17.1717968056936; Sun, 09 Jun 2024 14:20:56 -0700 (PDT) Received: from [192.168.1.2] (syn-023-240-098-037.res.spectrum.com. [23.240.98.37]) by smtp.googlemail.com with ESMTPSA id d2e1a72fcca58-70428c93f30sm2571664b3a.37.2024.06.09.14.20.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 09 Jun 2024 14:20:56 -0700 (PDT) Message-ID: <2fd89234-fab9-a0a3-3bc1-f193983e2cd4@gmail.com> Date: Sun, 9 Jun 2024 14:20:56 -0700 MIME-Version: 1.0 Content-Language: en-US References: <86h6e21f0e.fsf@outlook.com> From: Jim Porter In-Reply-To: <86h6e21f0e.fsf@outlook.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) 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 (-) On 6/9/2024 5:23 AM, James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote: > This is a patch that I think is simple enough to forgo the extensive > testing which it hasn't been subjected to. Thanks for the patch. > + :history-position > + (cl-position > + (elt history eww-history-position) > + rval :test #'eww-desktop-history-duplicate)))) Two questions here: 1. Is that the right test function? I'd have expected 'eq', since we want to find the position where our history index has moved to, right? 2. Should this part check for 'eww-desktop-remove-duplicates' too? If that option is nil, I think we could avoid the 'cl-position' call. Or maybe lift the 'eww-desktop-remove-duplicates' call outside of the 'list' and just construct two totally different lists in the THEN/ELSE blocks. From unknown Tue Jun 17 01:48:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#71450: [PATCH] Wrong eww-history-position after desktop restore if within history Resent-From: James Thomas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Jun 2024 01:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71450 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 71450@debbugs.gnu.org Cc: Jim Porter Received: via spool by 71450-submit@debbugs.gnu.org id=B71450.17179818285640 (code B ref 71450); Mon, 10 Jun 2024 01:11:02 +0000 Received: (at 71450) by debbugs.gnu.org; 10 Jun 2024 01:10:28 +0000 Received: from localhost ([127.0.0.1]:44963 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGTYJ-0001Sn-MT for submit@debbugs.gnu.org; Sun, 09 Jun 2024 21:10:28 -0400 Received: from mout.gmx.net ([212.227.17.21]:54921) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sGSFd-0005zp-Db for 71450@debbugs.gnu.org; Sun, 09 Jun 2024 19:47:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1717976802; x=1718581602; i=jimjoe@gmx.net; bh=wZKpQjavQaTVKOl94YSYJ/SR2jmZrNF4fljMxiRWMro=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=OltwkCoKBjDZx66Ab0t20pZCvCo6X0fSxUWl/64+lWL6lpx8rYJThUsFzQsChEx8 ss+aCy9wUO1PwfWby+WavGM16TwBAuMMIjQlxIRrEJGh8LZjSBzpqWEgack7/+rwu HQmngJQwRtMdzTwk9gYjdo3SOpOF96hPniTAL/VfN60/7lRTu/ILUqfGfvD84peon hdjt4NAArl5RcHahuNgzuIsi3ye6pmNVhDC/sBoNBOeLPDjaQt+oo598OQmgpIfyF 0IQoNX5D8lnToPmllkeu3JGVdfsTfLpl6w94Gf74KbvCByAe4lm8Kha0NPMrFmYHp cNDunb5IBfavvTPGtg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from user-Inspiron-3493 ([42.108.28.97]) by mail.gmx.net (mrgmx104 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MwQXN-1sXQy236ur-00umO6; Mon, 10 Jun 2024 01:34:09 +0200 From: James Thomas In-Reply-To: <2fd89234-fab9-a0a3-3bc1-f193983e2cd4@gmail.com> (Jim Porter's message of "Sun, 9 Jun 2024 14:20:56 -0700") References: <86h6e21f0e.fsf@outlook.com> <2fd89234-fab9-a0a3-3bc1-f193983e2cd4@gmail.com> Date: Mon, 10 Jun 2024 05:03:59 +0530 Message-ID: <86v82h1yjc.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K1:c7o6fvMAEmvzF5/yG2gXT1K2I5DzJQkGC0Jbo9eJsxf03xh5TZD Gp6nvFXHiuuWMym5HARksRpfIUmeCfDnh8Rh3ALCvoAmQCxVezYWWaIJ4wbGuujt6JHQWrd Y7nqPerpaI/MR4n0t9wDrimm1cr6gtUMZnq0MwfwGVvBLFvDFsjgKwLfr32zMulrhOZLq5q LJEySx9bVA3i81ZlvSu6A== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:131nEz3cewM=;2icQXh5hNN77f3kUybReLLcRdx6 5SWXHqjkUxe5M4ZPWF0LrYjLopUMQaEwPCc+7ByIE7qGeKXvuW37Emy9vr03yirm9EY072yoL Yf4FjMXZ/k3HFKOWFAbbcn9Uy92rRYRpIGQQVbmJdg5HQNoppfq5My14/Brgp2hoSlb72iK4G tQrs7EcRnAfdBIgThLwQxYqQUizo2B4kPXcXwzMzF9J1pMwO4/6uaFl+mkJ9itcPSJjhchIIV VVo5tuEErUS9HwhhoNtRqLpcm93Oqe0/irI6Jggk8hb7tTBt2n5an6SxHkEQxexHawF4Qwg3S flCVlHpUKiFsetWWCTMS1PZhi4KShYhcg86A37QE3dlaNXmuk2ixS4hieo7eO2WH/mGb2CwdI 5a52u1QI0BZLkgSfTCsGF23qH+cMbk1PvnAGNJNDtjFy+7tJ4SR3MSDMeW5v/KkZO6Vj9zc03 GSjfKDZNlLZYX2iFMhbp2C3eG4LfmUANsxwPTfvwOBvG8ht9nr5uzGkG3wkSvrI1HIq0qe+lM OMfxH0z7dPSBxtcGJjS9Gj4HPe4i6/X9AjDyRhec+CUQbwDv/HBPrG7ZROzWr8KdiruYSqtTa OW7Hgrw2QRfSLuxcOvlkxZ4STeQF8zxNuWixGc/ExwumZaYboSpVXZiH069ZnQ5y9BX9irMba /Iny6HyyzaGnIQ2Qze1NvnBrD6ujcEgDJB7ZoOKe4HIUnmFeNZSH/y5Uota7GWjoLwGDdw37A 72dj56K968D1oZ0kvTLgELfnojaAM8qfA23pA/EqfEVVVrHk06Idyyf9fQx8bfyTtuTIuK1od J8k6IEmUIi5B/z1bIE9eR0WCKrnI4sZM5mYF291vlHKw8= X-Spam-Score: -0.7 (/) 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.7 (-) --=-=-= Content-Type: text/plain Jim Porter wrote: > On 6/9/2024 5:23 AM, James Thomas via Bug reports for GNU Emacs, the > Swiss army knife of text editors wrote: >> This is a patch that I think is simple enough to forgo the extensive >> testing which it hasn't been subjected to. > > Thanks for the patch. > >> + :history-position >> + (cl-position >> + (elt history eww-history-position) >> + rval :test #'eww-desktop-history-duplicate)))) > > Two questions here: > > 1. Is that the right test function? I'd have expected 'eq', since we > want to find the position where our history index has moved to, right? I'd thought that this would be more robust because it was used for the original removal. But I guess 'eq' would be enough since only succeeding duplicates are removed. > 2. Should this part check for 'eww-desktop-remove-duplicates' too? If > that option is nil, I think we could avoid the 'cl-position' call. Or > maybe lift the 'eww-desktop-remove-duplicates' call outside of the > 'list' and just construct two totally different lists in the THEN/ELSE > blocks. In fact, the following patch was the one with which I got it working originally, before favouring the earlier one for simplicity: --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=alternate.patch Content-Description: Alternate patch Content-Transfer-Encoding: quoted-printable diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 977210e9cc8..98421828bb9 100644 =2D-- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -2755,10 +2755,19 @@ eww-desktop-misc-data :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)))) + (let ((posn eww-history-position) rval) + (list :history + (if eww-desktop-remove-duplicates + (prog1 + (setq + rval (cl-remove-duplicates + history :test #'eww-desktop-history-duplicate)= ) + (setq posn + (cl-position + (elt history eww-history-position) + rval :test #'eww-desktop-history-duplicate))) + history) + :history-position posn)))) (defun eww-restore-desktop (file-name buffer-name misc-data) "Restore an eww buffer from its desktop file record. @@ -2772,7 +2781,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 +2794,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)) --=-=-= Content-Type: text/plain Regards, James --=-=-=-- From unknown Tue Jun 17 01:48:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#71450: [PATCH] Wrong eww-history-position after desktop restore if within history Resent-From: James Thomas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Jun 2024 19:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71450 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 71450@debbugs.gnu.org Cc: Jim Porter Received: via spool by 71450-submit@debbugs.gnu.org id=B71450.17181331472722 (code B ref 71450); Tue, 11 Jun 2024 19:13:01 +0000 Received: (at 71450) by debbugs.gnu.org; 11 Jun 2024 19:12:27 +0000 Received: from localhost ([127.0.0.1]:36248 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sH6uw-0000hq-PF for submit@debbugs.gnu.org; Tue, 11 Jun 2024 15:12:27 -0400 Received: from mout.gmx.net ([212.227.17.21]:48775) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sH6uv-0000ha-8B for 71450@debbugs.gnu.org; Tue, 11 Jun 2024 15:12:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1718133140; x=1718737940; i=jimjoe@gmx.net; bh=ZUIhPKYI1yzvuyi0GnJgZNtZW+MoKBWZSwZU89RKbxg=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=qPfT7e8GFnPXFb2AIwrx4xsRPaCsCO4pXL/lAdEQ1wlJHoHfBOafE/yKKdWUjpZ1 j6L94UlhXS2MURZIc3ejbNQNLz5LNonyTKL9x3mnyFyNuoIEFx4FuvcV1giWzZfe7 C2M5bm9BFU+EX7Ne1gxfkT9NChl1vKoXvYsX4ktdp7d3y5lCXn8WH6m0D8d2MtSKj dfMDBE2b8m/9xS2kVyqgsOeqUmVvGOrhfUkxQdFaDlXCT/iKLVwAJT+c+rMrBIkYD tMFHf9ME+QNfHaIJjUGd0UnmaZllwra+r3RefmkcYCZE0VxkoDY3gthIw+iV14I2f IzQNaViu2oJEYyU6VA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from user-Inspiron-3493 ([117.206.130.35]) by mail.gmx.net (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1M9nxt-1sJnMn1KJp-00BzIe; Mon, 10 Jun 2024 23:36:37 +0200 From: James Thomas In-Reply-To: <2fd89234-fab9-a0a3-3bc1-f193983e2cd4@gmail.com> (Jim Porter's message of "Sun, 9 Jun 2024 14:20:56 -0700") References: <86h6e21f0e.fsf@outlook.com> <2fd89234-fab9-a0a3-3bc1-f193983e2cd4@gmail.com> Date: Tue, 11 Jun 2024 03:06:31 +0530 Message-ID: <86plsobhuo.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K1:8NJGmYdokI1SPbk3zQ0utEwqh8QvOTCsgfsPiaOfX18AGzrPfWK fI33ZBzSpu+s68O8GKYlrDH83NzABiRMDqX2Nl9OOkdYTFA/RoRGRTcr8FfoE81rEUW3CKU wN4CPxIie5YsaONXYv5v8UmneinX8LVjcq1gzEaxN+uGjNydHRdmdGmrY5huYZIl3FFEg0G 9JnRQtQIh5FXrOESBRfUg== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:I7dMtrHhM/Y=;7rIOaAeG8CXf8oYkGXryeom8tK4 kulTnDNU38rC6t1XVbM11JWN0t/Vw/n3nUpd4Tadhcchuq0w0QDa5LV6VhQ4hw4pd0Nix3aQ0 mIYTE8RO9sAyY5wP4q0Ap5NvFbvS+bzWoT42JsYCN9rmBdDQ+WReefOBVsm4dC98P3RpI3Lj+ w0gAL7HfNAph3H2swy8v3Gp/Qwew1xWs0DDnw4s5OyluNogMW4zy+SChP8phzkVYnzMoK8o+C MGoK7/jzh7jmdUBD2lU4m9lKoM8VbCKfMmEzUdc7O8NxiwJgn85HyaFrqx1vLyp0WJdElyxsz mlBYm5dnLk5eWeVHGi4RLJ7osSfRuI87LftxnJbZIk8Okm58XY0bYUZnEMu0fGKQSKijEpMwb stHiNtqx/L5Iu2jrylyk40S1idXuv2GCd59DzsDKSifrX3LZlt2r5jx3qRCNSB+839kjBf4cd BaykE0KUIDls+YFIyWSwhQu5Wp3dM6xytfzlrfAhMq9iZKxjoO54hy/Iytggug+B92gaIPepY lZUdGaQY0zAOPgSJM3DGZGycYO9vtDMDI/j6ArzqHFGJ+DVGnLN4TqQUWe9bJ8FzzdC7aNWnI RDmuTX2ZHpP0G3oFlejmPuwpD8kFkVjbO8QYX6ly3BQZqIFZKI43HTyiYcSQm3Jn+yW7DwAnx UG+1wEG2daAQPMzQ2essgNbLoZWxyskSX0T67MZNBgYg5B99O1/XhZjGzlB4DTe258DZS/Bfp O+d5mIiHLJE4uNERUibNEgBe4yud+fWs8BV3tTVH7Sot9GQy4zBnH3AQfvIC+Qq0CRlkp9psn ON+qowj8CwsbtUu2Ev0tddqHeIs4PFiMV1dFuMw5ULLJE= X-Spam-Score: -0.7 (/) 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.7 (-) --=-=-= Content-Type: text/plain Jim Porter wrote: > On 6/9/2024 5:23 AM, James Thomas via Bug reports for GNU Emacs, the > Swiss army knife of text editors wrote: >> This is a patch that I think is simple enough to forgo the extensive >> testing which it hasn't been subjected to. > > Thanks for the patch. > >> + :history-position >> + (cl-position >> + (elt history eww-history-position) >> + rval :test #'eww-desktop-history-duplicate)))) > > Two questions here: > > 1. Is that the right test function? I'd have expected 'eq', since we > want to find the position where our history index has moved to, right? > > 2. Should this part check for 'eww-desktop-remove-duplicates' too? If > that option is nil, I think we could avoid the 'cl-position' call. Or > maybe lift the 'eww-desktop-remove-duplicates' call outside of the > 'list' and just construct two totally different lists in the THEN/ELSE > blocks. Here's an updated patch, which I've tested somewhat: --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Account-for-duplicate-removal-on-restoring.patch Content-Description: [PATCH] Account for duplicate removal on restoring Content-Transfer-Encoding: quoted-printable =46rom bc0e3f2653e1c4c1f683d4b10ff139dbf963ee8d Mon Sep 17 00:00:00 2001 From: James Thomas Date: Tue, 11 Jun 2024 03:00:33 +0530 Subject: [PATCH] Account for duplicate removal on restoring eww-history-position. * 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 | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/lisp/net/eww.el b/lisp/net/eww.el index 977210e9cc8..fd8f80065b1 100644 =2D-- a/lisp/net/eww.el +++ b/lisp/net/eww.el @@ -2754,11 +2754,20 @@ 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))) + (posn eww-history-position) rval) + (list :history + (if eww-desktop-remove-duplicates + (prog1 + (setq + rval (cl-remove-duplicates + history :test #'eww-desktop-history-duplicate)) + (setq posn + (cl-position + (elt history eww-history-position) + rval :test #'eq))) + history) + :history-position posn))) (defun eww-restore-desktop (file-name buffer-name misc-data) "Restore an eww buffer from its desktop file record. @@ -2772,7 +2781,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 +2794,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 --=-=-= Content-Type: text/plain Regards, James --=-=-=-- From unknown Tue Jun 17 01:48:13 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: James Thomas Subject: bug#71450: closed (Re: bug#71450: [PATCH] Wrong eww-history-position after desktop restore if within history) Message-ID: References: <7c3591c2-be73-06fe-bde1-ac2c4a8bf981@gmail.com> <86h6e21f0e.fsf@outlook.com> X-Gnu-PR-Message: they-closed 71450 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 71450@debbugs.gnu.org Date: Sun, 16 Jun 2024 00:04:01 +0000 Content-Type: multipart/mixed; boundary="----------=_1718496241-7490-1" This is a multi-part message in MIME format... ------------=_1718496241-7490-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #71450: [PATCH] Wrong eww-history-position after desktop restore if within = history which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 71450@debbugs.gnu.org. --=20 71450: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D71450 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1718496241-7490-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 71450-done) by debbugs.gnu.org; 16 Jun 2024 00:03:06 +0000 Received: from localhost ([127.0.0.1]:60872 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sIdMQ-0001um-5E for submit@debbugs.gnu.org; Sat, 15 Jun 2024 20:03:06 -0400 Received: from mail-pf1-f170.google.com ([209.85.210.170]:42369) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sIdMN-0001u8-FI for 71450-done@debbugs.gnu.org; Sat, 15 Jun 2024 20:03:04 -0400 Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-705959a2dfbso2337607b3a.1 for <71450-done@debbugs.gnu.org>; Sat, 15 Jun 2024 17:03:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718496116; x=1719100916; darn=debbugs.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=SlpSD0prl2Tq468eQ5P16Re7EjhsmQuUleyUj7O2yno=; b=Z8EiHLahVn361KaO7UxSafnj21kjnc9K8ys+MabeK8GEcZhnsix4XRx/5rl6b7zcfk CAuHlRgIRcbwPKX8J3SLLKzMF5rvqTtYrQmRjrar6ZksJ0FNRbZLCClqN0Q2/pPzhb3Z b/PC/YAZXMvPINnHaPFIffsw36wXn33yGDIDTb/KzcmilKXInYMLGEjaf31P64hXGv8g bwHhZ5GQN9aTGTc3z8TYdpfuTfBD70GVzH9AUPcJgAq5Jjilmy/tkUxsBYlqT8Ae96KY aKLJN53NGZKbNnt0AZvSI9ix0V+rjdSbvv5I2siI5lUhFWHdjRSL2aPpKdX0+v8VIQ+y ZjvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718496116; x=1719100916; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=SlpSD0prl2Tq468eQ5P16Re7EjhsmQuUleyUj7O2yno=; b=j+zZTOs0RjWCQxSqnJlWG/cqLdtUPaVszrlMqSQPP1beJcOzDusBtuA/4LbkJUnmcs r87/KGDXwal2kp0vJZLl1mND6HCBJ1rkmEGlBG2nMQV50qohSgySGBL55IW8Rv8LiXjm 48oypf03MX0j1z5DGtI3+G1otZlD+3G7rkVwD5uMSvoOgx/eaw1tC89EQa+zq7PHLxps W0T6DtzH/eFtVCVOKVQ/qwcXJnwGotOMC3cDY4SY5TXhJBNYJvb1SVDyieOLfhz8Mlob ULOLk4TIRlP4CxJPYRRP5hMN9sNKHiyiuzmJKrrgl31vmbPpaMf/cYDWuPpLixZ7zJ3z tDjA== X-Forwarded-Encrypted: i=1; AJvYcCXwRy5ThLTfcynrljl1rxaf1yGDzsMJjN/rpevgaUPPG9zE6xPPYQe2pRdWuf0BmzuNUq8w/7Du8cKAaqvQx6JpaDHm0tCak6yCag== X-Gm-Message-State: AOJu0YxjhZLfjwMcZ27zKcdIpWJ3PuqmBcqCCsfk1QLnE66me/qVH5eW BO0VOqwH7yoAze8LGyo9/F9Kp/JuUDlB2HmQabHWq1ASx2ZrWs8X X-Google-Smtp-Source: AGHT+IHShzjCIqyGGGqLEZnTiKXRbnU1FN+haTuSJn/Ai2HHnd1imPw8qs8Kl4NuVBJOtvtoqTrj8g== X-Received: by 2002:a05:6a00:62c6:b0:702:5514:4cb8 with SMTP id d2e1a72fcca58-705c935c4a4mr12532851b3a.4.1718496116288; Sat, 15 Jun 2024 17:01:56 -0700 (PDT) Received: from [192.168.1.2] (syn-023-240-098-037.res.spectrum.com. [23.240.98.37]) by smtp.googlemail.com with ESMTPSA id d2e1a72fcca58-705cc964a5asm5195430b3a.47.2024.06.15.17.01.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 15 Jun 2024 17:01:55 -0700 (PDT) Message-ID: <7c3591c2-be73-06fe-bde1-ac2c4a8bf981@gmail.com> Date: Sat, 15 Jun 2024 17:01:55 -0700 MIME-Version: 1.0 Subject: Re: bug#71450: [PATCH] Wrong eww-history-position after desktop restore if within history Content-Language: en-US To: James Thomas , 71450-done@debbugs.gnu.org References: <86h6e21f0e.fsf@outlook.com> <2fd89234-fab9-a0a3-3bc1-f193983e2cd4@gmail.com> <86plsobhuo.fsf@gmx.net> From: Jim Porter In-Reply-To: <86plsobhuo.fsf@gmx.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 71450-done 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 (-) On 6/10/2024 2:36 PM, James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors wrote: > Here's an updated patch, which I've tested somewhat: Thanks, this looks good to me, so I've merged it as 65b7f87a31d. Closing this bug now. ------------=_1718496241-7490-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 9 Jun 2024 12:40:54 +0000 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 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 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 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 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 From: James Thomas To: bug-gnu-emacs@gnu.org Subject: [PATCH] Wrong eww-history-position after desktop restore if within history X-Debbugs-CC: jporterbugs@gmail.com Date: Sun, 09 Jun 2024 17:53:29 +0530 Message-ID: <86h6e21f0e.fsf@outlook.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K1:8b33xqQ11Jy4UJqpDXjfPw1XPPHFjZR1DhvpSQJQq04PPS+Y1z1 reKicNd4yjZQJDK0IILYSpeJTmmqvmgE1VQi7hvubdyt5TS1zndyNsaTQXNG2YhH2rawINu I2/wWWiacFRUIcIijS9dE6Jitz+J85cIf8CIAtKHzQRS1jjEi1BbJD65sFQQY6JqHmA7NLd b9Dv8nHQ5q8PDtC3RG9UQ== X-Spam-Flag: NO 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/FIZjeDk59D5JRoRRFcP0ZGGKfy1t MIvmNhhie2e8Cy017vrVJZxdnMQ2j6DGY1uggAP0Mwbb8= 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-Spam-Score: 0.7 (/) 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 - 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 --=-=-=-- ------------=_1718496241-7490-1--