diff options
| author | John Wiegley <johnw@newartisans.com> | 2002-04-09 23:11:42 +0000 |
|---|---|---|
| committer | John Wiegley <johnw@newartisans.com> | 2002-04-09 23:11:42 +0000 |
| commit | 4c79e4f37969528483b3558a231977a1be2d4f51 (patch) | |
| tree | 952ef183441049d17be55e815e955afd3f590533 /chess-display.el | |
| parent | 054d7db6de897aa10894d2fa1e813f9fd0cd09d8 (diff) | |
*** no comment ***
Diffstat (limited to 'chess-display.el')
| -rw-r--r-- | chess-display.el | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/chess-display.el b/chess-display.el index 68aeea4..f45429e 100644 --- a/chess-display.el +++ b/chess-display.el @@ -87,13 +87,19 @@ (funcall handler 'initialize) (setq chess-display-event-handler handler chess-display-perspective perspective) + (add-hook 'kill-buffer-hook 'chess-display-on-kill nil t) (current-buffer)))) -(defsubst chess-display-destroy (display) +(defun chess-display-on-kill () + "Function called when the buffer is killed." + (chess-display-detach-game nil)) + +(defun chess-display-destroy (display) "Destroy a chess display object, killing all of its buffers." (let ((buf (or display (current-buffer)))) - (if (buffer-live-p buf) - (kill-buffer buf)))) + (when (buffer-live-p buf) + (chess-display-detach-game display) + (kill-buffer buf)))) (defsubst chess-display-perspective (display) (chess-with-current-buffer display |
