emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/pacmacs bd5970816f 002/472: Check if the killing buffer is


From: ELPA Syncer
Subject: [nongnu] elpa/pacmacs bd5970816f 002/472: Check if the killing buffer is ours. Close #1
Date: Thu, 6 Jan 2022 21:59:00 -0500 (EST)

branch: elpa/pacmacs
commit bd5970816f38d0a1585c282810ce9fb58cfdfb9e
Author: rexim <reximkut@gmail.com>
Commit: rexim <reximkut@gmail.com>

    Check if the killing buffer is ours. Close #1
---
 pacman.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/pacman.el b/pacman.el
index f3b648c999..1cf568986c 100644
--- a/pacman.el
+++ b/pacman.el
@@ -9,7 +9,7 @@
   (define-key pacman-mode-map (kbd "<left>") 'pacman-left)
   (define-key pacman-mode-map (kbd "<right>") 'pacman-right)
   (define-key pacman-mode-map (kbd "q") 'pacman-quit)
-  (add-hook 'kill-buffer-hook 'pacman-destroy))
+  (add-hook 'kill-buffer-hook 'pacman-kill-buffer-hook))
 
 (defun pacman-start ()
   (interactive)
@@ -18,6 +18,13 @@
   (unless pacman-timer
     (setq pacman-timer (run-at-time nil 0.1 'pacman-tick))))
 
+(defun pacman-kill-buffer-hook ()
+  (interactive)
+  (when (string= pacman-buffer-name
+                 (buffer-name (current-buffer)))
+    (message (format "Buffer name: %s" (buffer-name (current-buffer))))
+    (pacman-destroy)))
+
 (defun pacman-destroy ()
   (when pacman-timer
     (cancel-timer pacman-timer)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]