annotate lisp/vm/vm-mark.el @ 0:376386a54a3c r19-14

Import from CVS: tag r19-14
author cvs
date Mon, 13 Aug 2007 08:45:50 +0200
parents
children 859a2309aef8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; Commands for handling messages marks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;;; Copyright (C) 1990, 1993, 1994 Kyle E. Jones
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;;; This program is free software; you can redistribute it and/or modify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;;; it under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;;; the Free Software Foundation; either version 1, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;;; This program is distributed in the hope that it will be useful,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;;; GNU General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;;; You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;;; along with this program; if not, write to the Free Software
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 (provide 'vm-mark)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 (defun vm-clear-all-marks ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 "Removes all message marks in the current folder."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 (vm-select-folder-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 (vm-check-for-killed-summary)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 (vm-error-if-folder-empty)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 (let ((mp vm-message-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 (while mp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 (if (vm-mark-of (car mp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 (vm-set-mark-of (car mp) nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 (vm-mark-for-summary-update (car mp) t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 (setq mp (cdr mp))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 (vm-display nil nil '(vm-clear-all-marks)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 '(vm-clear-all-marks marking-message))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 (vm-update-summary-and-mode-line))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 (defun vm-mark-all-messages ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 "Mark all messages in the current folder."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 (vm-select-folder-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 (vm-check-for-killed-summary)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 (vm-error-if-folder-empty)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 (let ((mp vm-message-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 (while mp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 (vm-set-mark-of (car mp) t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 (vm-mark-for-summary-update (car mp) t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 (setq mp (cdr mp))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 (vm-display nil nil '(vm-mark-all-messages)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 '(vm-mark-all-messages marking-message))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 (vm-update-summary-and-mode-line))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 (defun vm-mark-message (count)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 "Mark the current message.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 Numeric prefix argument N means mark the current message and the next
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 N-1 messages. A negative N means mark the current message and the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 previous N-1 messages."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 (interactive "p")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 (if (interactive-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 (vm-follow-summary-cursor))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 (vm-select-folder-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 (vm-check-for-killed-summary)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 (vm-error-if-folder-empty)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 (let ((direction (if (< count 0) 'backward 'forward))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 (count (vm-abs count))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 (oldmp vm-message-pointer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 (vm-message-pointer vm-message-pointer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 (while (not (zerop count))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 (if (not (vm-mark-of (car vm-message-pointer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 (vm-set-mark-of (car vm-message-pointer) t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 (vm-mark-for-summary-update (car vm-message-pointer) t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 (vm-decrement count)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 (if (not (zerop count))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 (vm-move-message-pointer direction))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 (vm-display nil nil '(vm-mark-message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 '(vm-mark-message marking-message))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 (vm-update-summary-and-mode-line))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 (defun vm-unmark-message (count)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 "Remove the mark from the current message.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 Numeric prefix argument N means unmark the current message and the next
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 N-1 messages. A negative N means unmark the current message and the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 previous N-1 messages."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 (interactive "p")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 (if (interactive-p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 (vm-follow-summary-cursor))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 (vm-select-folder-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 (vm-check-for-killed-summary)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 (vm-error-if-folder-empty)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 (let ((mlist (vm-select-marked-or-prefixed-messages count)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 (while mlist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 (if (vm-mark-of (car mlist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 (vm-set-mark-of (car mlist) nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 (vm-mark-for-summary-update (car mlist) t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 (setq mlist (cdr mlist))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 (vm-display nil nil '(vm-unmark-message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 '(vm-unmark-message marking-message))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 (vm-update-summary-and-mode-line))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 (defun vm-mark-or-unmark-messages-with-selector (val selector arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 (let ((mlist vm-message-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 (virtual (eq major-mode 'vm-virtual-mode))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 (arglist (if arg (list arg) nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 (count 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 (setq selector (intern (concat "vm-vs-" (symbol-name selector))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 (while mlist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 (if (if virtual
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 (set-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 (vm-buffer-of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 (vm-real-message-of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 (car mlist))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 (apply selector (vm-real-message-of (car mlist)) arglist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 (apply selector (car mlist) arglist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 (vm-set-mark-of (car mlist) val)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 (vm-mark-for-summary-update (car mlist) t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 (vm-increment count)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 (setq mlist (cdr mlist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 (vm-display nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 '(vm-mark-matching-messages vm-unmark-matching-messages)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 (list this-command 'marking-message))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 (vm-update-summary-and-mode-line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 (message "%d message%s %smarked"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 count
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 (if (= 1 count) "" "s")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 (if val "" "un"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 (defun vm-mark-matching-messages (selector &optional arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 "Mark messages matching some criterion.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 You can use any of the virtual folder selectors, except for the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 `and', `or' and `not' selectors. See the documentation for the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 variable vm-virtual-folder-alist for more information."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 (interactive
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 (let ((last-command last-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 (this-command this-command))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 (vm-select-folder-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 (vm-read-virtual-selector "Mark messages: ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 (vm-select-folder-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 (vm-check-for-killed-summary)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 (vm-error-if-folder-empty)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 (vm-mark-or-unmark-messages-with-selector t selector arg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 (defun vm-unmark-matching-messages (selector &optional arg)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 "Unmark messages matching some criterion.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 You can use any of the virtual folder selectors, except for the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 `and', `or' and `not' selectors. See the documentation for the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 variable vm-virtual-folder-alist for more information."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 (interactive
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 (let ((last-command last-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 (this-command this-command))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 (vm-select-folder-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 (vm-read-virtual-selector "Unmark messages: ")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 (vm-select-folder-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 (vm-check-for-killed-summary)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 (vm-error-if-folder-empty)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 (vm-mark-or-unmark-messages-with-selector nil selector arg))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 (defun vm-mark-thread-subtree ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 "Mark all messages in the thread tree rooted at the current message."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 (vm-follow-summary-cursor)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 (vm-select-folder-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 (vm-check-for-killed-summary)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 (vm-error-if-folder-empty)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 (vm-mark-or-unmark-thread-subtree t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 (defun vm-unmark-thread-subtree ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 "Unmark all messages in the thread tree rooted at the current message."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 (vm-follow-summary-cursor)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 (vm-select-folder-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 (vm-check-for-killed-summary)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 (vm-error-if-folder-empty)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 (vm-mark-or-unmark-thread-subtree nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 (defun vm-mark-or-unmark-thread-subtree (mark)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 (vm-build-threads-if-unbuilt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 (let ((list (list (car vm-message-pointer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 (loop-obarray (make-vector 29 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 subject-sym id-sym)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 (while list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 (if (not (eq (vm-mark-of (car list)) mark))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 (vm-set-mark-of (car list) mark)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 (vm-mark-for-summary-update (car list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 (setq id-sym (car (vm-last (vm-th-thread-list (car list)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 (if (null (intern-soft (symbol-name id-sym) loop-obarray))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 (intern (symbol-name id-sym) loop-obarray)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 (nconc list (copy-sequence (get id-sym 'children)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 (setq subject-sym (intern (vm-so-sortable-subject (car list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 vm-thread-subject-obarray))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 (if (and (boundp subject-sym)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 (eq id-sym (aref (symbol-value subject-sym) 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 (nconc list (copy-sequence
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 (aref (symbol-value subject-sym) 2))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 (setq list (cdr list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 (vm-display nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 '(vm-mark-thread-subtree vm-unmark-thread-subtree)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 (list this-command 'marking-message))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 (vm-update-summary-and-mode-line))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 (defun vm-mark-messages-same-subject ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 "Mark all messages with the same subject as the current message."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 (vm-follow-summary-cursor)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 (vm-select-folder-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 (vm-check-for-killed-summary)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 (vm-error-if-folder-empty)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 (vm-mark-or-unmark-messages-same-subject t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 (defun vm-unmark-messages-same-subject ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 "Unmark all messages with the same subject as the current message."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 (vm-follow-summary-cursor)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 (vm-select-folder-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 (vm-check-for-killed-summary)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 (vm-error-if-folder-empty)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 (vm-mark-or-unmark-messages-same-subject nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 (defun vm-mark-or-unmark-messages-same-subject (mark)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 (let ((mp vm-message-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 (mark-count 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 (subject (vm-so-sortable-subject (car vm-message-pointer))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 (while mp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 (if (and (not (eq (vm-mark-of (car mp)) mark))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 (string-equal subject (vm-so-sortable-subject (car mp))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 (vm-set-mark-of (car mp) mark)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 (vm-increment mark-count)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 (vm-mark-for-summary-update (car mp) t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 (setq mp (cdr mp)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 (if (zerop mark-count)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 (message "No messages %smarked" (if mark "" "un"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 (message "%d message%s %smarked"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 mark-count
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 (if (= 1 mark-count) "" "s")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 (if mark "" "un"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 (vm-display nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 '(vm-mark-messages-same-subject
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 vm-unmark-messages-same-subject)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 (list this-command 'marking-message))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 (vm-update-summary-and-mode-line))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 (defun vm-mark-messages-same-author ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 "Mark all messages with the same author as the current message."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 (vm-follow-summary-cursor)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 (vm-select-folder-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 (vm-check-for-killed-summary)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 (vm-error-if-folder-empty)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 (vm-mark-or-unmark-messages-same-author t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 (defun vm-unmark-messages-same-author ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 "Unmark all messages with the same author as the current message."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 (vm-follow-summary-cursor)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 (vm-select-folder-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 (vm-check-for-killed-summary)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 (vm-error-if-folder-empty)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 (vm-mark-or-unmark-messages-same-author nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 (defun vm-mark-or-unmark-messages-same-author (mark)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 (let ((mp vm-message-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 (mark-count 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 (author (vm-su-from (car vm-message-pointer))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 (while mp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 (if (and (not (eq (vm-mark-of (car mp)) mark))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 (string-equal author (vm-su-from (car mp))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 (vm-set-mark-of (car mp) mark)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 (vm-increment mark-count)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 (vm-mark-for-summary-update (car mp) t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 (setq mp (cdr mp)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 (if (zerop mark-count)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 (message "No messages %smarked" (if mark "" "un"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 (message "%d message%s %smarked"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 mark-count
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 (if (= 1 mark-count) "" "s")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 (if mark "" "un"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 (vm-display nil nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 '(vm-mark-messages-same-author
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 vm-unmark-messages-same-author)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 (list this-command 'marking-message))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 (vm-update-summary-and-mode-line))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 (defun vm-next-command-uses-marks ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 "Does nothing except insure that the next VM command will operate only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 on the marked messages in the current folder."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 (setq this-command 'vm-next-command-uses-marks)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 (vm-unsaved-message "Next command uses marks...")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 (vm-display nil nil '(vm-next-command-uses-marks)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 '(vm-next-command-uses-marks)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 (defun vm-marked-messages ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 (let (list (mp vm-message-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 (while mp
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 (if (vm-mark-of (car mp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 (setq list (cons (car mp) list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 (setq mp (cdr mp)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 (nreverse list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 (defun vm-mark-help ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 (vm-display nil nil '(vm-mark-help) '(vm-mark-help))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 (message "MM = mark, MU = unmark, Mm = mark all, Mu = unmark all, MN = use marks, ..."))