diff options
| author | Kenichi Handa | 2005-04-22 05:38:29 +0000 |
|---|---|---|
| committer | Kenichi Handa | 2005-04-22 05:38:29 +0000 |
| commit | 8dde0e95d48e3c59ecc8b04a54291261222faeaf (patch) | |
| tree | 1748bcd3054abc671a577fc07ec89880d248adbd | |
| parent | 230e1e802685eb8c3430ebc2cf765a60a09fd3ce (diff) | |
| download | emacs-8dde0e95d48e3c59ecc8b04a54291261222faeaf.tar.gz emacs-8dde0e95d48e3c59ecc8b04a54291261222faeaf.zip | |
(recentf-save-file-coding-system): New variable.
(recentf-save-list): Encode the file by
recentf-save-file-coding-system and add coding: tag.
| -rw-r--r-- | lisp/recentf.el | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lisp/recentf.el b/lisp/recentf.el index 40a9204267e..cf61b688eb5 100644 --- a/lisp/recentf.el +++ b/lisp/recentf.el | |||
| @@ -1137,6 +1137,12 @@ default." | |||
| 1137 | ";;; Automatically generated by `recentf' on %s.\n" | 1137 | ";;; Automatically generated by `recentf' on %s.\n" |
| 1138 | "Header to be written into the `recentf-save-file'.") | 1138 | "Header to be written into the `recentf-save-file'.") |
| 1139 | 1139 | ||
| 1140 | (defconst recentf-save-file-coding-system | ||
| 1141 | (if (coding-system-p 'utf-8-emacs) | ||
| 1142 | 'utf-8-emacs | ||
| 1143 | 'emacs-mule) | ||
| 1144 | "Coding system of the file `recentf-save-file'.") | ||
| 1145 | |||
| 1140 | (defun recentf-save-list () | 1146 | (defun recentf-save-list () |
| 1141 | "Save the recent list. | 1147 | "Save the recent list. |
| 1142 | Write data into the file specified by `recentf-save-file'." | 1148 | Write data into the file specified by `recentf-save-file'." |
| @@ -1144,9 +1150,13 @@ Write data into the file specified by `recentf-save-file'." | |||
| 1144 | (condition-case error | 1150 | (condition-case error |
| 1145 | (with-temp-buffer | 1151 | (with-temp-buffer |
| 1146 | (erase-buffer) | 1152 | (erase-buffer) |
| 1153 | (set-buffer-file-coding-system recentf-save-file-coding-system) | ||
| 1147 | (insert (format recentf-save-file-header (current-time-string))) | 1154 | (insert (format recentf-save-file-header (current-time-string))) |
| 1148 | (recentf-dump-variable 'recentf-list recentf-max-saved-items) | 1155 | (recentf-dump-variable 'recentf-list recentf-max-saved-items) |
| 1149 | (recentf-dump-variable 'recentf-filter-changer-state) | 1156 | (recentf-dump-variable 'recentf-filter-changer-state) |
| 1157 | (insert "\n\n;;; Local Variables:\n" | ||
| 1158 | (format ";;; coding: %s\n" recentf-save-file-coding-system) | ||
| 1159 | ";;; End:\n") | ||
| 1150 | (write-file (expand-file-name recentf-save-file)) | 1160 | (write-file (expand-file-name recentf-save-file)) |
| 1151 | nil) | 1161 | nil) |
| 1152 | (error | 1162 | (error |
| @@ -1207,6 +1217,6 @@ that were operated on recently." | |||
| 1207 | (provide 'recentf) | 1217 | (provide 'recentf) |
| 1208 | 1218 | ||
| 1209 | (run-hooks 'recentf-load-hook) | 1219 | (run-hooks 'recentf-load-hook) |
| 1210 | 1220 | ||
| 1211 | ;;; arch-tag: 78f1eec9-0d16-4d19-a4eb-2e4529edb62a | 1221 | ;;; arch-tag: 78f1eec9-0d16-4d19-a4eb-2e4529edb62a |
| 1212 | ;;; recentf.el ends here | 1222 | ;;; recentf.el ends here |