From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#62413: 29.0.60; [PATCH] save-place-mode cannot restore saved position Date: Sun, 26 Mar 2023 08:20:48 +0300 Message-ID: <83zg809jgv.fsf@gnu.org> References: <83tty9caku.fsf@gnu.org> <83y1nkc3vc.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3150"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 62413@debbugs.gnu.org To: Liu Hui Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Mar 26 07:21:23 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 1pgIoj-0000W0-N6 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 26 Mar 2023 07:21:21 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pgIoT-0006lL-2k; Sun, 26 Mar 2023 01:21:05 -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 1pgIoR-0006kp-DM for bug-gnu-emacs@gnu.org; Sun, 26 Mar 2023 01:21:03 -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 1pgIoQ-0005hf-Pg for bug-gnu-emacs@gnu.org; Sun, 26 Mar 2023 01:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pgIoQ-0001Co-9r for bug-gnu-emacs@gnu.org; Sun, 26 Mar 2023 01:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 26 Mar 2023 05:21: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.16798080584602 (code B ref 62413); Sun, 26 Mar 2023 05:21:02 +0000 Original-Received: (at 62413) by debbugs.gnu.org; 26 Mar 2023 05:20:58 +0000 Original-Received: from localhost ([127.0.0.1]:43844 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pgIoM-0001CA-4E for submit@debbugs.gnu.org; Sun, 26 Mar 2023 01:20:58 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52212) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pgIoJ-0001Bq-Kt for 62413@debbugs.gnu.org; Sun, 26 Mar 2023 01:20:56 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pgIoE-0005Xo-2V; Sun, 26 Mar 2023 01:20:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=UAMwOH4bxOvurpCWdcK5Ej90wEkIgjP1jSbIFXAr/Wg=; b=F4woGbVNwkUx 3xhstl2ALMV+XEPYiKVCnXuoCphK4cCIaFN/9BkIQj7WmJwPPuEtlmLkba/X/fejyrNu/K4niEj1f uWXgZSmdvSleFXd+9sNA77dmEPzlHzuyY+ivj9DRowXZ8hut080NAi8sc6LWfS0GVQAET8IAf2YTW lMVsiK2IqiLiOaZKDb2/uGt1Q82qfxTKEP8sSkMPy7Dx0zTAdDxdhkl3URFBZv0L+pyA0WgQc2rM4 Jhn3qPU9g32UWemjTXKauHz0WTVjlLtQ99+2Z1TxuNMACYfIPp1cn/k9kkImuC4w2qbr52gERvs4H Sw92S7dQwaEv9cVIzkPUAg==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pgIoD-0008UJ-7E; Sun, 26 Mar 2023 01:20:49 -0400 In-Reply-To: (message from Liu Hui on Sun, 26 Mar 2023 09:26:22 +0800) 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:258654 Archived-At: > From: Liu Hui > Date: Sun, 26 Mar 2023 09:26:22 +0800 > Cc: 62413@debbugs.gnu.org > > > But now testing save-place-abbreviate-file-names here should be > > redundant, right? > > > > Also, I think we should first test buffer-file-name, and only after > > that its abbreviated variant. > > I don't think so. Consider the following case: > > - open file A and then close the buffer: > (buffer-file-name . position1) is saved in save-place-alist > > - then set save-place-abbreviate-file-names to t > > - open file A, scroll the buffer and close it: > (abbreviated-file-name . position2) is saved > > - open file A again, and the point will be at position1 if > buffer-file-name is tested first. But I would expect the point is at > position2. 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.