From: ueno Date: Sat, 4 Oct 2003 23:56:12 +0000 (+0000) Subject: * riece-globals.el (riece-join-channel-candidate): New variable. X-Git-Tag: riece-0_1_2~2 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=80e8c386baeebc355762537fbbe63ad1c3986bfa;p=elisp%2Friece.git * riece-globals.el (riece-join-channel-candidate): New variable. * riece-commands.el (riece-command-join): Prompt riece-join-channel-candidate. * riece-handle.el (riece-handle-invite-message): Set riece-join-channel-candidate when the user is invited. * riece-naming.el (riece-naming-assert-join): Clear riece-join-channel-candidate. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 094a7e7..1e7e8c0 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,16 @@ 2003-10-04 Daiki Ueno + * riece-globals.el (riece-join-channel-candidate): New variable. + * riece-commands.el (riece-command-join): Prompt + riece-join-channel-candidate. + + * riece-handle.el (riece-handle-invite-message): Set + riece-join-channel-candidate when the user is invited. + * riece-naming.el (riece-naming-assert-join): Clear + riece-join-channel-candidate. + +2003-10-04 Daiki Ueno + * riece-identity.el (riece-completing-read-identity): Pass 6th & 7th arguments to completing-read. diff --git a/lisp/riece-commands.el b/lisp/riece-commands.el index 3d0f9a9..3e3c614 100644 --- a/lisp/riece-commands.el +++ b/lisp/riece-commands.el @@ -421,8 +421,14 @@ the layout to the selected layout-name." (interactive (let* ((completion-ignore-case t) (target - (riece-completing-read-identity - "Channel/User: " riece-current-channels)) + (if riece-join-channel-candidate + (let ((default (riece-format-identity + riece-join-channel-candidate))) + (riece-completing-read-identity + (format "Channel/User (default %s): " default) + riece-current-channels nil nil nil nil default)) + (riece-completing-read-identity + "Channel/User: " riece-current-channels))) key) (if (and current-prefix-arg (riece-channel-p (riece-identity-prefix target))) diff --git a/lisp/riece-globals.el b/lisp/riece-globals.el index 51b58c3..c3fc949 100644 --- a/lisp/riece-globals.el +++ b/lisp/riece-globals.el @@ -38,6 +38,8 @@ "The channel you currently have joined.") (defvar riece-current-channels nil "The channels you have currently joined.") +(defvar riece-join-channel-candidate nil + "The candidate for channel to be used with the next join command.") (defvar riece-save-variables-are-dirty nil "Non nil if the variables in `riece-saved-forms' are changed.") diff --git a/lisp/riece-handle.el b/lisp/riece-handle.el index 56852d0..e35515e 100644 --- a/lisp/riece-handle.el +++ b/lisp/riece-handle.el @@ -309,7 +309,10 @@ (let* ((user (riece-prefix-nickname prefix)) (parameters (riece-split-parameters string)) (invited (car parameters)) - (channel (nth 1 parameters))) + (channel (nth 1 parameters)) + (channel-identity (riece-make-identity channel riece-server-name))) + (if (riece-identity-equal-no-server invited riece-real-nickname) + (setq riece-join-channel-candidate channel-identity)) (riece-insert-info (list riece-dialogue-buffer riece-others-buffer) (concat @@ -319,8 +322,7 @@ user riece-server-name)) (riece-format-identity (riece-make-identity invited riece-server-name)) - (riece-format-identity (riece-make-identity - channel riece-server-name)))) + (riece-format-identity channel-identity))) "\n")))) (defun riece-handle-topic-message (prefix string) diff --git a/lisp/riece-naming.el b/lisp/riece-naming.el index 6a59cd2..ca9d8a0 100644 --- a/lisp/riece-naming.el +++ b/lisp/riece-naming.el @@ -36,7 +36,8 @@ (let ((channel-identity (riece-make-identity channel-name riece-server-name))) (riece-join-channel channel-identity) - (riece-switch-to-channel channel-identity)))) + (riece-switch-to-channel channel-identity) + (setq riece-join-channel-candidate nil)))) (defun riece-naming-assert-part (user-name channel-name) (riece-user-toggle-channel user-name channel-name nil)