From 01dc170e5bf9aab5c5a0701f41616c2f3fe37e0e Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 12 Jun 2017 14:35:41 +0200 Subject: [PATCH] app/irc: clean up timer & notifications on quit --- modules/app/irc/autoload/irc.el | 3 +++ modules/app/irc/config.el | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/app/irc/autoload/irc.el b/modules/app/irc/autoload/irc.el index 677b5f699..2fd86a0b3 100644 --- a/modules/app/irc/autoload/irc.el +++ b/modules/app/irc/autoload/irc.el @@ -35,6 +35,9 @@ (if (y-or-n-p "Really kill IRC session?") (let (circe-channel-killed-confirmation circe-server-killed-confirmation) + (when +irc--defer-timer + (cancel-timer +irc--defer-timer)) + (disable-circe-notifications) (mapcar #'kill-buffer (doom-buffers-in-mode 'circe-mode (buffer-list) t)) (when (equal (+workspace-current-name) +irc--workspace-name) (+workspace/delete +irc--workspace-name))) diff --git a/modules/app/irc/config.el b/modules/app/irc/config.el index 226f8619b..056124afa 100644 --- a/modules/app/irc/config.el +++ b/modules/app/irc/config.el @@ -28,6 +28,8 @@ playback.") `(cl-pushnew (cons ,server ,letvars) +irc-connections :test #'equal :key #'car)) +(defvar +irc--defer-timer nil) + ;; ;; Plugins @@ -141,7 +143,9 @@ playback.") :init (if +irc-defer-notifications (add-hook! 'circe-server-connected-hook - (run-at-time +irc-defer-notifications nil #'enable-circe-notifications)) + (setq +irc--defer-timer + (run-at-time +irc-defer-notifications nil + #'enable-circe-notifications))) (add-hook 'circe-server-connected-hook #'enable-circe-notifications)) :config (setq circe-notifications-watch-strings +irc-notifications-watch-strings