From: Yoichi NAKAYAMA Date: Mon, 2 Jun 2003 11:03:33 +0000 (+0000) Subject: * riece-commands.el (riece-command-next-channel): Circularly X-Git-Url: https://cgit.sxemacs.org/?p=riece;a=commitdiff_plain;h=042b02236efc8721d134b4c9dc40706886278fd3 * 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!")))))