From: Karl Fogel Date: Sun, 2 Dec 2007 21:15:22 +0000 (+0000) Subject: * lisp/saveplace.el (save-place-alist-to-file): Use `utf-8' coding system X-Git-Tag: emacs-pretest-23.0.90~9138 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=82115f7bfc24642253a919ec73cb3a3b19335dab;p=emacs.git * lisp/saveplace.el (save-place-alist-to-file): Use `utf-8' coding system when writing, and set it in the first-line file variables. Based on a patch by David Reitter and a suggestion by Juanma Barranquero. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 54d2762f451..8aae3ac681f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2007-12-02 Karl Fogel + + * saveplace.el (save-place-alist-to-file): Use `utf-8' coding + system when writing, and set it in the first-line file variables. + Based on a patch by David Reitter + and a suggestion by Juanma Barranquero. + 2007-12-02 Glenn Morris * emulation/viper-cmd.el (top-level): Don't require advice. diff --git a/lisp/saveplace.el b/lisp/saveplace.el index f39a0776ca4..356963b8ba1 100644 --- a/lisp/saveplace.el +++ b/lisp/saveplace.el @@ -217,6 +217,7 @@ may have changed\) back to `save-place-alist'." (delete-region (point-min) (point-max)) (when save-place-forget-unreadable-files (save-place-forget-unreadable-files)) + (insert ";;; -*- coding: utf-8 -*-\n") (let ((print-length nil) (print-level nil)) (print save-place-alist (current-buffer))) @@ -229,7 +230,8 @@ 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) + (let ((coding-system-for-write 'utf-8)) + (write-region (point-min) (point-max) file)) (file-error (message "Can't write %s" file))) (kill-buffer (current-buffer)) (unless save-place-quiet