irc: add +irc|add-circe-buffer-to-persp
A convenience function that prevents a new circe buffer (e.g. a new message pop up) from being added automatically to whichever is current workspace and instead adds it to the irc workspace.
This commit is contained in:
parent
8a0098ee52
commit
7f205130af
1 changed files with 13 additions and 0 deletions
|
@ -125,6 +125,19 @@ playback.")
|
||||||
+irc--workspace-name))))
|
+irc--workspace-name))))
|
||||||
(add-hook 'doom-real-buffer-functions #'+circe-buffer-p)
|
(add-hook 'doom-real-buffer-functions #'+circe-buffer-p)
|
||||||
|
|
||||||
|
(defun +irc|add-circe-buffer-to-persp ()
|
||||||
|
(let ((persp (get-current-persp))
|
||||||
|
(buf (current-buffer)))
|
||||||
|
;; only add a new circe buffer to the irc workspace when we're in another
|
||||||
|
;; workspace
|
||||||
|
(unless (eq (safe-persp-name persp) +irc--workspace-name)
|
||||||
|
;; add new circe buffers to the persp containing circe buffers
|
||||||
|
(persp-add-buffer buf
|
||||||
|
(persp-get-by-name +irc--workspace-name))
|
||||||
|
;; remove new buffer from accidental workspace
|
||||||
|
(persp-remove-buffer buf persp))))
|
||||||
|
(add-hook 'circe-mode-hook #'+irc|add-circe-buffer-to-persp)
|
||||||
|
|
||||||
(after! solaire-mode
|
(after! solaire-mode
|
||||||
;; distinguish chat/channel buffers from server buffers.
|
;; distinguish chat/channel buffers from server buffers.
|
||||||
(add-hook 'circe-chat-mode-hook #'solaire-mode))
|
(add-hook 'circe-chat-mode-hook #'solaire-mode))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue