emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r103224: * lisp/net/rcirc.el (defun-r


From: Deniz Dogan
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r103224: * lisp/net/rcirc.el (defun-rcirc-join): Accept multiple channels.
Date: Fri, 11 Feb 2011 07:19:34 +0100
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 103224
committer: Deniz Dogan <address@hidden>
branch nick: emacs-trunk
timestamp: Fri 2011-02-11 07:19:34 +0100
message:
  * lisp/net/rcirc.el (defun-rcirc-join): Accept multiple channels.
modified:
  lisp/ChangeLog
  lisp/net/rcirc.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-02-11 03:54:12 +0000
+++ b/lisp/ChangeLog    2011-02-11 06:19:34 +0000
@@ -1,3 +1,7 @@
+2011-02-11  Deniz Dogan  <address@hidden>
+
+       * net/rcirc.el (defun-rcirc-join): Accept multiple channels.
+
 2011-02-11  Glenn Morris  <address@hidden>
 
        * emacs-lisp/cl-specs.el (multiple-value-bind): Fix debug spec.

=== modified file 'lisp/net/rcirc.el'
--- a/lisp/net/rcirc.el 2011-02-11 00:49:28 +0000
+++ b/lisp/net/rcirc.el 2011-02-11 06:19:34 +0000
@@ -2098,14 +2098,18 @@
     (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)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]