X-Git-Url: https://cgit.sxemacs.org/?p=riece;a=blobdiff_plain;f=lisp%2Friece-commands.el;h=3a80f991b8253184621dc9c099c74429fd0ebdb4;hp=dc8ac186ca83ee4574a31971182284fa1aaf44f6;hb=054dd7af144ca7d663ec5551c0bb609067f4e87a;hpb=32831ba1f11fbfe6dfcd7a7cb43ecab24e4881ee diff --git a/lisp/riece-commands.el b/lisp/riece-commands.el index dc8ac18..3a80f99 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)))) @@ -678,6 +680,7 @@ If prefix argument ARG is non-nil, toggle frozen status." (if (equal current completion) (with-output-to-temp-buffer "*Help*" (display-completion-list all)) + (re-search-forward "\\>" nil t) (delete-region (point) (- (point) (length current))) (insert completion))))))