aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorKenichi Handa <[email protected]>2005-04-22 05:38:29 +0000
committerKenichi Handa <[email protected]>2005-04-22 05:38:29 +0000
commit8dde0e95d48e3c59ecc8b04a54291261222faeaf (patch)
tree1748bcd3054abc671a577fc07ec89880d248adbd /lisp
parent230e1e802685eb8c3430ebc2cf765a60a09fd3ce (diff)
(recentf-save-file-coding-system): New variable.
(recentf-save-list): Encode the file by recentf-save-file-coding-system and add coding: tag.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/recentf.el12
1 files changed, 11 insertions, 1 deletions
diff --git a/lisp/recentf.el b/lisp/recentf.el
index 40a9204267..cf61b688eb 100644
--- a/lisp/recentf.el
+++ b/lisp/recentf.el
@@ -1137,6 +1137,12 @@ default."
";;; Automatically generated by `recentf' on %s.\n"
"Header to be written into the `recentf-save-file'.")
+(defconst recentf-save-file-coding-system
+ (if (coding-system-p 'utf-8-emacs)
+ 'utf-8-emacs
+ 'emacs-mule)
+ "Coding system of the file `recentf-save-file'.")
+
(defun recentf-save-list ()
"Save the recent list.
Write data into the file specified by `recentf-save-file'."
@@ -1144,9 +1150,13 @@ Write data into the file specified by `recentf-save-file'."
(condition-case error
(with-temp-buffer
(erase-buffer)
+ (set-buffer-file-coding-system recentf-save-file-coding-system)
(insert (format recentf-save-file-header (current-time-string)))
(recentf-dump-variable 'recentf-list recentf-max-saved-items)
(recentf-dump-variable 'recentf-filter-changer-state)
+ (insert "\n \n;;; Local Variables:\n"
+ (format ";;; coding: %s\n" recentf-save-file-coding-system)
+ ";;; End:\n")
(write-file (expand-file-name recentf-save-file))
nil)
(error
@@ -1207,6 +1217,6 @@ that were operated on recently."
(provide 'recentf)
(run-hooks 'recentf-load-hook)
-
+
;;; arch-tag: 78f1eec9-0d16-4d19-a4eb-2e4529edb62a
;;; recentf.el ends here