diff options
author | Glenn Morris <rgm@gnu.org> | 2008-09-20 19:47:07 +0000 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2008-09-20 19:47:07 +0000 |
commit | 926558fb3b7c5fe6b4c116e9e1baa4281af75f21 (patch) | |
tree | 97a21862d66260311cfb2f03812c516b61c94e2f /lisp/savehist.el | |
parent | d44004c0541ee1f42a1998d5330abaa010d47b2a (diff) | |
download | emacs-926558fb3b7c5fe6b4c116e9e1baa4281af75f21.tar.gz |
Ami Fischman <ami at fischman.org>
(savehist-save): Handle errors in writing as well as reading.
Diffstat (limited to 'lisp/savehist.el')
-rw-r--r-- | lisp/savehist.el | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/savehist.el b/lisp/savehist.el index c2674fd4f8e..65dc6d025c1 100644 --- a/lisp/savehist.el +++ b/lisp/savehist.el @@ -318,12 +318,13 @@ If AUTO-SAVE is non-nil, compare the saved contents to the one last saved, (dolist (elt value) (let ((start (point))) (insert " ") - (prin1 elt (current-buffer)) - ;; Try to read the element we just printed. + ;; Print and try to read the element we just printed. (condition-case nil - (save-excursion - (goto-char start) - (read (current-buffer))) + (progn + (prin1 elt (current-buffer)) + (save-excursion + (goto-char start) + (read (current-buffer)))) (error ;; If reading it gets an error, comment it out. (goto-char start) |