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: Thu, 30 Mar 2023 08:34:03 +0300 Message-ID: <83v8ii6bw4.fsf@gnu.org> 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: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22476"; 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 Thu Mar 30 07:35:15 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 1phkwM-0005di-VS for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 30 Mar 2023 07:35:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1phkwE-0000d0-35; Thu, 30 Mar 2023 01:35:06 -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 1phkwB-0000ce-Pr for bug-gnu-emacs@gnu.org; Thu, 30 Mar 2023 01:35: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 1phkwA-0000zK-HL for bug-gnu-emacs@gnu.org; Thu, 30 Mar 2023 01:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1phkwA-0003Yb-8Q for bug-gnu-emacs@gnu.org; Thu, 30 Mar 2023 01:35: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: Thu, 30 Mar 2023 05:35: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.168015444213561 (code B ref 62413); Thu, 30 Mar 2023 05:35:02 +0000 Original-Received: (at 62413) by debbugs.gnu.org; 30 Mar 2023 05:34:02 +0000 Original-Received: from localhost ([127.0.0.1]:55423 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1phkvB-0003WQ-GG for submit@debbugs.gnu.org; Thu, 30 Mar 2023 01:34:01 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:56270) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1phkvA-0003WC-45 for 62413@debbugs.gnu.org; Thu, 30 Mar 2023 01:34:00 -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 1phkv4-0000jk-Nt; Thu, 30 Mar 2023 01:33:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=BtKWi5II4G8k/FasC5M42+7aRidLamdC6ZpPy7GtFr8=; b=DE1k1XTvgewprPfPyDN5 qa3rcpq8xYhcw4lOeNPpSQFUOkB9bb2kVPf0ZxDQ2ThKKx6TQ5f/p0pIEDw5YWYD6AbB5iWq8B+AW 2MUWlolr/jeW7N1oFQ2EZvvc9469scTMNUyHizuHS112FtmQplgJqS1ofvrSR3hg786/T9Bp8XYVl HIRKpuqH3j0SjRcbDW0LwGcPpZAy3aoGq8aUy7Tx0DFPXl9mT9ztj+biB4Lh0rCQpoACk2yWoexLU vhXhHDI4T1widLHzI7ca+sG1Tn3+Wkd1PRfWDQaNPPMsHRck55S+CzTGSsqV/tcgHGgfXe8Q5Nh8X pKjjQgvO28779w==; 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 1phkv2-0002mg-GT; Thu, 30 Mar 2023 01:33:54 -0400 In-Reply-To: (message from Liu Hui on Thu, 30 Mar 2023 10:49:39 +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:258885 Archived-At: > From: Liu Hui > Date: Thu, 30 Mar 2023 10:49:39 +0800 > Cc: 62413@debbugs.gnu.org > > Eli Zaretskii 于2023年3月28日周二 20:03写道: > > > > > 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? I think there's a cleaner way: a defcustom can have a :set function, which is called each time the variable is customized; this setter function should be defined for a defcustom when changing its value has non-trivial effects. So we can define such a setter function to rewrite the list, and document in the doc string of the defcustom that users should not just set the value with setq, but instead use either setopt or "M-x customize-variable". WDYT?