From 966c37d4f6c120ee679849db549eeb0f2ddc7778 Mon Sep 17 00:00:00 2001 From: ueno Date: Sun, 17 Aug 2003 18:34:07 +0000 Subject: [PATCH] (riece-command-switch-to-channel-by-number): Fixed. --- lisp/ChangeLog | 4 ++++ lisp/riece-commands.el | 14 ++++---------- 2 files changed, 8 insertions(+), 10 deletions(-) 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) -- 1.7.10.4