Status: | Merged |
---|---|
Approved by: | Uday Reddy |
Approved revision: | 707 |
Merged at revision: | 848 |
Proposed branch: | lp:~akwm/vm/thread-folding |
Merge into: | lp:vm |
Diff against target: |
615 lines (+357/-27) (has conflicts) 5 files modified
lisp/vm-motion.el (+74/-18) lisp/vm-page.el (+20/-2) lisp/vm-summary.el (+248/-7) lisp/vm-vars.el (+13/-0) lisp/vm-version.el (+2/-0) Text conflict in lisp/vm-page.el Text conflict in lisp/vm-summary.el |
To merge this branch: | bzr merge lp:~akwm/vm/thread-folding |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Uday | Pending | ||
Review via email: mp+29020@code.launchpad.net |
Commit message
Add thread folding option to summary view
Description of the change
Adding thread folding to the normal thread view in summary. Options include showing number of threads at root message indicator along with folding on movement. Toggle/
New messages always display, allowing long conversations to take up less space in mailbox yet still remain in focus. Default binding to "T" for toggling thread fold state is simple and obvious. Is option controlled so does not affect summary both when not viewing in thread mode or when it's own master switch is off, i.e. changes here are available but not required.
Uday Reddy (reddyuday) wrote : | # |
Uday Reddy (reddyuday) wrote : | # |
Sorry, it looks like the merge didn't get pushed to the Launchpad yet. I will push it tonight from my home computer.
Cheers,
Uday
Preview Diff
1 | === modified file 'lisp/vm-motion.el' |
2 | --- lisp/vm-motion.el 2010-05-06 21:20:17 +0000 |
3 | +++ lisp/vm-motion.el 2010-07-01 17:00:54 +0000 |
4 | @@ -56,7 +56,11 @@ |
5 | (if (eq vm-message-pointer cons) |
6 | (vm-preview-current-message) |
7 | (vm-record-and-change-message-pointer vm-message-pointer cons) |
8 | - (vm-preview-current-message))))) |
9 | + (vm-preview-current-message) |
10 | + ;;(message "start of message you want is: %s" (vm-su-start-of (car vm-message-pointer))) |
11 | + (if (get-text-property (+ (vm-su-start-of (car vm-message-pointer)) 2) 'invisible vm-summary-buffer) |
12 | + (vm-expand-thread)) |
13 | + )))) |
14 | |
15 | ;;;###autoload |
16 | (defun vm-goto-message-last-seen () |
17 | @@ -158,7 +162,8 @@ |
18 | ;; |
19 | ;; Note that interactively all args are 1, so error signaling |
20 | ;; and retries apply to all interactive moves. |
21 | - (interactive "p\np\np") |
22 | + (interactive "p\np\np") |
23 | + ;;(message "running vm next message") |
24 | (if (interactive-p) |
25 | (vm-follow-summary-cursor)) |
26 | (vm-select-folder-buffer-and-validate) |
27 | @@ -195,15 +200,21 @@ |
28 | (setq count 1) |
29 | ;; reset for next pass |
30 | (setq oldmp vm-message-pointer)))) |
31 | - (vm-decrement count))) |
32 | + (if (not (and vm-summary-toggle-thread-folding |
33 | + vm-summary-show-threads |
34 | + (get-text-property (vm-su-start-of (car vm-message-pointer)) 'invisible vm-summary-buffer))) |
35 | + (vm-decrement count)) |
36 | + )) |
37 | (beginning-of-folder (setq error 'beginning-of-folder)) |
38 | (end-of-folder (setq error 'end-of-folder)))) |
39 | (t |
40 | (condition-case () |
41 | - (progn |
42 | + (progn |
43 | (vm-move-message-pointer direction) |
44 | - (while (and (not (eq oldmp vm-message-pointer)) |
45 | - (vm-should-skip-message vm-message-pointer t)) |
46 | + (while (or (and (not (eq oldmp vm-message-pointer)) |
47 | + (vm-should-skip-message vm-message-pointer t) |
48 | + ) |
49 | + (get-text-property (vm-su-start-of (car vm-message-pointer)) 'invisible vm-summary-buffer)) |
50 | (vm-move-message-pointer direction)) |
51 | ;; Retry the move if we've gone a complete circle and |
52 | ;; retries are allowed and there are other messages |
53 | @@ -235,6 +246,9 @@ |
54 | (end-of-folder |
55 | ;; we bumped into the end of the folder without finding |
56 | ;; a suitable stopping point; retry the move if we're allowed. |
57 | + (if (get-text-property (vm-su-start-of (car vm-message-pointer)) 'invisible vm-summary-buffer) |
58 | + (progn (setq error 'end-of-folder) (setq retry nil))) |
59 | + |
60 | (setq vm-message-pointer oldmp) |
61 | ;; if the retry fails, we make sure the message pointer |
62 | ;; is restored to its old value. |
63 | @@ -281,9 +295,23 @@ |
64 | (vm-select-folder-buffer) |
65 | (vm-display nil nil '(vm-next-message-no-skip) |
66 | '(vm-next-message-no-skip)) |
67 | + |
68 | + (if (and vm-summary-toggle-thread-folding vm-summary-show-threads vm-summary-thread-folding-on-motion) |
69 | + (let ((m nil)) |
70 | + (set-buffer vm-summary-buffer) |
71 | + (setq m (get-text-property (+ (point) 3) 'vm-message)) |
72 | + (if (< (+ (vm-su-end-of m) 3) (buffer-size)) |
73 | + (progn |
74 | + (if (get-text-property (+ (vm-su-end-of m) 3) 'invisible) (vm-expand-thread)) |
75 | + (if (not (get-text-property (+ (vm-su-end-of m) 3) 'thread-root)) |
76 | + (vm-collapse-thread t)) |
77 | + )) |
78 | + )) |
79 | + |
80 | (let ((vm-skip-deleted-messages nil) |
81 | (vm-skip-read-messages nil)) |
82 | (vm-next-message count nil t))) |
83 | + |
84 | ;; backward compatibility |
85 | (fset 'vm-Next-message 'vm-next-message-no-skip) |
86 | |
87 | @@ -296,9 +324,27 @@ |
88 | (vm-select-folder-buffer) |
89 | (vm-display nil nil '(vm-previous-message-no-skip) |
90 | '(vm-previous-message-no-skip)) |
91 | + |
92 | + (if (and vm-summary-toggle-thread-folding vm-summary-show-threads vm-summary-thread-folding-on-motion) |
93 | + (let ((m nil)) |
94 | + (set-buffer vm-summary-buffer) |
95 | + (setq m (get-text-property (+ (point) 3) 'vm-message)) |
96 | + (if (> (- (vm-su-start-of m) 3) 0) |
97 | + (if (get-text-property (- (vm-su-start-of m) 3) 'invisible) |
98 | + (save-excursion |
99 | + (goto-char (- (vm-su-start-of m) 4)) |
100 | + (vm-expand-thread)))) |
101 | + (if (not (get-text-property (+ (point) 3) 'thread-root)) |
102 | + (vm-collapse-thread)) |
103 | + )) |
104 | + |
105 | (let ((vm-skip-deleted-messages nil) |
106 | (vm-skip-read-messages nil)) |
107 | - (vm-previous-message count))) |
108 | + (vm-previous-message count)) |
109 | + |
110 | + ) |
111 | + |
112 | + |
113 | ;; backward compatibility |
114 | (fset 'vm-Previous-message 'vm-previous-message-no-skip) |
115 | |
116 | @@ -446,22 +492,32 @@ |
117 | ;; the position at eob belongs to the last message |
118 | ((and (eobp) (= (vm-su-end-of (car message-pointer)) point)) |
119 | nil ) |
120 | + ((eobp) |
121 | + (save-excursion |
122 | + (while (get-text-property (- (point) 3) 'invisible) |
123 | + (goto-char (- (vm-su-start-of (get-text-property (- (point) 3) 'vm-message)) 3))) |
124 | + (vm-goto-message (string-to-number (vm-number-of (get-text-property (- (point) 3) 'vm-message))))) |
125 | + t) |
126 | ;; make the position at eob belong to the last message |
127 | - ((eobp) |
128 | - (setq mp (vm-last message-pointer)) |
129 | - (save-excursion |
130 | - (set-buffer vm-mail-buffer) |
131 | - (vm-record-and-change-message-pointer vm-message-pointer mp) |
132 | - (vm-preview-current-message) |
133 | - ;; return non-nil so the caller will know that |
134 | - ;; a new message was selected. |
135 | - t )) |
136 | + ;; ((eobp) |
137 | + ;; (while (get-text-property (point) 'invisible) |
138 | + ;; (goto-char (1- (point))) |
139 | + ;; setq mp |
140 | + ;; ;;(setq mp (vm-last message-pointer)) |
141 | + ;; (save-excursion |
142 | + ;; (set-buffer vm-mail-buffer) |
143 | + ;; (vm-record-and-change-message-pointer vm-message-pointer mp) |
144 | + ;; (vm-preview-current-message) |
145 | + ;; ;; return non-nil so the caller will know that |
146 | + ;; ;; a new message was selected. |
147 | + ;; t )) |
148 | (t |
149 | (if (< point (vm-su-start-of (car message-pointer))) |
150 | (setq mp message-list) |
151 | (setq mp (cdr message-pointer) message-pointer nil)) |
152 | - (while (and (not (eq mp message-pointer)) |
153 | - (>= point (vm-su-end-of (car mp)))) |
154 | + (while (or (and (not (eq mp message-pointer)) |
155 | + (>= point (vm-su-end-of (car mp)))) |
156 | + (get-text-property (+ (vm-su-start-of (car mp)) 3) 'invisible)) |
157 | (setq mp (cdr mp))) |
158 | (if (not (eq mp message-pointer)) |
159 | (save-excursion |
160 | |
161 | === modified file 'lisp/vm-page.el' |
162 | --- lisp/vm-page.el 2010-06-16 19:35:45 +0000 |
163 | +++ lisp/vm-page.el 2010-07-01 17:00:54 +0000 |
164 | @@ -230,6 +230,7 @@ |
165 | (vm-emit-eom-blurb)))) |
166 | |
167 | (defun vm-emit-eom-blurb () |
168 | +<<<<<<< TREE |
169 | "Prints a minibuffer message when the end of message is reached, but |
170 | it is suppressed if the variable `vm-auto-next-message' is nil." |
171 | (interactive) |
172 | @@ -248,6 +249,18 @@ |
173 | (interactive) |
174 | (if vm-emit-messages-for-mime-decoding |
175 | (message str))) |
176 | +======= |
177 | + (interactive) |
178 | + (let ((vm-summary-uninteresting-senders-arrow "") |
179 | + (case-fold-search nil)) |
180 | + (message (if (and (stringp vm-summary-uninteresting-senders) |
181 | + (string-match vm-summary-uninteresting-senders |
182 | + (vm-su-from (car vm-message-pointer)))) |
183 | + "End of message %s to %.50s..." |
184 | + "End of message %s from %.50s...") |
185 | + (vm-number-of (car vm-message-pointer)) |
186 | + (vm-summary-sprintf "%F" (car vm-message-pointer))))) |
187 | +>>>>>>> MERGE-SOURCE |
188 | |
189 | ;;;###autoload |
190 | (defun vm-scroll-backward (&optional arg) |
191 | @@ -750,8 +763,12 @@ |
192 | (vm-unread-flag (car vm-message-pointer))) |
193 | (vm-run-message-hook (car vm-message-pointer) |
194 | 'vm-select-unread-message-hook))) |
195 | +<<<<<<< TREE |
196 | |
197 | ;; 3. prepare the Presentation buffer |
198 | +======= |
199 | + |
200 | +>>>>>>> MERGE-SOURCE |
201 | (vm-narrow-for-preview (not need-preview)) |
202 | (if (or vm-always-use-presentation-buffer |
203 | vm-mime-display-function |
204 | @@ -929,8 +946,9 @@ |
205 | (vm-update-summary-and-mode-line) |
206 | (vm-howl-if-eom)) |
207 | (vm-update-summary-and-mode-line))) |
208 | - (if vm-summary-toggle-thread-folding |
209 | - (vm-summary-toggle-thread-folding 1))) |
210 | + ;;(if vm-summary-toggle-thread-folding |
211 | + ;; (vm-summary-toggle-thread-folding 1)) |
212 | + ) |
213 | |
214 | ;;;###autoload |
215 | (defun vm-expose-hidden-headers () |
216 | |
217 | === modified file 'lisp/vm-summary.el' |
218 | --- lisp/vm-summary.el 2010-06-03 19:14:45 +0000 |
219 | +++ lisp/vm-summary.el 2010-07-01 17:00:54 +0000 |
220 | @@ -117,7 +117,7 @@ |
221 | argument START-POINT (a list of messages) or, if it is nil, all |
222 | the messages in the current folder." |
223 | (let ((m-list (or start-point vm-message-list)) |
224 | - mp m tr trs tre |
225 | + mp m tr trs tre ntc mmmr mmm nm |
226 | (n 0) |
227 | (modulus 10) |
228 | (do-mouse-track |
229 | @@ -158,8 +158,9 @@ |
230 | (when (and vm-summary-toggle-thread-folding |
231 | vm-summary-show-threads) |
232 | (if (= 0 (vm-thread-indentation-of m)) |
233 | - (setq tr m trs s tre e) |
234 | + (setq tr m trs s tre e ntc 0) |
235 | (save-excursion |
236 | +<<<<<<< TREE |
237 | (when (and tr trs |
238 | (progn (goto-char (1+ (vm-su-start-of tr))) |
239 | (not (looking-at "-")))) |
240 | @@ -176,6 +177,48 @@ |
241 | (message "Generating summary... %d" n) |
242 | (if debug (debug "vm-debug-summary: Generating summary")) |
243 | (setq debug nil))) |
244 | +======= |
245 | + (if (not tr) |
246 | + (progn |
247 | + (setq mmm (get-text-property (- (vm-su-start-of m) 3) 'vm-message)) |
248 | + (setq mmmr (get-text-property (+ (vm-su-start-of mmm) 2) 'thread-root)) |
249 | + (if mmmr (setq tr mmmr) (setq tr mmm)) |
250 | + (setq trs (vm-su-start-of tr) tre (vm-su-end-of tr)) |
251 | + ;; this sucks, do we really have to recount all of the threads |
252 | + ;; for this root message? |
253 | + (setq ntc -1) |
254 | + (setq nm (get-text-property (+ (vm-su-end-of tr) 3) 'vm-message)) |
255 | + ;;(message "next message is: %s" nm) |
256 | + (while (and (not (null nm)) (> (vm-thread-indentation-of nm) 0)) |
257 | + (setq ntc (1+ ntc)) |
258 | + (if (< (+ (vm-su-end-of nm) 3) (buffer-size)) |
259 | + (setq nm (get-text-property (+ (vm-su-end-of nm) 3) 'vm-message)) |
260 | + (setq nm nil))) |
261 | + )) |
262 | + (progn |
263 | + (when (and tr trs |
264 | + (progn (goto-char (vm-su-start-of tr)) |
265 | + (not (looking-at "-")))) |
266 | + (if (not (vm-new-flag m)) |
267 | + (put-text-property s e 'invisible t)) |
268 | + (goto-char (vm-su-start-of tr)) |
269 | + (delete-char 1) |
270 | + (insert "+")) |
271 | + (put-text-property s e 'thread-root tr) |
272 | + (setq ntc (1+ ntc)) |
273 | + (goto-char (+ (vm-su-start-of tr) 5 (- (length (vm-padded-number-of m)) 3))) |
274 | + (put-text-property (vm-su-start-of tr) (vm-su-end-of tr) 'thread-count ntc) |
275 | + (if vm-summary-show-thread-count |
276 | + (progn |
277 | + (delete-char 4) |
278 | + (insert (format "+%-3s" ntc)))) |
279 | + ))) |
280 | + )) |
281 | + (setq mp (cdr mp) n (1+ n)) |
282 | + ) |
283 | + ;;(if (zerop (% n modulus)) |
284 | + ;; (message "Generating summary... %d" n))) |
285 | +>>>>>>> MERGE-SOURCE |
286 | ;; now convert the ints to markers. |
287 | ;; no need for another message - it is fast enough |
288 | ;; (if (>= n modulus) |
289 | @@ -199,6 +242,7 @@ |
290 | (unless vm-summary-debug |
291 | (message "Generating summary... done"))))) |
292 | |
293 | +<<<<<<< TREE |
294 | (defun vm-summary-toggle-thread-folding (&optional visible) |
295 | "Toggle the thread folding at point." |
296 | (interactive) |
297 | @@ -220,6 +264,95 @@ |
298 | (insert (if i "+" "-")) |
299 | (goto-char (vm-su-start-of m)) |
300 | (delete-char 1)))))) |
301 | +======= |
302 | +(defun vm-expand-thread () |
303 | + "expand the thread associated with the message at point. This |
304 | +will make visible all invisible elements of the thread tree and |
305 | +place a '-' character at the pointer position indicated the |
306 | +thread can be collapsed." |
307 | + (interactive) |
308 | + (if (and vm-summary-toggle-thread-folding vm-summary-show-threads) |
309 | + (progn |
310 | + (vm-select-folder-buffer) |
311 | + (vm-follow-folders-summary-cursor) |
312 | + (set-buffer vm-summary-buffer) |
313 | + (let ((buffer-read-only nil) |
314 | + r nm |
315 | + ) |
316 | + (setq r (get-text-property (+ (point) 3) 'thread-root)) |
317 | + (if (null r) |
318 | + (setq r (get-text-property (+ (point) 3) 'vm-message))) |
319 | + (save-excursion |
320 | + (goto-char (vm-su-start-of r)) |
321 | + (insert "-") |
322 | + (delete-char 1) |
323 | + ) |
324 | + (setq nm (get-text-property (+ (vm-su-end-of r) 2) 'vm-message)) |
325 | + (while (and (not (null nm)) (> (vm-thread-indentation-of nm) 0) ) |
326 | + (put-text-property (vm-su-start-of nm) (vm-su-end-of nm) 'invisible nil) |
327 | + (if (< (+ (vm-su-end-of nm) 2) (buffer-size)) |
328 | + (setq nm (get-text-property (+ (vm-su-end-of nm) 2) 'vm-message)) |
329 | + (setq nm nil))))))) |
330 | + |
331 | +(defun vm-collapse-thread (&optional nomove) |
332 | + "collapse the thread associated with the message at point. This |
333 | +will make invisible all read and non-new elements of the thread |
334 | +tree and will place a '+' character at the pointer position |
335 | +indicating the thread can be expanded. Optional argument nomove |
336 | +directs vm-collapse-thread to not take the default action of |
337 | +moving the pointer to the thread root after collapsing." |
338 | + (interactive "P") |
339 | + (if (and vm-summary-toggle-thread-folding vm-summary-show-threads) |
340 | + (progn |
341 | + (vm-select-folder-buffer) |
342 | + (vm-follow-folders-summary-cursor) |
343 | + (set-buffer vm-summary-buffer) |
344 | + (let ((buffer-read-only nil) |
345 | + r nm |
346 | + ) |
347 | + (setq r (get-text-property (+ (point) 3) 'thread-root)) |
348 | + (if (null r) |
349 | + (setq r (get-text-property (+ (point) 3) 'vm-message))) |
350 | + (save-excursion |
351 | + (goto-char (vm-su-start-of r)) |
352 | + (insert "+") |
353 | + (delete-char 1) |
354 | + ) |
355 | + (if (< (+ (vm-su-end-of r) 3) (buffer-size)) |
356 | + (progn |
357 | + (setq nm (get-text-property (+ (vm-su-end-of r) 3) 'vm-message)) |
358 | + (while (and (not (null nm)) (> (vm-thread-indentation-of nm) 0)) |
359 | + (if (not (vm-new-flag nm)) |
360 | + (put-text-property (vm-su-start-of nm) (vm-su-end-of nm) 'invisible t)) |
361 | + (if (< (+ (vm-su-end-of nm) 3) (buffer-size)) |
362 | + (setq nm (get-text-property (+ (vm-su-end-of nm) 3) 'vm-message)) (setq nm nil)) |
363 | + ) |
364 | + )) |
365 | + ;; move to the parent thread |
366 | + (if (not nomove) |
367 | + (progn |
368 | + (vm-select-folder-buffer) |
369 | + (vm-goto-message (string-to-number (vm-number-of r))))))))) |
370 | + |
371 | +(defun vm-toggle-expand-thread () |
372 | + "toggle collapse/expand thread associated with message at point. |
373 | +see vm-expand-thread and vm-collapse thread for a description of |
374 | +action." |
375 | + (interactive) |
376 | + (if (and vm-summary-toggle-thread-folding vm-summary-show-threads) |
377 | + (progn |
378 | + (vm-select-folder-buffer) |
379 | + (vm-follow-folders-summary-cursor) |
380 | + (set-buffer vm-summary-buffer) |
381 | + (let ((buffer-read-only nil) |
382 | + r nm |
383 | + ) |
384 | + (setq r (get-text-property (+ (point) 3) 'thread-root)) |
385 | + (if (null r) |
386 | + (setq r (get-text-property (+ (point) 3) 'vm-message))) |
387 | + (goto-char (vm-su-start-of r)) |
388 | + (if (looking-at "-") (vm-collapse-thread) (vm-expand-thread)))))) |
389 | +>>>>>>> MERGE-SOURCE |
390 | |
391 | (defun vm-do-needed-summary-rebuild () |
392 | "Rebuild the summary lines of all the messages starting at |
393 | @@ -257,6 +390,7 @@ |
394 | (setq summary (vm-su-summary m)) |
395 | (set-buffer (marker-buffer (vm-su-start-of m))) |
396 | (let ((buffer-read-only nil) |
397 | + n s e r i |
398 | (selected nil) |
399 | (modified (buffer-modified-p))) |
400 | (unwind-protect |
401 | @@ -282,11 +416,17 @@ |
402 | ;; pushes the point marker into the next |
403 | ;; summary entry. We achieve (1) by inserting a |
404 | ;; placeholder character at the end of the |
405 | - ;; summary entry before deleting the region. |
406 | + ;; summary entry before deleting the region. |
407 | (goto-char (vm-su-end-of m)) |
408 | (insert-before-markers "z") |
409 | (goto-char (vm-su-start-of m)) |
410 | + (setq s (vm-su-start-of m)) |
411 | + (setq e (vm-su-end-of m)) |
412 | + (setq r (get-text-property (+ s 2) 'thread-root)) |
413 | + (setq n (get-text-property (+ s 2) 'thread-count)) |
414 | + (setq i (get-text-property (+ s 2) 'invisible)) |
415 | (delete-region (point) (1- (vm-su-end-of m))) |
416 | +<<<<<<< TREE |
417 | (if vm-summary-toggle-thread-folding |
418 | ;; Rob's thread-folding version |
419 | (if (not selected) |
420 | @@ -308,9 +448,29 @@ |
421 | (if (not selected) |
422 | (insert vm-summary-no-=>) |
423 | (insert vm-summary-=>))) |
424 | +======= |
425 | + (if (not selected) |
426 | + (if (not (get-text-property (point) 'thread-end)) |
427 | + (insert vm-summary-no-=>) |
428 | + (if (get-text-property (1+ (vm-su-end-of vm-summary-pointer)) |
429 | + 'invisible) |
430 | + (insert "x ") |
431 | + (insert "u "))) |
432 | + (if (not (get-text-property (point) 'thread-end)) |
433 | + (insert vm-summary-=>) |
434 | + (if (get-text-property (1+ (vm-su-end-of vm-summary-pointer)) |
435 | + 'invisible) |
436 | + (insert "x>") |
437 | + (insert "y>")))) |
438 | +>>>>>>> MERGE-SOURCE |
439 | (vm-tokenized-summary-insert m (vm-su-summary m)) |
440 | - (delete-char 1) |
441 | - (run-hooks 'vm-summary-update-hook) |
442 | + (delete-char 1) |
443 | + (if (and n vm-summary-show-thread-count) |
444 | + (progn |
445 | + (goto-char (+ (vm-su-start-of m) 5 (- (length (vm-padded-number-of m)) 3))) |
446 | + (delete-char 4) |
447 | + (insert (format "+%-3s" n)))) |
448 | + (run-hooks 'vm-summary-update-hook) |
449 | (and do-mouse-track |
450 | (vm-mouse-set-mouse-track-highlight |
451 | (vm-su-start-of m) |
452 | @@ -319,7 +479,13 @@ |
453 | (if (and selected vm-summary-highlight-face) |
454 | (vm-summary-highlight-region (vm-su-start-of m) (point) |
455 | vm-summary-highlight-face))) |
456 | - (set-buffer-modified-p modified))))))) |
457 | + (set-buffer-modified-p modified) |
458 | + (if (not (null r)) |
459 | + (put-text-property s e 'thread-root r) |
460 | + (put-text-property s e 'thread-count n)) |
461 | + (put-text-property s e 'vm-message m) |
462 | + (put-text-property s e 'invisible i) |
463 | + )))))) |
464 | |
465 | (defun vm-set-summary-pointer (m) |
466 | (if vm-summary-buffer |
467 | @@ -329,6 +495,7 @@ |
468 | (vm-mouse-support-possible-p))) |
469 | (old-window nil)) |
470 | (vm-save-buffer-excursion |
471 | +<<<<<<< TREE |
472 | (unwind-protect |
473 | (progn |
474 | (set-buffer vm-summary-buffer) |
475 | @@ -381,6 +548,70 @@ |
476 | (and w vm-auto-center-summary (vm-auto-center-summary)) |
477 | (run-hooks 'vm-summary-pointer-update-hook))) |
478 | (and old-window (select-window old-window))))))) |
479 | +======= |
480 | + (unwind-protect |
481 | + (progn |
482 | + (set-buffer vm-summary-buffer) |
483 | + (if w |
484 | + (progn |
485 | + (setq old-window (selected-window)) |
486 | + (select-window w))) |
487 | + (let ((buffer-read-only nil)) |
488 | + (if (and vm-summary-pointer |
489 | + (vm-su-start-of vm-summary-pointer)) |
490 | + (progn |
491 | + (goto-char (vm-su-start-of vm-summary-pointer)) |
492 | + (if (not (get-text-property (+ (point) 3) 'invisible)) |
493 | + (progn |
494 | + (if (not (null (get-text-property (+ (point) 3) 'thread-count))) |
495 | + (if (looking-at "+") (progn (insert "+ ") (delete-char (length vm-summary-=>))) (progn (insert "- ") (delete-char (length vm-summary-=>)))) |
496 | + (progn (insert vm-summary-no-=>) |
497 | + (delete-char (length vm-summary-=>)))) |
498 | + ) |
499 | + (progn |
500 | + (delete-char (length vm-summary-=>)) |
501 | + (insert vm-summary-no-=>) |
502 | + ;; re-invisible it so we dont have problems |
503 | + (put-text-property (- (point) (length vm-summary-no-=>)) (point) 'invisible t) |
504 | + ) |
505 | + ) |
506 | + (and do-mouse-track |
507 | + (vm-mouse-set-mouse-track-highlight |
508 | + (vm-su-start-of vm-summary-pointer) |
509 | + (vm-su-end-of vm-summary-pointer) |
510 | + (vm-su-summary-mouse-track-overlay-of |
511 | + vm-summary-pointer))))) |
512 | + (setq vm-summary-pointer m) |
513 | + (goto-char (vm-su-start-of m)) |
514 | + (let ((modified (buffer-modified-p))) |
515 | + (unwind-protect |
516 | + (progn |
517 | + |
518 | + ;; (if (not (get-text-property (point) 'thread-end)) |
519 | + ;; (insert vm-summary-=>) |
520 | + ;; (if (get-text-property (+ (vm-su-end-of vm-summary-pointer) 2) |
521 | + ;; 'invisible) |
522 | + ;; (insert "+>") |
523 | + ;; (insert "->"))) |
524 | + (if (and (< (+ (vm-su-end-of m) 3) (buffer-size)) (get-text-property (+ (vm-su-end-of m) 3) 'invisible)) |
525 | + (insert "+>") |
526 | + (insert vm-summary-=>)) |
527 | + (delete-char (length vm-summary-=>)) |
528 | + |
529 | + (and do-mouse-track |
530 | + (vm-mouse-set-mouse-track-highlight |
531 | + (vm-su-start-of m) (vm-su-end-of m) |
532 | + (vm-su-summary-mouse-track-overlay-of m)))) |
533 | + (set-buffer-modified-p modified))) |
534 | + (forward-char (- (length vm-summary-=>))) |
535 | + (if vm-summary-highlight-face |
536 | + (vm-summary-highlight-region |
537 | + (vm-su-start-of m) (vm-su-end-of m) |
538 | + vm-summary-highlight-face)) |
539 | + (and w vm-auto-center-summary (vm-auto-center-summary)) |
540 | + (run-hooks 'vm-summary-pointer-update-hook))) |
541 | + (and old-window (select-window old-window))))))) |
542 | +>>>>>>> MERGE-SOURCE |
543 | |
544 | (defun vm-summary-highlight-region (start end face) |
545 | (vm-summary-xxxx-highlight-region start end face 'vm-summary-overlay)) |
546 | @@ -510,7 +741,16 @@ |
547 | (- end start)))))))) |
548 | (setq group-list (cdr group-list)))) |
549 | ((eq token 'number) |
550 | - (insert (vm-padded-number-of message))) |
551 | + (let (mynum) |
552 | + (if (and vm-summary-show-thread-count vm-summary-toggle-thread-folding vm-summary-show-threads) |
553 | + (if (> (vm-th-thread-indentation message) 0) |
554 | + (setq mynum (concat " " (vm-padded-number-of message) " ")) (setq mynum (concat (vm-padded-number-of message) " ")) |
555 | + ) |
556 | + (setq mynum (vm-padded-number-of message)) |
557 | + ) |
558 | + (insert mynum) |
559 | + ) |
560 | + ) |
561 | ((eq token 'mark) |
562 | (insert (vm-su-mark message))) |
563 | ((eq token 'thread-indent) |
564 | @@ -1773,6 +2013,7 @@ |
565 | (delete-region (point) (1- (vm-fs-end-of fs))) |
566 | (insert |
567 | (vm-folders-summary-sprintf vm-folders-summary-format fs)) |
568 | + |
569 | (delete-char 1) |
570 | (and do-mouse-track |
571 | (vm-mouse-set-mouse-track-highlight |
572 | |
573 | === modified file 'lisp/vm-vars.el' |
574 | --- lisp/vm-vars.el 2010-06-27 09:45:03 +0000 |
575 | +++ lisp/vm-vars.el 2010-07-01 17:00:54 +0000 |
576 | @@ -4834,6 +4834,7 @@ |
577 | (define-key map "\M-W" 'vm-show-no-warranty) |
578 | (define-key map "\C-c\C-s" 'vm-mime-save-all-attachments) |
579 | (define-key map "\C-c\C-d" 'vm-mime-delete-all-attachments) |
580 | + (define-key map "T" 'vm-toggle-expand-thread) |
581 | ;; suppress-keymap provides these, but now that we don't use |
582 | ;; suppress-keymap anymore... |
583 | (define-key map "0" 'digit-argument) |
584 | @@ -4865,6 +4866,18 @@ |
585 | "Enables folding of threads in VM summary windows. (This |
586 | functionality is highly experimental!)") |
587 | |
588 | +(defvar vm-summary-show-thread-count t |
589 | + "when set to 't' and thread folding is enabled (see |
590 | +vm-summary-toggle-thread-folding) this will display the current |
591 | +number of thread in the thread root message number indicator. |
592 | +Note that this takes up 4 extra character in your summary") |
593 | + |
594 | +(defvar vm-summary-thread-folding-on-motion nil |
595 | + "when set to 't' and thread folding is enabled, calling |
596 | +vm-next/previous-message-no-skip will ('N' or 'P' respectively) |
597 | +will expand or collapse the thread upon moving into or out of |
598 | +its extreme most members") |
599 | + |
600 | (defvar vm-summary-mode-map vm-mode-map |
601 | "Keymap for VM Summary mode") |
602 | |
603 | |
604 | === modified file 'lisp/vm-version.el' |
605 | --- lisp/vm-version.el 2010-05-23 09:36:08 +0000 |
606 | +++ lisp/vm-version.el 2010-07-01 17:00:54 +0000 |
607 | @@ -32,6 +32,8 @@ |
608 | (defun vm-version () |
609 | "Return the value of the variable `vm-version'." |
610 | (interactive) |
611 | + (if (not vm-version) |
612 | + (setq vm-version "None")) |
613 | (when (interactive-p) |
614 | (or (and (stringp vm-version) |
615 | (string-match "[0-9]" vm-version)) |
Dear Arik,
Thanks very much for all your good work! I have tested your additions functions. I have also added a page in
quite strenusously, and they looked quite solid. So, I have now
merged them into the trunk. I have made a few changes along the way,
including renaming variables/
the "Summaries" chapter of the info manual. If you look at this page,
you will get a quick summary of the changes I made.
I have logged on Launchpad a few problems that I have found as bug
reports. I will now assign them to you.
I have also added you to the VM development team. I am hoping that
this will enable you to make changes to the trunk and check them in.
If it doesn't allow it, then you can always make a personal branch and
we can merge the changes later.
Cheers,
Uday
Arik writes:
> Arik has proposed merging lp:~akwm/vm/thread-folding into lp:vm. Expand/ Collapse functions exist for flexibility, and indicator /code.launchpad .net/~akwm/ vm/thread- folding/ +merge/ 29020
>
> Requested reviews:
> Uday (uday)
>
>
> Adding thread folding to the normal thread view in summary. Options include
> showing number of threads at root message indicator along with folding on
> movement. Toggle/
> in the first cursor position shows toggle state.
>
> New messages always display, allowing long conversations to take up less space
> in mailbox yet still remain in focus. Default binding to "T" for toggling
> thread fold state is simple and obvious. Is option controlled so does not
> affect summary both when not viewing in thread mode or when it's own master
> switch is off, i.e. changes here are available but not required.
> --
> https:/
> You are subscribed to branch lp:vm.
>