]> code.delx.au - gnu-emacs-elpa/commitdiff
Moved some code around to follow better Lisp style.
authorJohn Wiegley <johnw@newartisans.com>
Mon, 1 Sep 2008 04:21:57 +0000 (00:21 -0400)
committerJohn Wiegley <johnw@newartisans.com>
Mon, 1 Sep 2008 04:21:57 +0000 (00:21 -0400)
chess-database.el

index 0c034848753852562d3a3702c380b8beeae60b9f..6b0b1cdeaee756a75ce99a4dcb2c01a9e8200644 100644 (file)
 (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."