From: yoichi Date: Mon, 2 Jun 2003 11:03:33 +0000 (+0000) Subject: * riece-commands.el (riece-command-next-channel): Circularly X-Git-Tag: strict-naming-branchpoint~20 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=730f42333e8ae96273434712025afcb953fe9893;p=elisp%2Friece.git * riece-commands.el (riece-command-next-channel): Circularly follow the channel list. (riece-command-previous-channel): Ditto. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7461419..321b330 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2003-06-02 Yoichi NAKAYAMA + + * riece-commands.el (riece-command-next-channel): Circularly + follow the channel list. + (riece-command-previous-channel): Ditto. + 2003-06-02 Daiki Ueno * riece.el (riece-command-mode): Set default value of riece-freeze diff --git a/lisp/riece-commands.el b/lisp/riece-commands.el index 48cd591..28b0d39 100644 --- a/lisp/riece-commands.el +++ b/lisp/riece-commands.el @@ -79,6 +79,11 @@ (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!"))))) @@ -93,9 +98,13 @@ (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!")))))