[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/slime-volleyball daa207c 18/27: Properly clean up when
From: |
Thomas Fitzsimmons |
Subject: |
[elpa] externals/slime-volleyball daa207c 18/27: Properly clean up when buffer is killed. |
Date: |
Sun, 22 Nov 2020 18:05:18 -0500 (EST) |
branch: externals/slime-volleyball
commit daa207cf8812d386d17ad4a2e1e99188c3dfde5e
Author: RĂ¼diger Sonderfeld <ruediger@c-plusplus.de>
Commit: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Properly clean up when buffer is killed.
When the buffer is killed (e.g., by C-x k) the timers are not cleaned up
properly. By adding a `kill-buffer-hook' this can be prevented.
Signed-off-by: RĂ¼diger Sonderfeld <ruediger@c-plusplus.de>
---
slime-volleyball.el | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/slime-volleyball.el b/slime-volleyball.el
index 5675bf0..09e613f 100644
--- a/slime-volleyball.el
+++ b/slime-volleyball.el
@@ -1741,10 +1741,14 @@
(setq slime-volleyball-unpause-function
'slime-volleyball-introduce-opponent)
(slime-volleyball-pause "Press SPC or 2 to Start")
+ (add-hook 'kill-buffer-hook
+ (lambda ()
+ (slime-volleyball-quit 'force-quit 'no-kill))
+ nil 'local)
(with-current-buffer (get-buffer-create "*slime-volleyball*")
(use-local-map slime-volleyball-mode-map)))
-(defun slime-volleyball-quit (&optional force-quit)
+(defun slime-volleyball-quit (&optional force-quit no-kill)
(interactive)
(when (or force-quit
(y-or-n-p "Quit Slime Volleyball?"))
@@ -1754,7 +1758,8 @@
(slime-volleyball-scrub-timer-list 'slime-volleyball-render)
(slime-volleyball-scrub-timer-list
'slime-volleyball-eval-god-mode-variables)
- (when (get-buffer "*slime-volleyball*")
+ (when (and (not no-kill)
+ (get-buffer "*slime-volleyball*"))
(kill-buffer "*slime-volleyball*"))))
(provide 'slime-volleyball)
- [elpa] externals/slime-volleyball 259e6cd 23/27: README.md: Add a screenshot, (continued)
- [elpa] externals/slime-volleyball 259e6cd 23/27: README.md: Add a screenshot, Thomas Fitzsimmons, 2020/11/22
- [elpa] externals/slime-volleyball ac1b98d 26/27: fix minor problems in SVG syntax., Thomas Fitzsimmons, 2020/11/22
- [elpa] externals/slime-volleyball d046322 10/27: Load other files relative to slime-volleyball-init's symbol file, Thomas Fitzsimmons, 2020/11/22
- [elpa] externals/slime-volleyball c6522af 16/27: Some minor doc changes., Thomas Fitzsimmons, 2020/11/22
- [elpa] externals/slime-volleyball c7d895c 17/27: Add autoload cookie., Thomas Fitzsimmons, 2020/11/22
- [elpa] externals/slime-volleyball c080ae6 21/27: README.md: Mention librsvg requirement, Thomas Fitzsimmons, 2020/11/22
- [elpa] externals/slime-volleyball f550da8 20/27: Fix some formatting issues, Thomas Fitzsimmons, 2020/11/22
- [elpa] externals/slime-volleyball 6e694b0 24/27: Mention SVG in description, Thomas Fitzsimmons, 2020/11/22
- [elpa] externals/slime-volleyball 9bede7f 27/27: Remove some tabs, Thomas Fitzsimmons, 2020/11/22
- [elpa] externals/slime-volleyball 4b5a720 07/27: README.md: Fix Markdown formatting, Thomas Fitzsimmons, 2020/11/22
- [elpa] externals/slime-volleyball daa207c 18/27: Properly clean up when buffer is killed.,
Thomas Fitzsimmons <=
- [elpa] externals/slime-volleyball 4272ab5 25/27: Release version 1.1, Thomas Fitzsimmons, 2020/11/22
- [elpa] externals/slime-volleyball 0082d05 04/27: Fix God mode initialization, Thomas Fitzsimmons, 2020/11/22
- [elpa] externals/slime-volleyball a5c7f5a 06/27: slime-volleyball-save-strategy-helper: Make non-interactive, Thomas Fitzsimmons, 2020/11/22