GNU bug report logs -
#62413
29.0.60; [PATCH] save-place-mode cannot restore saved position
Previous Next
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 #17 received at 62413 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> gnu.org> 于2023年3月25日周六 22:17写道:
> > lisp/saveplace.el | 9 ++++++++-
> > 1 file changed, 8 insertions(+), 1 deletion(-)
> >
> > diff --git a/lisp/saveplace.el b/lisp/saveplace.el
> > index 7512fc87c5d..6c3ed34f198 100644
> > --- a/lisp/saveplace.el
> > +++ b/lisp/saveplace.el
> > @@ -353,7 +353,14 @@ save-place-find-file-hook
> > "Function added to `find-file-hook' by `save-place-mode'.
> > It runs the hook `save-place-after-find-file-hook'."
> > (or save-place-loaded (save-place-load-alist-from-file))
> > - (let ((cell (assoc buffer-file-name save-place-alist)))
> > + (let ((cell (and (stringp buffer-file-name)
> > + (if save-place-abbreviate-file-names
> > + (or (assoc (abbreviate-file-name buffer-file-name)
> > + save-place-alist)
> > + (assoc buffer-file-name save-place-alist))
> > + (or (assoc buffer-file-name save-place-alist)
> > + (assoc (abbreviate-file-name buffer-file-name)
> > + save-place-alist))))))
> > (if cell
>
> 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.
This bug report was last modified 2 years and 106 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.