From ad0d245a48dcba83369ca39d003ad27b134c64c4 Mon Sep 17 00:00:00 2001 From: ueno Date: Tue, 29 Aug 2000 16:44:13 +0000 Subject: [PATCH] * liece-channel.el (liece-channel-change): Run `liece-redisplay-buffer-functions' only when `liece-current-channel' is non-nil. * liece-commands.el (liece-command-who): Check `liece-current-channel'. (liece-command-names): Ditto. Suggested by: Yoichi NAKAYAMA . --- lisp/ChangeLog | 11 +++++++++++ lisp/liece-channel.el | 19 +++++++++---------- lisp/liece-commands.el | 49 +++++++++++++++++++++++++----------------------- 3 files changed, 46 insertions(+), 33 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 102bc0c..d94ab17 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,14 @@ +2000-08-29 Daiki Ueno + + * liece-channel.el (liece-channel-change): Run + `liece-redisplay-buffer-functions' only when + `liece-current-channel' is non-nil. + + * liece-commands.el (liece-command-who): Check + `liece-current-channel'. + (liece-command-names): Ditto. + Suggested by: Yoichi NAKAYAMA . + 2000-08-30 Akira Ohashi * liece-vars.el (liece-channel-unread-list): New variable. diff --git a/lisp/liece-channel.el b/lisp/liece-channel.el index e340a23..1a4efd9 100644 --- a/lisp/liece-channel.el +++ b/lisp/liece-channel.el @@ -362,7 +362,8 @@ If NOSW is non-nil do not switch to newly created channel." (let ((chnls (if (eq liece-command-buffer-mode 'chat) liece-current-chat-partners liece-current-channels)) - (string "")) + (string "") + chnl) (with-current-buffer liece-channel-list-buffer (let ((n 1) buffer-read-only) (erase-buffer) @@ -373,17 +374,15 @@ If NOSW is non-nil do not switch to newly created channel." (liece-channel-list-add-button n chnl)) (incf n)))) (if (string-equal string "") - (cond - ((eq liece-command-buffer-mode 'chat) - (setq liece-channels-indicator "No partner" - liece-current-chat-partner nil)) - (t - (setq liece-channels-indicator "No channel" - liece-current-channel nil))) + (if (eq liece-command-buffer-mode 'chat) + (setq liece-channels-indicator "No partner") + (setq liece-channels-indicator "No channel")) (setq liece-channels-indicator (substring string 1))) (liece-set-channel-indicator) - (save-excursion - (run-hook-with-args 'liece-redisplay-buffer-functions chnl)) + (when liece-current-channel + (save-excursion + (run-hook-with-args + 'liece-redisplay-buffer-functions liece-current-channel))) (liece-configure-windows))) (defsubst liece-channel-set-operator-1 (chnl user val) diff --git a/lisp/liece-commands.el b/lisp/liece-commands.el index c4439eb..86ab774 100644 --- a/lisp/liece-commands.el +++ b/lisp/liece-commands.el @@ -666,29 +666,30 @@ If argument ARG is non-nil message will be encrypted with KEY." (liece-next-line 1)) (liece-message (_ "No text to send"))))) -(defun liece-command-names (&optional channel) - "List the nicknames of the current IRC users on given CHANNEL. +(defun liece-command-names (&optional expr) + "List the nicknames of the current IRC users on given EXPR. With an Control-U as argument, only the current channel is listed. With - as argument, list all channels." (interactive (if (or current-prefix-arg (null liece-current-channel)) (if (eq current-prefix-arg '-) (list current-prefix-arg)) - (let ((completion-ignore-case t) channel) - (setq channel (liece-minibuffer-completing-default-read + (let ((completion-ignore-case t) expr) + (setq expr (liece-minibuffer-completing-default-read (_ "Names on channel: ") liece-channel-alist nil nil liece-current-channel)) - (unless (string-equal "" channel) - (list channel))))) - (cond - ((not channel) - (liece-send "NAMES %s" - (liece-channel-real liece-current-channel))) - ((and (eq channel '-) - (y-or-n-p (_ "Do you really query NAMES without argument?"))) - (liece-send "NAMES")) - (t - (liece-send "NAMES %s" (liece-channel-real channel))))) + (unless (string-equal "" expr) + (list expr))))) + (when (or (and (eq expr '-) + (y-or-n-p + (_ "Do you really query NAMES without argument?"))) + (not (or expr + (if liece-current-channel + (setq expr (liece-channel-real + liece-current-channel)))))) + (setq expr "")) + (when expr + (liece-send "NAMES %s" expr))) (defun liece-command-nickname (nick) "Set your nickname to NICK." @@ -712,15 +713,17 @@ With - as argument, list all users." (append liece-channel-alist liece-nick-alist))) (unless (string-equal "" expr) (list expr))))) - (cond - ((not expr) - (liece-send "WHO %s" (liece-channel-real liece-current-channel))) - ((and (eq expr '-) - (y-or-n-p (_ "Do you really query WHO without argument?"))) - (liece-send "WHO")) - (t + (when (or (and (eq expr '-) + (y-or-n-p + (_ "Do you really query WHO without argument?"))) + (not (or expr + (if liece-current-channel + (setq expr (liece-channel-real + liece-current-channel)))))) + (setq expr "")) + (when expr (liece-send "WHO %s" expr) - (setq liece-who-expression expr)))) + (setq liece-who-expression expr))) (defun liece-command-finger (finger-nick-var &optional server) "Get information about a specific user FINGER-NICK-VAR. -- 1.7.10.4