]> code.delx.au - gnu-emacs/commitdiff
* lisp/saveplace.el (save-place-alist-to-file): Save with 'emacs-mule'
authorKarl Fogel <kfogel@red-bean.com>
Tue, 4 Dec 2007 06:11:29 +0000 (06:11 +0000)
committerKarl Fogel <kfogel@red-bean.com>
Tue, 4 Dec 2007 06:11:29 +0000 (06:11 +0000)
  coding system.  This ports 2007-12-02T21:15:22Z!kfogel@red-bean.com and 2007-12-02T21:24:38Z!kfogel@red-bean.com over to the
  EMACS_22_BASE branch, but with the right coding system for Emacs 22
  to reliably record filenames.  Suggested by Eli Zaretskii.

lisp/ChangeLog
lisp/saveplace.el

index 430d7d2b00d3e146e478ea0525cac20d7855a1c1..1535a87904a1f095ada0079c30fc43c7d5a4ae40 100644 (file)
@@ -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.
index b6f3a76ff232f1fe3a20b8c1e6c600f511feee31..46bddb06f88580da53bb8efc1296c5ee7287893e 100644 (file)
@@ -205,13 +205,16 @@ may have changed\) back to `save-place-alist'."
       (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 @@ may have changed\) back to `save-place-alist'."
                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)))))