irc: only use the switch buffer logic during creation
This fixes a problem where calling IRC (e.g. C-c I I) will switch to a (seemingly random but is ordered by load order) buffer. It also adds a `user-error` when the IRC workspace is already selected.
This commit is contained in:
parent
4b20c7206e
commit
b78c96044e
1 changed files with 8 additions and 6 deletions
|
@ -7,12 +7,14 @@
|
||||||
(not inhibit-workspace))
|
(not inhibit-workspace))
|
||||||
(+workspace-switch +irc--workspace-name 'auto-create))
|
(+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 (not (member (window-buffer) buffers))
|
||||||
(if buffers
|
(if buffers
|
||||||
(ignore (switch-to-buffer (car buffers)))
|
(ignore (switch-to-buffer (car buffers)))
|
||||||
(require 'circe)
|
(require 'circe)
|
||||||
(delete-other-windows)
|
(delete-other-windows)
|
||||||
(switch-to-buffer (doom-fallback-buffer))
|
(switch-to-buffer (doom-fallback-buffer))
|
||||||
t)))
|
t)
|
||||||
|
(user-error "IRC buffer is already active and selected"))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun =irc (&optional inhibit-workspace)
|
(defun =irc (&optional inhibit-workspace)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue