From 234547297ad1872b7ed7fe269fe34deac1798c68 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 1 Sep 2008 00:21:57 -0400 Subject: Moved some code around to follow better Lisp style. --- chess-database.el | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'chess-database.el') diff --git a/chess-database.el b/chess-database.el index 0c03484..6b0b1cd 100644 --- a/chess-database.el +++ b/chess-database.el @@ -24,16 +24,16 @@ (defun chess-database-do-open (module file) "Returns the opened database object, or nil." (let* ((name (symbol-name module)) - (handler (intern-soft (concat name "-handler"))) - buffer) + (handler (intern-soft (concat name "-handler")))) (unless handler (chess-error 'no-such-database name)) - (when (setq buffer (funcall handler 'open file)) - (with-current-buffer buffer - (setq chess-database-handler handler) - (add-hook 'kill-buffer-hook 'chess-database-close nil t) - (add-hook 'after-revert-hook 'chess-database-rescan nil t) - (current-buffer))))) + (let ((buffer (funcall handler 'open file))) + (when buffer + (with-current-buffer buffer + (setq chess-database-handler handler) + (add-hook 'kill-buffer-hook 'chess-database-close nil t) + (add-hook 'after-revert-hook 'chess-database-rescan nil t) + (current-buffer)))))) (defun chess-database-open (file &optional module) "Returns the opened database object, or nil." -- cgit v1.2.3