From: Magnus H. <leg...@us...> - 2014-08-08 17:16:20
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "emacs-jabber". The branch, master has been updated via 4b9c46232e83efae34ff8497325fae0e3b5675aa (commit) via aedd89f5912a24e6bfacfd34a8ce4bbf57e5d51c (commit) from 3f168ae5c1f7b40c2935158b99354c97bc82ab59 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 4b9c46232e83efae34ff8497325fae0e3b5675aa Author: Magnus Henoch <mag...@gm...> Date: Fri Aug 8 18:14:33 2014 +0100 Fix prompt and /me messages for private MUC messages Previously these would be printed with the group's JID. Now they use the nick of the person you're chatting with instead. diff --git a/jabber-chat.el b/jabber-chat.el index 60191ca..c12e22c 100644 --- a/jabber-chat.el +++ b/jabber-chat.el @@ -382,11 +382,14 @@ This function is used as an ewoc prettyprinter." delayed /me-p)) (:foreign - ;; For :error and :notice, this might be a string... beware - (jabber-chat-print-prompt (when (listp (cadr data)) (cadr data)) - (or original-timestamp internal-time) - delayed - /me-p)) + (if (and (listp (cadr data)) + (jabber-muc-private-message-p (cadr data))) + (jabber-muc-private-print-prompt (cadr data)) + ;; For :error and :notice, this might be a string... beware + (jabber-chat-print-prompt (when (listp (cadr data)) (cadr data)) + (or original-timestamp internal-time) + delayed + /me-p))) ((:error :notice :subscription-request) (jabber-chat-system-prompt (or original-timestamp internal-time))) (:muc-local @@ -573,7 +576,8 @@ If DONT-PRINT-NICK-P is true, don't include nickname." (nick (cond ((eq who :local) (plist-get (fsm-get-state-data jabber-buffer-connection) :username)) - ((jabber-muc-message-p xml-data) + ((or (jabber-muc-message-p xml-data) + (jabber-muc-private-message-p xml-data)) (jabber-jid-resource (jabber-xml-get-attribute xml-data 'from))) (t (jabber-jid-displayname (jabber-xml-get-attribute xml-data 'from)))))) commit aedd89f5912a24e6bfacfd34a8ce4bbf57e5d51c Author: Magnus Henoch <mag...@gm...> Date: Fri Aug 8 09:33:38 2014 +0100 Chat prompts are fields; use for goto-address Give all chat prompts a 'field property. This changes behaviour, hopefully to the better. For example, C-a will now stop at the beginning of the chat text; use C-b C-a at that point to go to the beginning of the prompt. Use the field property to improve jabber-chat-goto-address. Previously, we would try to make URLs clickable in the entire buffer, which besides being wasteful would cease working once the buffer size was past goto-address-fontify-maximum-size. diff --git a/jabber-chat.el b/jabber-chat.el index ab8d2e2..60191ca 100644 --- a/jabber-chat.el +++ b/jabber-chat.el @@ -374,7 +374,8 @@ This function is used as an ewoc prettyprinter." (string= (substring body 0 4) "/me ")))) ;; Print prompt... - (let ((delayed (or original-timestamp (plist-get (cddr data) :delayed)))) + (let ((delayed (or original-timestamp (plist-get (cddr data) :delayed))) + (prompt-start (point))) (case (car data) (:local (jabber-chat-self-prompt (or original-timestamp internal-time) @@ -393,7 +394,8 @@ This function is used as an ewoc prettyprinter." (:muc-foreign (jabber-muc-print-prompt (cadr data) nil /me-p)) ((:muc-notice :muc-error) - (jabber-muc-system-prompt)))) + (jabber-muc-system-prompt))) + (put-text-property prompt-start (point) 'field 'jabber-prompt)) ;; ...and body (case (car data) @@ -609,8 +611,13 @@ If DONT-PRINT-NICK-P is true, don't include nickname." (defun jabber-chat-goto-address (xml-data who mode) "Call `goto-address' on the newly written text." (when (eq mode :insert) - (ignore-errors - (goto-address)))) + (ignore-errors + (let ((end (point)) + (limit (max (- (point) 1000) (1+ (point-min))))) + ;; We only need to fontify the text written since the last + ;; prompt. The prompt has a field property, so we can find it + ;; using `field-beginning'. + (goto-address-fontify (field-beginning nil nil limit) end))))) ;; jabber-compose is autoloaded in jabber.el (add-to-list 'jabber-jid-chat-menu ----------------------------------------------------------------------- Summary of changes: jabber-chat.el | 31 +++++++++++++++++++++---------- 1 files changed, 21 insertions(+), 10 deletions(-) hooks/post-receive -- emacs-jabber |