riece-command-enter-message-to-user.
* riece-misc.el (riece-current-nickname): Use
riece-current-server-name.
(riece-get-users-on-server): Ditto.
* riece-server.el (riece-current-server-name): New function.
(riece-send-string): Use it.
* riece-commands.el (riece-command-enter-message-to-user): New command.
2003-10-19 Daiki Ueno <ueno@unixuser.org>
+ * riece.el (riece-dialogue-mode-map): Bind "p" to
+ riece-command-enter-message-to-user.
+
+ * riece-misc.el (riece-current-nickname): Use
+ riece-current-server-name.
+ (riece-get-users-on-server): Ditto.
+
+ * riece-server.el (riece-current-server-name): New function.
+ (riece-send-string): Use it.
+
+ * riece-commands.el (riece-command-enter-message-to-user): New command.
+
+2003-10-19 Daiki Ueno <ueno@unixuser.org>
+
* riece-menu.el (riece-menu-create-layouts-menu): New function.
(riece-menu-items): Use it.
(let ((next-line-add-newlines t))
(next-line 1)))
+(defun riece-command-enter-message-to-user (user)
+ "Send the current line to USER."
+ (interactive
+ (let ((completion-ignore-case t))
+ (list (completing-read
+ "User: "
+ (mapcar #'list (riece-get-users-on-server))))))
+ (let ((text (buffer-substring
+ (riece-line-beginning-position)
+ (riece-line-end-position))))
+ (riece-send-string
+ (format "PRIVMSG %s :%s\r\n" user text))
+ (riece-display-message
+ (riece-make-message (riece-current-nickname)
+ (riece-make-identity user (riece-current-server-name))
+ text nil t)))
+ (let ((next-line-add-newlines t))
+ (next-line 1)))
+
(defun riece-command-join-channel (target key)
(let ((process (riece-server-process (riece-identity-server target))))
(unless process
(defun riece-current-nickname ()
"Return the current nickname."
- (riece-with-server-buffer (riece-identity-server riece-current-channel)
+ (riece-with-server-buffer (riece-current-server-name)
(if riece-real-nickname
(riece-make-identity riece-real-nickname riece-server-name))))
user-at-host))
(defun riece-get-users-on-server ()
- (riece-with-server-buffer (if riece-current-channel
- (riece-identity-server riece-current-channel)
- "")
+ (riece-with-server-buffer (riece-current-server-name)
(let (users)
(mapatoms
(lambda (atom)
(with-current-buffer (process-buffer process)
(process-send-string process (riece-encode-coding-string string))))
-(defun riece-send-string (string)
- (let* ((server-name
- (or riece-overriding-server-name
+(defun riece-current-server-name ()
+ (or riece-overriding-server-name
;already in the server buffer
- (if (local-variable-p 'riece-server-name (current-buffer))
- riece-server-name
- (if riece-current-channel
- (riece-identity-server riece-current-channel)
- (if (riece-server-opened "")
- "")))))
+ (if (local-variable-p 'riece-server-name (current-buffer))
+ riece-server-name
+ (if riece-current-channel
+ (riece-identity-server riece-current-channel)
+ (if (riece-server-opened "")
+ "")))))
+
+(defun riece-send-string (string)
+ (let* ((server-name (riece-current-server-name))
(process (riece-server-process server-name)))
(unless process
(error "%s" (substitute-command-keys
"O" riece-command-open-server
"C" riece-command-close-server
"M" riece-command-universal-server-name-argument
+ "p" riece-command-enter-message-to-user
"q" riece-command-quit
"r" riece-command-configure-windows
"x" riece-command-copy-region