app/irc: fix workspace integration #2243
This commit is contained in:
parent
d00a0af925
commit
436d36fcd2
1 changed files with 10 additions and 13 deletions
|
@ -3,8 +3,10 @@
|
||||||
(defvar +irc--workspace-name "*IRC*")
|
(defvar +irc--workspace-name "*IRC*")
|
||||||
|
|
||||||
(defun +irc-setup-wconf (&optional inhibit-workspace)
|
(defun +irc-setup-wconf (&optional inhibit-workspace)
|
||||||
(unless inhibit-workspace
|
(when (and (featurep! :ui workspaces)
|
||||||
(+workspace-switch +irc--workspace-name t))
|
(+workspace-exists-p +irc--workspace-name)
|
||||||
|
(not inhibit-workspace))
|
||||||
|
(+workspace-switch +irc--workspace-name 'auto-create))
|
||||||
(let ((buffers (doom-buffers-in-mode 'circe-mode nil t)))
|
(let ((buffers (doom-buffers-in-mode 'circe-mode nil t)))
|
||||||
(if buffers
|
(if buffers
|
||||||
(ignore (switch-to-buffer (car buffers)))
|
(ignore (switch-to-buffer (car buffers)))
|
||||||
|
@ -20,17 +22,12 @@
|
||||||
If INHIBIT-WORKSPACE (the universal argument) is non-nil, don't spawn a new
|
If INHIBIT-WORKSPACE (the universal argument) is non-nil, don't spawn a new
|
||||||
workspace for it."
|
workspace for it."
|
||||||
(interactive "P")
|
(interactive "P")
|
||||||
(cond ((and (featurep! :ui workspaces)
|
(+irc-setup-wconf inhibit-workspace)
|
||||||
(+workspace-exists-p +irc--workspace-name))
|
(cond ((doom-buffers-in-mode 'circe-mode (doom-buffer-list) t)
|
||||||
(+workspace-switch +irc--workspace-name))
|
(message "Circe buffers are already open"))
|
||||||
((not (+irc-setup-wconf inhibit-workspace))
|
(circe-network-options
|
||||||
(user-error "Couldn't start up a workspace for IRC")))
|
(mapc #'circe (mapcar #'car circe-network-options)))
|
||||||
(if (doom-buffers-in-mode 'circe-mode (buffer-list) t)
|
((call-interactively #'circe))))
|
||||||
(message "Circe buffers are already open")
|
|
||||||
(if circe-network-options
|
|
||||||
(cl-loop for network in circe-network-options
|
|
||||||
collect (circe (car network)))
|
|
||||||
(call-interactively #'circe))))
|
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +irc/connect (&optional inhibit-workspace)
|
(defun +irc/connect (&optional inhibit-workspace)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue