Add riece-command-reorder-channels.
authorDaiki Ueno <ueno@unixuser.org>
Thu, 27 Oct 2011 07:02:10 +0000 (16:02 +0900)
committerDaiki Ueno <ueno@unixuser.org>
Thu, 27 Oct 2011 07:02:10 +0000 (16:02 +0900)
* riece-commands.el (riece-command-reorder-channels): New command.

lisp/ChangeLog
lisp/riece-commands.el

index 716768c..0bd5511 100644 (file)
@@ -1,3 +1,7 @@
+2011-10-27  Daiki Ueno  <ueno@unixuser.org>
+
+       * riece-commands.el (riece-command-reorder-channels): New command.
+
 2011-04-20  Daiki Ueno  <ueno@unixuser.org>
 
        * riece-commands.el (riece-command-set-operators)
index afaf950..e17b909 100644 (file)
          (riece-command-switch-to-channel channel)
        (error "No such channel!")))))
 
+(defun riece-command-reorder-channels ()
+  "Reorder channel list."
+  (interactive)
+  (let ((binding (mapcar
+                 (lambda (channel)
+                   (if channel
+                       (riece-parse-identity channel)))
+                 riece-default-channel-binding))
+       (pointer riece-current-channels)
+       channels)
+    (while pointer
+      (setq channels (riece-identity-assign-binding (car pointer) channels
+                                                   binding)
+           pointer (cdr pointer)))
+    (setq riece-current-channels channels)
+    (riece-emit-signal 'channel-list-changed)))
+
 (defun riece-command-select-command-buffer ()
   "Select the command buffer."
   (interactive)