# HG changeset patch # User Karl Fogel # Date 1196630122 0 # Node ID 783469dd1f732bbbe87528eba405a6698023f368 # Parent 8912b1520b335a41409897ca374c282056d809e3 * 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 -r 8912b1520b33 -r 783469dd1f73 lisp/ChangeLog --- a/lisp/ChangeLog Sun Dec 02 21:04:10 2007 +0000 +++ b/lisp/ChangeLog Sun Dec 02 21:15:22 2007 +0000 @@ -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 -r 8912b1520b33 -r 783469dd1f73 lisp/saveplace.el --- a/lisp/saveplace.el Sun Dec 02 21:04:10 2007 +0000 +++ b/lisp/saveplace.el Sun Dec 02 21:15:22 2007 +0000 @@ -217,6 +217,7 @@ (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 @@ 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