From: Magnus H. <leg...@us...> - 2015-04-28 18:50:27
|
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, roster-optimisation has been updated via a7c0003c8045e92eb2960f88d5f6b947ae3def7c (commit) from 356d8924a0f51daaa2740f36b751db250355eb7d (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 a7c0003c8045e92eb2960f88d5f6b947ae3def7c Author: Magnus Henoch <mag...@gm...> Date: Tue Apr 28 19:48:36 2015 +0100 Fix group membership detection when deciding how to redisplay roster Consistently use group names as keys in group ewoc node hash table. Remove entries from hash table when ewoc nodes are deleted. Undo earlier "optimisation", which was incorrect but appeared to be correct because the roster would always be redrawn completely. diff --git a/jabber-roster.el b/jabber-roster.el index ff88571..be9da5d 100644 --- a/jabber-roster.el +++ b/jabber-roster.el @@ -595,7 +595,7 @@ H Toggle displaying this text (when (or jabber-roster-show-empty-group (> (length buddies) 0)) (let ((group-node (ewoc-enter-last ewoc (list group nil)))) - (puthash group group-node group-ewoc-node-hash) + (puthash group-name group-node group-ewoc-node-hash) (if (not (find group-name (plist-get (fsm-get-state-data jc) :roster-roll-groups) @@ -774,13 +774,11 @@ three being lists of JID symbols." (old-groups (mapcar #'caar existing-ewoc-data)) (new-groups (or (get insert-this 'groups) (list jabber-roster-default-group-name)))) - ;; If a contact is added to a group that's currently not - ;; displayed, we currently need to redraw the entire roster - ;; buffer. + ;; If a contact is added to a group, we currently need to + ;; redraw the entire roster buffer. (setq need-redraw (or need-redraw - (some (lambda (group) (null (gethash group group-ewoc-node-hash))) - new-groups))) + (not (null (set-difference new-groups old-groups :test #'string=))))) (when jabber-roster-debug (message (concat "insert jid: " jid))) (dolist (group new-groups) @@ -845,6 +843,7 @@ three being lists of JID symbols." (or (null next) (null (cadr (ewoc-data next))))) ;; That means that we just emptied a group. Let's ;; remove the preceding group heading. + (remhash (caar (ewoc-data previous)) group-ewoc-node-hash) (ewoc-delete ewoc previous)))))) ;; changed-items and deleted-items are lists of symbols. Let's ;; look them up in buddy-ewoc-node-hash. ----------------------------------------------------------------------- Summary of changes: jabber-roster.el | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) hooks/post-receive -- emacs-jabber |