changeset 79535:a84f960614b0

* lisp/saveplace.el (save-place-alist-to-file): Save with 'emacs-mule' coding system. This ports revisions 1.40 and 1.41 over to the EMACS_22_BASE branch, but with the right coding system for Emacs 22 to reliably record filenames. Suggested by Eli Zaretskii.
author Karl Fogel <kfogel@red-bean.com>
date Tue, 04 Dec 2007 06:11:29 +0000
parents 959d0d7f4eb1
children 6cde1f3c5f31
files lisp/ChangeLog lisp/saveplace.el
diffstat 2 files changed, 12 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Mon Dec 03 00:41:15 2007 +0000
+++ b/lisp/ChangeLog	Tue Dec 04 06:11:29 2007 +0000
@@ -1,3 +1,10 @@
+2007-12-04  Karl Fogel  <kfogel@red-bean.com>
+
+	* saveplace.el (save-place-alist-to-file): Save with 'emacs-mule'
+	coding system.  This ports revisions 1.40 and 1.41 over to the
+	EMACS_22_BASE branch, but with the right coding system for Emacs
+	22 to reliably record filenames.  Suggested by Eli Zaretskii.
+
 2007-12-01  Richard Stallman  <rms@gnu.org>
 
 	* wid-edit.el (widget-type): Doc fix.
--- a/lisp/saveplace.el	Mon Dec 03 00:41:15 2007 +0000
+++ b/lisp/saveplace.el	Tue Dec 04 06:11:29 2007 +0000
@@ -205,13 +205,16 @@
       (setq save-place-alist (cdr save-place-alist)))))
 
 (defun save-place-alist-to-file ()
-  (let ((file (expand-file-name save-place-file)))
+  (let ((file (expand-file-name save-place-file))
+        (coding-system-for-write 'emacs-mule))
     (save-excursion
       (message "Saving places to %s..." file)
       (set-buffer (get-buffer-create " *Saved Places*"))
       (delete-region (point-min) (point-max))
       (when save-place-forget-unreadable-files
 	(save-place-forget-unreadable-files))
+      (insert (format ";;; -*- coding: %s -*-\n"
+                      (symbol-name coding-system-for-write)))
       (let ((print-length nil)
             (print-level nil))
         (print save-place-alist (current-buffer)))
@@ -224,7 +227,7 @@
                t))))
 	(condition-case nil
 	    ;; Don't use write-file; we don't want this buffer to visit it.
-	    (write-region (point-min) (point-max) file)
+            (write-region (point-min) (point-max) file)
 	  (file-error (message "Can't write %s" file)))
         (kill-buffer (current-buffer))
         (message "Saving places to %s...done" file)))))