diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6f860d8a968..b3735e37289 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2011-02-11 Deniz Dogan + + * net/rcirc.el (defun-rcirc-join): Accept multiple channels. + 2011-02-11 Glenn Morris * emacs-lisp/cl-specs.el (multiple-value-bind): Fix debug spec. diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el index c3e4f3d6169..8657dc58bf4 100644 --- a/lisp/net/rcirc.el +++ b/lisp/net/rcirc.el @@ -2098,14 +2098,18 @@ activity. Only run if the buffer is not visible and (when (not existing-buffer) (rcirc-cmd-whois nick)))) -(defun-rcirc-command join (channel) - "Join CHANNEL." - (interactive "sJoin channel: ") - (let ((buffer (rcirc-get-buffer-create process - (car (split-string channel))))) - (rcirc-send-string process (concat "JOIN " channel)) +(defun-rcirc-command join (channels) + "Join CHANNELS. +CHANNELS is a comma- or space-separated string of channel names." + (interactive "sJoin channels: ") + (let* ((split-channels (split-string channels "[ ,]" t)) + (buffers (mapcar (lambda (ch) + (rcirc-get-buffer-create process ch)) + split-channels))) + (rcirc-send-string process (concat "JOIN " channels)) (when (not (eq (selected-window) (minibuffer-window))) - (switch-to-buffer buffer)))) + (dolist (b buffers) ;; order the new channel buffers in the buffer list + (switch-to-buffer b))))) ;; TODO: /part #channel reason, or consider removing #channel altogether (defun-rcirc-command part (channel)