* riece-commands.el (riece-command-next-channel): Circularly
authoryoichi <yoichi>
Mon, 2 Jun 2003 11:03:33 +0000 (11:03 +0000)
committeryoichi <yoichi>
Mon, 2 Jun 2003 11:03:33 +0000 (11:03 +0000)
follow the channel list.
(riece-command-previous-channel): Ditto.

lisp/ChangeLog
lisp/riece-commands.el

index 7461419..321b330 100644 (file)
@@ -1,3 +1,9 @@
+2003-06-02  Yoichi NAKAYAMA  <yoichi@geiin.org>
+
+       * riece-commands.el (riece-command-next-channel): Circularly
+       follow the channel list.
+       (riece-command-previous-channel): Ditto.
+
 2003-06-02  Daiki Ueno  <ueno@unixuser.org>
 
        * riece.el (riece-command-mode): Set default value of riece-freeze
index 48cd591..28b0d39 100644 (file)
       (while (and pointer
                  (null (car pointer)))
        (setq pointer (cdr pointer)))
+      (when (null pointer)
+       (setq pointer riece-current-channels)
+       (while (and pointer
+                   (null (car pointer)))
+         (setq pointer (cdr pointer))))
       (if (car pointer)
          (riece-command-switch-to-channel (car pointer))
        (error "No such channel!")))))
          (start riece-current-channels)
          channel)
       (while (and start (not (eq start pointer)))
-       (if (car start)
-           (setq channel (car start)))
+       (setq channel (car start))
        (setq start (cdr start)))
+      (when (null channel)
+       (setq start (copy-sequence riece-current-channels))
+       (setq start (delq nil start))
+       (and (> (length start) 1)
+            (setq channel (nth (1- (length start)) start))))
       (if channel
          (riece-command-switch-to-channel channel)
        (error "No such channel!")))))