From: Karl Fogel Date: Tue, 4 Dec 2007 06:11:29 +0000 (+0000) Subject: * lisp/saveplace.el (save-place-alist-to-file): Save with 'emacs-mule' X-Git-Tag: emacs-pretest-22.1.90~288 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6054cc87fea83446831be2aad8048ddd1d4402b4;p=emacs.git * 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. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 430d7d2b00d..1535a87904a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2007-12-04 Karl Fogel + + * 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 * wid-edit.el (widget-type): Doc fix. 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)))))