]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix saveplace.el when desktop.el restores non-ASCII buffers
authorEli Zaretskii <eliz@gnu.org>
Mon, 23 May 2022 13:32:47 +0000 (16:32 +0300)
committerEli Zaretskii <eliz@gnu.org>
Mon, 23 May 2022 13:32:47 +0000 (16:32 +0300)
* lisp/saveplace.el (load-save-place-alist-from-file): Bind
'coding-system-for-read' to nil, so that the 'coding:' cookie in
the save-place file takes effect.  (Bug#55592)

lisp/saveplace.el

index 4d13ad3959ceb7d46d3b1028ae9f3bf245ed8abf..a23454b0bb4d94fac114cffab4be5a13302317eb 100644 (file)
@@ -290,7 +290,11 @@ may have changed) back to `save-place-alist'."
               ;; adding hooks to it.
               (with-current-buffer (get-buffer-create " *Saved Places*")
                 (delete-region (point-min) (point-max))
-                (insert-file-contents file)
+                ;; Make sure our 'coding:' cookie in the save-place
+                ;; file will take effect, in case the caller binds
+                ;; coding-system-for-read.
+                (let (coding-system-for-read)
+                  (insert-file-contents file))
                 (goto-char (point-min))
                 (setq save-place-alist
                       (with-demoted-errors "Error reading save-place-file: %S"