← Back to team overview

vm team mailing list archive

[Merge] lp:~akwm/vm/operate-on-collapsed-subtree into lp:vm

 

Arik has proposed merging lp:~akwm/vm/operate-on-collapsed-subtree into lp:vm.

Requested reviews:
  VM development team (vm)
Related bugs:
  #605944 Wishlist: threads save tree
  https://bugs.launchpad.net/bugs/605944


when option set and thread collapsed have save,label,set attribute applied to all messages in the sub-tree. This utilizes the thread-count property of threading and so if there are still issues assimilating new messages then this can have problems (i.e. if a message is deleted and not updated then the thread may record too many messages and this will apply beyond the end. Or if a new message isn't assimilated properly the count may be too low and messages skipped). If those issues are fixed then it works like advertised

-- 
https://code.launchpad.net/~akwm/vm/operate-on-collapsed-subtree/+merge/32607
Your team VM development team is requested to review the proposed merge of lp:~akwm/vm/operate-on-collapsed-subtree into lp:vm.
=== modified file 'lisp/vm-delete.el'
--- lisp/vm-delete.el	2010-08-10 13:06:42 +0000
+++ lisp/vm-delete.el	2010-08-13 17:34:42 +0000
@@ -54,6 +54,8 @@
 	    ;; vm-update-summary-and-mode-line eventually.
 	    (when (and vm-summary-enable-thread-folding
 		       vm-summary-show-threads
+		       (not (and vm-operate-on-collapsed-threads-as-one
+				 (eq count 1)))
 		       (> (vm-th-thread-count (car mlist)) 1))
 	      (with-current-buffer vm-summary-buffer
 		(vm-expand-thread (vm-th-thread-root (car mlist)))))))

=== modified file 'lisp/vm-folder.el'
--- lisp/vm-folder.el	2010-08-10 15:37:18 +0000
+++ lisp/vm-folder.el	2010-08-13 17:34:42 +0000
@@ -4478,6 +4478,18 @@
 	  (direction (if (< prefix 0) 'backward 'forward))
 	  (count (vm-abs prefix))
 	  (vm-message-pointer vm-message-pointer))
+      (when (and (= prefix 1)
+		 vm-summary-buffer 
+		 vm-summary-enable-thread-folding
+		 vm-summary-show-threads
+		 vm-operate-on-collapsed-threads-as-one
+		 (eq (vm-th-thread-root (car vm-message-pointer))
+		     (car vm-message-pointer))
+		 (not (let ((msg (car vm-message-pointer)))
+			(with-current-buffer vm-summary-buffer
+			  (vm-summary-expanded-root-p msg)))))
+	(setq count (+ count 
+		       (- (vm-th-thread-count (car vm-message-pointer)) 1))))
       (unless (eq vm-circular-folders t)
 	(vm-check-count prefix))
       (while (not (zerop count))

=== modified file 'lisp/vm-vars.el'
--- lisp/vm-vars.el	2010-08-12 20:53:14 +0000
+++ lisp/vm-vars.el	2010-08-13 17:34:42 +0000
@@ -5089,6 +5089,14 @@
   :group 'vm
   :type 'boolean)
 
+(defcustom vm-operate-on-collapsed-threads-as-one t
+  "*If non-nil and thread folding is enabled, operating on (e.g.
+deleting, adding labels, setting attributes, saving etc.) the
+root message of a collapsed thread will apply the operation to
+all sub-threads as well."
+  :group 'vm
+  :type 'boolean)
+
 (defvar vm-summary-threads-collapsed t
   "If non-nil, indicates that threads should be
 folded (collapsed) in VM summary windows.")