From: ueno Date: Wed, 7 Jul 2004 03:20:11 +0000 (+0000) Subject: * riece-commands.el (riece-command-enter-message-to-user): Signal X-Git-Tag: riece-1_0_1~4 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=1f95e7852ca0ea65e8f00de5eda3678e25628ba9;p=elisp%2Friece.git * riece-commands.el (riece-command-enter-message-to-user): Signal "No text to send" error if user attempt to call this command on an empty line. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7c987f9..ef1a63f 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2004-07-07 Daiki Ueno + + * riece-commands.el (riece-command-enter-message-to-user): Signal + "No text to send" error if user attempt to call this command on + an empty line. + 2004-07-04 Yoichi NAKAYAMA * riece-commands.el (riece-command-complete-user): current-word diff --git a/lisp/riece-commands.el b/lisp/riece-commands.el index dc8ac18..c16b391 100644 --- a/lisp/riece-commands.el +++ b/lisp/riece-commands.el @@ -398,11 +398,13 @@ the layout to the selected layout-name." (defun riece-command-enter-message-to-user (user) "Send the current line to USER." (interactive - (let ((completion-ignore-case t)) - (list (riece-completing-read-identity - "Message to user: " - (riece-get-users-on-server (riece-current-server-name)) - nil nil nil nil nil t)))) + (if (and (bolp) (eolp)) + (error "No text to send") + (let ((completion-ignore-case t)) + (list (riece-completing-read-identity + "Message to user: " + (riece-get-users-on-server (riece-current-server-name)) + nil nil nil nil nil t))))) (let ((text (buffer-substring (riece-line-beginning-position) (riece-line-end-position))))