From: ueno Date: Sat, 31 May 2003 01:30:47 +0000 (+0000) Subject: Undo the last change. X-Git-Tag: riece-0_0_3~24 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=92351ecf15cf4967a964bbb0b5cb37fa20dd2da7;p=elisp%2Friece.git Undo the last change. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 981dc49..4def359 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,9 +1,5 @@ 2003-05-31 Daiki Ueno - * riece-commands.el (riece-command-next-channel): Circularly - follow the channel list. - (riece-command-previous-channel): Ditto. - * riece-url.el: Fix usage. * riece-inlines.el (string-list-member-ignore-case): Remove docstring. diff --git a/lisp/riece-commands.el b/lisp/riece-commands.el index 004490f..3661cfb 100644 --- a/lisp/riece-commands.el +++ b/lisp/riece-commands.el @@ -73,21 +73,32 @@ "Select the next channel." (interactive) (when (> (length riece-current-channels) 1) - (let ((channels (copy-sequence riece-current-channels))) - (setcdr (last channels) channels) ;make a circular link - (riece-command-switch-to-channel - (nth 1 (string-list-member-ignore-case - riece-current-channel channels)))))) + (let ((pointer (cdr (string-list-member-ignore-case + riece-current-channel + 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!"))))) (defun riece-command-previous-channel () "Select the previous channel." (interactive) (when (> (length riece-current-channels) 1) - (let ((channels (nreverse (copy-sequence riece-current-channels)))) - (setcdr (last channels) channels) ;make a circular link - (riece-command-switch-to-channel - (nth 1 (string-list-member-ignore-case - riece-current-channel channels)))))) + (let ((pointer (string-list-member-ignore-case + riece-current-channel + riece-current-channels)) + (start riece-current-channels) + channel) + (while (and start (not (eq start pointer))) + (if (car start) + (setq channel (car start))) + (setq start (cdr start))) + (if channel + (riece-command-switch-to-channel channel) + (error "No such channel!"))))) (defun riece-command-select-command-buffer () "Select the command buffer."