From 468b699e3123c008d8a5bd050c1efc3ad926b198 Mon Sep 17 00:00:00 2001 From: Liu Hui Date: Fri, 24 Mar 2023 10:08:12 +0800 Subject: [PATCH] Restore positions for abbreviated file names in saveplace.el * lisp/saveplace.el (save-place-find-file-hook): Use abbreviated file name when `save-place-abbreviate-file-names' is non-nil. --- lisp/saveplace.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lisp/saveplace.el b/lisp/saveplace.el index 7512fc87c5d..5262f574efc 100644 --- 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))) (if cell (progn (or revert-buffer-in-progress-p -- 2.25.1