GNU bug report logs - #62413
29.0.60; [PATCH] save-place-mode cannot restore saved position

Previous Next

Package: emacs;

Reported by: Liu Hui <liuhui1610 <at> gmail.com>

Date: Fri, 24 Mar 2023 04:10:02 UTC

Severity: normal

Tags: patch

Found in version 29.0.60

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #32 received at 62413 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Liu Hui <liuhui1610 <at> gmail.com>
Cc: 62413 <at> debbugs.gnu.org
Subject: Re: bug#62413: 29.0.60;
 [PATCH] save-place-mode cannot restore saved position
Date: Thu, 30 Mar 2023 08:34:03 +0300
> From: Liu Hui <liuhui1610 <at> gmail.com>
> Date: Thu, 30 Mar 2023 10:49:39 +0800
> Cc: 62413 <at> debbugs.gnu.org
> 
> Eli Zaretskii <eliz <at> gnu.org> 于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?




This bug report was last modified 2 years and 107 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.