diff options
author | Philip Kaludercic <philipk@posteo.net> | 2021-09-14 19:07:18 +0200 |
---|---|---|
committer | Philip Kaludercic <philipk@posteo.net> | 2021-09-14 19:07:18 +0200 |
commit | 1c3bad8c2e311cce81dc5203cab77f4d65ab3e82 (patch) | |
tree | 433dc31daafdc865936e153094d2887b85c312ac /lisp | |
parent | 8eb9eb0c41417991432122795522f6db7e1bb7d2 (diff) | |
download | emacs-1c3bad8c2e311cce81dc5203cab77f4d65ab3e82.tar.gz emacs-1c3bad8c2e311cce81dc5203cab77f4d65ab3e82.tar.bz2 emacs-1c3bad8c2e311cce81dc5203cab77f4d65ab3e82.zip |
Display server buffer after connecting
* rcirc.el (rcirc-display-server-buffer): Add new option
(rcirc): Respect rcirc-display-server-buffer
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/net/rcirc.el | 23 |
1 files 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) |