unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Liu Hui <liuhui1610@gmail.com>
Cc: 62413@debbugs.gnu.org
Subject: bug#62413: 29.0.60; [PATCH] save-place-mode cannot restore saved position
Date: Thu, 30 Mar 2023 08:34:03 +0300	[thread overview]
Message-ID: <83v8ii6bw4.fsf@gnu.org> (raw)
In-Reply-To: <CAOQTW-OiHvB0CC9qNmv7yG+rD+SRrscxWPu=eThe5hn8=NOVMg@mail.gmail.com> (message from Liu Hui on Thu, 30 Mar 2023 10:49:39 +0800)

> From: Liu Hui <liuhui1610@gmail.com>
> Date: Thu, 30 Mar 2023 10:49:39 +0800
> Cc: 62413@debbugs.gnu.org
> 
> Eli Zaretskii <eliz@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?





  reply	other threads:[~2023-03-30  5:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-24  2:19 bug#62413: 29.0.60; [PATCH] save-place-mode cannot restore saved position Liu Hui
2023-03-25 11:52 ` Eli Zaretskii
2023-03-25 14:14   ` Liu Hui
2023-03-25 14:17     ` Eli Zaretskii
2023-03-26  1:26       ` Liu Hui
2023-03-26  5:20         ` Eli Zaretskii
2023-03-28  5:56           ` Liu Hui
2023-03-28 12:03             ` Eli Zaretskii
2023-03-30  2:49               ` Liu Hui
2023-03-30  5:34                 ` Eli Zaretskii [this message]
2023-04-03  1:02                   ` Liu Hui
2023-04-03  2:45                     ` Ruijie Yu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-04-04  1:37                       ` Liu Hui
2023-04-06 10:27                         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83v8ii6bw4.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=62413@debbugs.gnu.org \
    --cc=liuhui1610@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).