summaryrefslogtreecommitdiff
path: root/lisp/recentf.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2004-04-20 20:54:53 +0000
committerRichard M. Stallman <rms@gnu.org>2004-04-20 20:54:53 +0000
commit5a50b2f5c56848a71a8acd9251d84d7357b886ed (patch)
tree1d3ba80f42e2532500df60c25c7557e28a52bca3 /lisp/recentf.el
parentd51ea4487902be4bb0eaf297aa1f08a1a1e92353 (diff)
downloademacs-5a50b2f5c56848a71a8acd9251d84d7357b886ed.tar.gz
(recentf-save-list): Catch and warn about errors.
Diffstat (limited to 'lisp/recentf.el')
-rw-r--r--lisp/recentf.el17
1 files changed, 10 insertions, 7 deletions
diff --git a/lisp/recentf.el b/lisp/recentf.el
index 7e379822457..efe4ebc63a4 100644
--- a/lisp/recentf.el
+++ b/lisp/recentf.el
@@ -1137,13 +1137,16 @@ default."
"Save the recent list.
Write data into the file specified by `recentf-save-file'."
(interactive)
- (with-temp-buffer
- (erase-buffer)
- (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)
- (write-file (expand-file-name recentf-save-file))
- nil))
+ (condition-case error
+ (with-temp-buffer
+ (erase-buffer)
+ (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)
+ (write-file (expand-file-name recentf-save-file))
+ nil)
+ (error
+ (warn "recentf mode: %s" (error-message-string error)))))
(defun recentf-load-list ()
"Load a previously saved recent list.