From 5ac4490c740232726897a2cbb798254344bb48f1 Mon Sep 17 00:00:00 2001 From: ueno Date: Fri, 26 Apr 2002 06:48:46 +0000 Subject: [PATCH] * lsdb.el: Fix the last change. --- lsdb.el | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lsdb.el b/lsdb.el index 704feb7..6c16d65 100644 --- a/lsdb.el +++ b/lsdb.el @@ -259,11 +259,14 @@ This is the current number of slots in HASH-TABLE, whether occupied or not." (read-from-string "#s(hash-table)") (defun lsdb-load-file (file) "Read the contents of FILE into a hash table." - (save-excursion - (set-buffer (find-file-noselect file)) - (re-search-forward "^#s") - (beginning-of-line) - (read (point-min-marker))))) + (let ((buffer (find-file-noselect file))) + (unwind-protect + (save-excursion + (set-buffer buffer) + (re-search-forward "^#s") + (beginning-of-line) + (read (point-min-marker))) + (kill-buffer buffer))))) (invalid-read-syntax (defun lsdb-load-file (file) "Read the contents of FILE into a hash table." @@ -688,9 +691,10 @@ This is the current number of slots in HASH-TABLE, whether occupied or not." (interactive) (if (not lsdb-hash-table-is-dirty) (message "(No changes need to be saved)") - (if (or (interactive-p) - (y-or-n-p "Save the LSDB now?")) - (lsdb-save-file lsdb-file lsdb-hash-table)))) + (when (or (interactive-p) + (y-or-n-p "Save the LSDB now?")) + (lsdb-save-file lsdb-file lsdb-hash-table) + (setq lsdb-hash-table-is-dirty nil)))) ;;;_ : Edit Forms -- stolen (and renamed) from gnus-eform.el (defvar lsdb-edit-form-buffer "*LSDB edit form*") -- 1.7.10.4