From: ueno Date: Sun, 17 Aug 2003 18:34:07 +0000 (+0000) Subject: (riece-command-switch-to-channel-by-number): Fixed. X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Friece-0_0;p=elisp%2Friece.git (riece-command-switch-to-channel-by-number): Fixed. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 24c3802..5570f09 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,7 @@ +2003-06-12 Daiki Ueno + + * riece-commands.el (riece-command-switch-to-channel-by-number): Fixed. + 2003-08-17 Daiki Ueno * riece-commands.el (riece-command-previous-channel): Skip nil in diff --git a/lisp/riece-commands.el b/lisp/riece-commands.el index 8b9b99d..94a41aa 100644 --- a/lisp/riece-commands.el +++ b/lisp/riece-commands.el @@ -48,17 +48,11 @@ (if (string-match "[0-9]+$" command-name) (list (string-to-number (match-string 0 command-name))) (list (string-to-number (read-string "Number: ")))))) - (let ((channels riece-current-channels) - (index 1)) - (while (and channels - (< index number)) - (if (car channels) - (setq index (1+ index))) - (setq channels (cdr channels))) - (if (car channels) - (riece-command-switch-to-channel (car channels)) + (let ((channel (nth (1- number) riece-current-channels))) + (if channel + (riece-command-switch-to-channel channel) (error "No such number!")))) - + (eval-and-compile (let ((number 1)) (while (<= number 20)