From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Liu Hui Newsgroups: gmane.emacs.bugs Subject: bug#62413: 29.0.60; [PATCH] save-place-mode cannot restore saved position Date: Thu, 30 Mar 2023 10:49:39 +0800 Message-ID: References: <83tty9caku.fsf@gnu.org> <83y1nkc3vc.fsf@gnu.org> <83zg809jgv.fsf@gnu.org> <83cz4t84mv.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23064"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 62413@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Mar 30 04:50:28 2023 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 1phiMu-0005mm-61 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 30 Mar 2023 04:50:28 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1phiMb-0000Tu-09; Wed, 29 Mar 2023 22:50:09 -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 1phiMW-0000TY-4v for bug-gnu-emacs@gnu.org; Wed, 29 Mar 2023 22:50:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1phiMV-0003MZ-Kj for bug-gnu-emacs@gnu.org; Wed, 29 Mar 2023 22:50:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1phiMU-0007Sl-Rx for bug-gnu-emacs@gnu.org; Wed, 29 Mar 2023 22:50:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Liu Hui Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 30 Mar 2023 02:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62413 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 62413-submit@debbugs.gnu.org id=B62413.168014459928670 (code B ref 62413); Thu, 30 Mar 2023 02:50:02 +0000 Original-Received: (at 62413) by debbugs.gnu.org; 30 Mar 2023 02:49:59 +0000 Original-Received: from localhost ([127.0.0.1]:55338 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1phiMQ-0007SL-Lz for submit@debbugs.gnu.org; Wed, 29 Mar 2023 22:49:58 -0400 Original-Received: from mail-ot1-f41.google.com ([209.85.210.41]:33529) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1phiMO-0007S8-Ba for 62413@debbugs.gnu.org; Wed, 29 Mar 2023 22:49:56 -0400 Original-Received: by mail-ot1-f41.google.com with SMTP id cm7-20020a056830650700b006a11f365d13so8017213otb.0 for <62413@debbugs.gnu.org>; Wed, 29 Mar 2023 19:49:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680144590; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Pkm1QYA9oTjvzyG+9I0OSkU8mV4+KjDMkHx/gWbj/cw=; b=pMDdMArVHu1EciCPvvmOZ7TMyCLjIGJCEFW9GC/rMarx2ty9vgq2wGagifnhh8brVF xsqgZnqyvetMkAEGdCz/di3yXl11I22xQsvJmVP49xjTUUzcEdNQyt3ufTOpRRLvQqzy klPu0HAfpfc3T7uN6MDpreDW637JV77Wd3GSIOauizYe+HppbaElBs8d+aYmH3ch1BCV 71qHdL0FvGBB93aybSWG0KFpnu3Xs9iZxxPpmnVhwf9gdH2DTYc2+iG5ta+fJ8brDYTv ASOCaqfqYu+kLcx8Uk/iH/dU20ICXd0TlJ2d6H4K4CoZYEcBomt7M/3Ju0oPT8AQsr7f HMEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680144590; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Pkm1QYA9oTjvzyG+9I0OSkU8mV4+KjDMkHx/gWbj/cw=; b=4txBOJkeEMHm08fsP0RR88cQT77RTe4wF9ACWlZrukwy72Y1mpPS74i8Wm+21i/RMu GjeyU9B2NpfAZvuh12Hf1dKWY/SNI4dyqBWRor91m9xILNVizKt/dC36Arj9TpqwyTKX sHvhXrx0Ww/pSwii4vSJklaxzBta2dfARuMx8ffinGJ3Alc1OXaY+mJvdfEGubuIl1Ke qQu6XXDTNOdfQnG89Plutri8gpkwuPzJkSfNgutGjqHtcTaOeurINmi3GH3j8j9/JC3a Xf4zcEPL2EXAtp9tJR5NyPzsXysR2ZtGROX08jf7BY2fLezea7aKELO5IoKvvlRkB0fk L+0A== X-Gm-Message-State: AAQBX9cJ+usxLhMRN9thl9Fu4uhyDL1qx/TKoFkrlWs02lFFZ2KphFvY 5jnvOnd+PsMJFi1YosJEkPtQMbE3dTw8rgq3HbeTjArpi1mN41ZK X-Google-Smtp-Source: AK7set+K+5Flc+qnkmbpUm6bM61I9N9UD3p6k/T+f+ohOtbZG5ZTSMyTeh45KjbSqWtWGPa19amCRwI64kifi5JAc/A= X-Received: by 2002:a9d:4b16:0:b0:69e:4f9:851d with SMTP id q22-20020a9d4b16000000b0069e04f9851dmr6643257otf.6.1680144590675; Wed, 29 Mar 2023 19:49:50 -0700 (PDT) In-Reply-To: <83cz4t84mv.fsf@gnu.org> 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:258879 Archived-At: Eli Zaretskii =E4=BA=8E2023=E5=B9=B43=E6=9C=8828=E6=97=A5=E5= =91=A8=E4=BA=8C 20:03=E5=86=99=E9=81=93=EF=BC=9A > > > From: Liu Hui > > Date: Tue, 28 Mar 2023 13:56:05 +0800 > > Cc: 62413@debbugs.gnu.org > > > > Eli Zaretskii =E4=BA=8E2023=E5=B9=B43=E6=9C=8826=E6=97= =A5=E5=91=A8=E6=97=A5 13:20=E5=86=99=E9=81=93=EF=BC=9A > > > > > Ugh! This feature was not thought out well enough when it was > > > introduced: if the user changes the value half-way through a session, > > > the history will record visited files twice, under 2 different > > > file-name formats and with different places recorded. I think > > > changing the value of save-place-abbreviate-file-names should rewrite > > > the entire alist in the selected format. > > > > I agree that it is better to avoid mixed file name formats, and then > > save-place-find-file-hook can be fixed simply. The difficult part is > > how to rewrite save-place-alist automatically. > > Isn't it just a matter of going through the list and calling > abbreviate-file-name on each file name there? The conversion itself is easy. But users can change the value of save-place-abbreviate-file-names anytime. To make sure the list is always consistent with save-place-abbreviate-file-names, I think an internal variable is needed to record the old value. If they are different when save-place-to-alist is called, we rewrite the list. Is it OK?