From: bg66 Date: Wed, 5 Nov 2003 00:49:36 +0000 (+0000) Subject: * riece-unread.el (riece-unread-switch-to-channel): Protect X-Git-Tag: riece-0_1_6~5 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=c6d52d94673ac00fe992555756db9e90c9b31bf3;p=elisp%2Friece.git * riece-unread.el (riece-unread-switch-to-channel): Protect switching to the channel not existing. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ccaa278..daadc9c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,7 +1,12 @@ +2003-11-05 OHASHI Akira + + * riece-unread.el (riece-unread-switch-to-channel): Protect + switching to the channel not existing. + 2003-10-29 OHASHI Akira * riece-log.el (riece-log-get-directory): Support riece-identity - for mapping. + for mapping. 2003-10-28 Daiki Ueno diff --git a/lisp/riece-unread.el b/lisp/riece-unread.el index 47c998a..3a19c1d 100644 --- a/lisp/riece-unread.el +++ b/lisp/riece-unread.el @@ -82,8 +82,13 @@ (defun riece-unread-switch-to-channel () (interactive) - (if (car riece-unread-channels) - (riece-command-switch-to-channel (car riece-unread-channels)) + (if riece-unread-channels + (let ((channel (car riece-unread-channels))) + (if (riece-identity-member channel riece-current-channels) + (riece-command-switch-to-channel channel) + (setq riece-unread-channels + (delete channel riece-unread-channels)) + (riece-unread-switch-to-channel))) (error "No unread channel!"))) (defun riece-guess-channel-from-unread ()