From 926558fb3b7c5fe6b4c116e9e1baa4281af75f21 Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 20 Sep 2008 19:47:07 +0000 Subject: [PATCH] Ami Fischman (savehist-save): Handle errors in writing as well as reading. --- lisp/ChangeLog | 5 +++++ lisp/savehist.el | 11 ++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7dbfcd16c98..c32fadb767d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2008-09-20 Ami Fischman + + * savehist.el (savehist-save): Handle errors in writing as well as + reading. + 2008-09-20 Michael Olson * emacs-lisp/tq.el (tq-create): Disable undo in tq buffer in order 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) -- 2.39.5