summaryrefslogtreecommitdiff
path: root/lisp/saveplace.el
diff options
context:
space:
mode:
authorKarl Fogel <kfogel@red-bean.com>2007-12-04 06:11:29 +0000
committerKarl Fogel <kfogel@red-bean.com>2007-12-04 06:11:29 +0000
commit6054cc87fea83446831be2aad8048ddd1d4402b4 (patch)
tree209b2fd2eb1c20a5e6d8857b5139f6778ba740dc /lisp/saveplace.el
parent0277bfa1a48855f8d79b2f05a026d5763d9b495c (diff)
downloademacs-6054cc87fea83446831be2aad8048ddd1d4402b4.tar.gz
* lisp/saveplace.el (save-place-alist-to-file): Save with 'emacs-mule'
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.
Diffstat (limited to 'lisp/saveplace.el')
-rw-r--r--lisp/saveplace.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/saveplace.el b/lisp/saveplace.el
index b6f3a76ff23..46bddb06f88 100644
--- a/lisp/saveplace.el
+++ b/lisp/saveplace.el
@@ -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)))))