+2004-07-07 Daiki Ueno <ueno@unixuser.org>
+
+ * 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 <yoichi@geiin.org>
* riece-commands.el (riece-command-complete-user): current-word
(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))))