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 #14 received at 62413 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
在 2023/3/25 19:52, Eli Zaretskii 写道:
>> --- a/lisp/saveplace.el
>> +++ b/lisp/saveplace.el
>> @@ -353,8 +353,11 @@ 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* ((item (if (and (stringp buffer-file-name)
>> + save-place-abbreviate-file-names)
>> + (abbreviate-file-name buffer-file-name)
>> + buffer-file-name))
>> + (cell (assoc item save-place-alist)))
>
> Wouldn't it be best to always test for abbreviated file name if the
> full file name fails to match? E.g., it could be that the user turned
> on save-place-abbreviate-file-names for a while, then turned it off
> (or vice versa), thus causing mixed file names in the saved history.
> It would also make the code simpler, I think.
I agree that it is better to consider mixed file names. Please see the
updated patch.
[0001-Restore-positions-for-abbreviated-file-names-in-save.patch (application/x-patch, attachment)]
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.