Merge pull request #2779 from seanfarley/irc-buffer-state

irc: only use the switch buffer logic during creation
This commit is contained in:
Henrik Lissner 2020-04-07 17:57:24 -04:00 committed by GitHub
commit 657bf209cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)