From 1c3bad8c2e311cce81dc5203cab77f4d65ab3e82 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Tue, 14 Sep 2021 19:07:18 +0200 Subject: [PATCH] Display server buffer after connecting * rcirc.el (rcirc-display-server-buffer): Add new option (rcirc): Respect rcirc-display-server-buffer --- lisp/net/rcirc.el | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index 6c669564209..579a350c6a1 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -419,6 +419,11 @@ will be killed." :version "28.1" :type 'boolean) +(defcustom rcirc-display-server-buffer t + "Non-nil means the server buffer should be shown on connecting." + :version "28.1" + :type 'boolean) + (defvar-local rcirc-nick nil "The nickname used for the current connection.") @@ -518,10 +523,12 @@ If ARG is non-nil, instead prompt for connection parameters." :channels) " ")) "[, ]+" t)) - (encryption (rcirc-prompt-for-encryption server-plist))) - (rcirc-connect server port nick user-name - rcirc-default-full-name - channels password encryption)) + (encryption (rcirc-prompt-for-encryption server-plist)) + (process (rcirc-connect server port nick user-name + rcirc-default-full-name + channels password encryption))) + (when rcirc-display-server-buffer + (pop-to-buffer-same-window (process-buffer process)))) ;; connect to servers in `rcirc-server-alist' (let (connected-servers) (dolist (c rcirc-server-alist) @@ -550,9 +557,11 @@ If ARG is non-nil, instead prompt for connection parameters." (setq connected p))) (if (not connected) (condition-case nil - (rcirc-connect server port nick user-name - full-name channels password encryption - server-alias) + (let ((process (rcirc-connect server port nick user-name + full-name channels password encryption + server-alias))) + (when rcirc-display-server-buffer + (pop-to-buffer-same-window (process-buffer process)))) (quit (message "Quit connecting to %s" (or server-alias server)))) (with-current-buffer (process-buffer connected) -- 2.39.2