diff options
| author | John Wiegley <johnw@newartisans.com> | 2008-09-01 00:21:57 -0400 |
|---|---|---|
| committer | John Wiegley <johnw@newartisans.com> | 2008-09-01 00:21:57 -0400 |
| commit | 234547297ad1872b7ed7fe269fe34deac1798c68 (patch) | |
| tree | bbd2e6b9d74e4f896f72b68022726e380b1b2c0c /chess-database.el | |
| parent | 38d158dd953505f3bf16061937503ee12fe7faee (diff) | |
Moved some code around to follow better Lisp style.
Diffstat (limited to 'chess-database.el')
| -rw-r--r-- | chess-database.el | 16 |
1 files changed, 8 insertions, 8 deletions
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." |
