annotate lisp/vm/vm-message.el @ 36:c53a95d3c46d r19-15b101

Import from CVS: tag r19-15b101
author cvs
date Mon, 13 Aug 2007 08:53:38 +0200
parents 859a2309aef8
children 131b0175ea99
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 ;;; Macros and functions dealing with accessing VM message struct fields
20
859a2309aef8 Import from CVS: tag r19-15b93
cvs
parents: 0
diff changeset
2 ;;; Copyright (C) 1989-1997 Kyle E. Jones
0
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-message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; data that is always shared with virtual folders
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 (defmacro vm-location-data-of (message) (list 'aref message 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;; where message begins starting at the message separator in the folder
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 (defmacro vm-start-of (message) (list 'aref (list 'aref message 0) 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;; where headers start (From_ line)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 (defmacro vm-headers-of (message) (list 'aref (list 'aref message 0) 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ;; where visible headers start
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 (defun vm-vheaders-of (message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 (or (aref (aref message 0) 2)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 (progn (vm-reorder-message-headers message nil nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 (aref (aref message 0) 2))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 ;; where text section starts
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 (defun vm-text-of (message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 (or (aref (aref message 0) 3) (progn (vm-find-and-set-text-of message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 (aref (aref message 0) 3))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 ;; where text portion of message ends
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 (defmacro vm-text-end-of (message) (list 'aref (list 'aref message 0) 4))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 ;; where message ends
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 (defmacro vm-end-of (message) (list 'aref (list 'aref message 0) 5))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 ;; soft data vector
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 (defmacro vm-softdata-of (message) (list 'aref message 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 (defmacro vm-number-of (message) (list 'aref (list 'aref message 1) 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 (defmacro vm-padded-number-of (message) (list 'aref (list 'aref message 1) 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 (defmacro vm-mark-of (message) (list 'aref (list 'aref message 1) 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 ;; start of summary line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 (defmacro vm-su-start-of (message) (list 'aref (list 'aref message 1) 3))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 ;; end of summary line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 (defmacro vm-su-end-of (message) (list 'aref (list 'aref message 1) 4))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 ;; symbol whose value is the real message.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 (defmacro vm-real-message-sym-of (message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 (list 'aref (list 'aref message 1) 5))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 ;; real message
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 (defmacro vm-real-message-of (message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 (list 'symbol-value (list 'aref (list 'aref message 1) 5)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 ;; link to previous message in the message list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 (defmacro vm-reverse-link-of (message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 (list 'symbol-value (list 'aref (list 'aref message 1) 6)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 ;; message type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 (defmacro vm-message-type-of (message) (list 'aref (list 'aref message 1) 7))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 ;; number that uniquely identifies each message
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 ;; this is for the set handling stuff
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 (defmacro vm-message-id-number-of (message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 (list 'aref (list 'aref message 1) 8))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 ;; folder buffer of this message
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 (defmacro vm-buffer-of (message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 (list 'aref (list 'aref message 1) 9))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 ;; cache thread indentation value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 (defmacro vm-thread-indentation-of (message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 (list 'aref (list 'aref message 1) 10))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 ;; list of symbols from vm-thread-obarray that give this message's lineage
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 (defmacro vm-thread-list-of (message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 (list 'aref (list 'aref message 1) 11))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 ;; babyl header frob flag (0 or 1 at beginning of message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 (defmacro vm-babyl-frob-flag-of (message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 (list 'aref (list 'aref message 1) 12))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 ;; saved attributes, if message was switched from unmirrored to mirrored
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 (defmacro vm-saved-virtual-attributes-of (message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 (list 'aref (list 'aref message 1) 13))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 ;; saved mirror data, if message was switched from unmirrored to mirrored
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 (defmacro vm-saved-virtual-mirror-data-of (message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 (list 'aref (list 'aref message 1) 14))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 ;; summary for unmirrored virtual message
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 (defmacro vm-virtual-summary-of (message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 (list 'aref (list 'aref message 1) 15))
20
859a2309aef8 Import from CVS: tag r19-15b93
cvs
parents: 0
diff changeset
84 ;; MIME layout information; types, ids, positions, etc. of all MIME entities
859a2309aef8 Import from CVS: tag r19-15b93
cvs
parents: 0
diff changeset
85 (defmacro vm-mime-layout-of (message)
859a2309aef8 Import from CVS: tag r19-15b93
cvs
parents: 0
diff changeset
86 (list 'aref (list 'aref message 1) 16))
859a2309aef8 Import from CVS: tag r19-15b93
cvs
parents: 0
diff changeset
87 (defmacro vm-mime-encoded-header-flag-of (message)
859a2309aef8 Import from CVS: tag r19-15b93
cvs
parents: 0
diff changeset
88 (list 'aref (list 'aref message 1) 17))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 ;; message attribute vector
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 (defmacro vm-attributes-of (message) (list 'aref message 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 (defmacro vm-new-flag (message) (list 'aref (list 'aref message 2) 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 (defmacro vm-unread-flag (message) (list 'aref (list 'aref message 2) 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 (defmacro vm-deleted-flag (message) (list 'aref (list 'aref message 2) 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 (defmacro vm-filed-flag (message) (list 'aref (list 'aref message 2) 3))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 (defmacro vm-replied-flag (message) (list 'aref (list 'aref message 2) 4))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 (defmacro vm-written-flag (message) (list 'aref (list 'aref message 2) 5))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 (defmacro vm-forwarded-flag (message) (list 'aref (list 'aref message 2) 6))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 (defmacro vm-edited-flag (message) (list 'aref (list 'aref message 2) 7))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 (defmacro vm-redistributed-flag (message) (list 'aref (list 'aref message 2) 8))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 ;; message cached data
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 (defmacro vm-cache-of (message) (list 'aref message 3))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 ;; message size in bytes (as a string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 (defmacro vm-byte-count-of (message) (list 'aref (list 'aref message 3) 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 ;; weekday sent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 (defmacro vm-weekday-of (message) (list 'aref (list 'aref message 3) 1))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 ;; month day
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 (defmacro vm-monthday-of (message) (list 'aref (list 'aref message 3) 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 ;; month sent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 (defmacro vm-month-of (message) (list 'aref (list 'aref message 3) 3))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 ;; year sent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 (defmacro vm-year-of (message) (list 'aref (list 'aref message 3) 4))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 ;; hour sent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 (defmacro vm-hour-of (message) (list 'aref (list 'aref message 3) 5))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 ;; timezone
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 (defmacro vm-zone-of (message) (list 'aref (list 'aref message 3) 6))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 ;; message author's full name (Full-Name: or gouged from From:)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 (defmacro vm-full-name-of (message) (list 'aref (list 'aref message 3) 7))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 ;; message author address (gouged from From:)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 (defmacro vm-from-of (message) (list 'aref (list 'aref message 3) 8))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 ;; message ID (Message-Id:)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 (defmacro vm-message-id-of (message) (list 'aref (list 'aref message 3) 9))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 ;; number of lines in message (as a string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 (defmacro vm-line-count-of (message) (list 'aref (list 'aref message 3) 10))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 ;; message subject (Subject:)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 (defmacro vm-subject-of (message) (list 'aref (list 'aref message 3) 11))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 ;; Regexp that can be used to find the start of the already ordered headers.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 (defmacro vm-vheaders-regexp-of (message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 (list 'aref (list 'aref message 3) 12))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 ;; Addresses of recipients in a comma separated list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 (defmacro vm-to-of (message) (list 'aref (list 'aref message 3) 13))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 ;; Full names of recipients in a comma separated list. Addresses if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 ;; full names not available.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 (defmacro vm-to-names-of (message) (list 'aref (list 'aref message 3) 14))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 ;; numeric month sent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 (defmacro vm-month-number-of (message) (list 'aref (list 'aref message 3) 15))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 ;; sortable date string (used for easy sorting, naturally)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 (defmacro vm-sortable-datestring-of (message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 (list 'aref (list 'aref message 3) 16))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 ;; sortable subject, re: garbage removed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 (defmacro vm-sortable-subject-of (message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 (list 'aref (list 'aref message 3) 17))
36
c53a95d3c46d Import from CVS: tag r19-15b101
cvs
parents: 20
diff changeset
142 ;; tokenized summary entry
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 (defmacro vm-summary-of (message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 (list 'aref (list 'aref message 3) 18))
36
c53a95d3c46d Import from CVS: tag r19-15b101
cvs
parents: 20
diff changeset
145 ;; parent of this message, as determined by threading
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 (defmacro vm-parent-of (message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 (list 'aref (list 'aref message 3) 19))
36
c53a95d3c46d Import from CVS: tag r19-15b101
cvs
parents: 20
diff changeset
148 ;; message IDs parsed from References header
c53a95d3c46d Import from CVS: tag r19-15b101
cvs
parents: 20
diff changeset
149 (defmacro vm-references-of (message)
c53a95d3c46d Import from CVS: tag r19-15b101
cvs
parents: 20
diff changeset
150 (list 'aref (list 'aref message 3) 20))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 ;; extra data shared by virtual messages if vm-virtual-mirror is non-nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 (defmacro vm-mirror-data-of (message) (list 'aref message 4))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 ;; if message is being edited, this is the buffer being used.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 (defmacro vm-edit-buffer-of (message) (list 'aref (list 'aref message 4) 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 ;; list of virtual messages mirroring the underlying real message
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 (defmacro vm-virtual-messages-of (message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 (list 'symbol-value (list 'aref (list 'aref message 4) 1)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 ;; modification flag for this message
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 ;; nil if all attribute changes have been stuffed into the folder buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 (defmacro vm-modflag-of (message) (list 'aref (list 'aref message 4) 2))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 ;; list of labels attached to this message
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 (defmacro vm-labels-of (message) (list 'aref (list 'aref message 4) 3))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 ;; comma list of labels
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 (defmacro vm-label-string-of (message) (list 'aref (list 'aref message 4) 4))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 (defmacro vm-set-location-data-of (message vdata) (list 'aset message 0 vdata))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 (defmacro vm-set-start-of (message start)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 (list 'aset (list 'aref message 0) 0 start))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 (defmacro vm-set-headers-of (message h)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 (list 'aset (list 'aref message 0) 1 h))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 (defmacro vm-set-vheaders-of (message vh)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 (list 'aset (list 'aref message 0) 2 vh))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 (defmacro vm-set-text-of (message text)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 (list 'aset (list 'aref message 0) 3 text))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 (defmacro vm-set-text-end-of (message text)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 (list 'aset (list 'aref message 0) 4 text))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 (defmacro vm-set-end-of (message end)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 (list 'aset (list 'aref message 0) 5 end))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 (defmacro vm-set-softdata-of (message data)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 (list 'aset message 1 data))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 (defmacro vm-set-number-of (message n)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 (list 'aset (list 'aref message 1) 0 n))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 (defmacro vm-set-padded-number-of (message n)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 (list 'aset (list 'aref message 1) 1 n))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 (defmacro vm-set-mark-of (message val)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 (list 'aset (list 'aref message 1) 2 val))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 (defmacro vm-set-su-start-of (message pos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 (list 'aset (list 'aref message 1) 3 pos))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 (defmacro vm-set-su-end-of (message pos)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 (list 'aset (list 'aref message 1) 4 pos))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 (defmacro vm-set-real-message-sym-of (message sym)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 (list 'aset (list 'aref message 1) 5 sym))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 (defmacro vm-set-reverse-link-of (message link)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 (list 'set (list 'aref (list 'aref message 1) 6) link))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 (defmacro vm-set-reverse-link-sym-of (message sym)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 (list 'aset (list 'aref message 1) 6 sym))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 (defmacro vm-set-message-type-of (message type)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 (list 'aset (list 'aref message 1) 7 type))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 (defmacro vm-set-message-id-number-of (message number)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 (list 'aset (list 'aref message 1) 8 number))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 (defmacro vm-set-buffer-of (message buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 (list 'aset (list 'aref message 1) 9 buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 (defmacro vm-set-thread-indentation-of (message val)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 (list 'aset (list 'aref message 1) 10 val))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 (defmacro vm-set-thread-list-of (message list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 (list 'aset (list 'aref message 1) 11 list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 (defmacro vm-set-babyl-frob-flag-of (message flag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 (list 'aset (list 'aref message 1) 12 flag))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 (defmacro vm-set-saved-virtual-attributes-of (message attrs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 (list 'aset (list 'aref message 1) 13 attrs))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 (defmacro vm-set-saved-virtual-mirror-data-of (message data)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 (list 'aset (list 'aref message 1) 14 data))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 (defmacro vm-set-virtual-summary-of (message summ)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 (list 'aset (list 'aref message 1) 15 summ))
20
859a2309aef8 Import from CVS: tag r19-15b93
cvs
parents: 0
diff changeset
215 (defmacro vm-set-mime-layout-of (message layout)
859a2309aef8 Import from CVS: tag r19-15b93
cvs
parents: 0
diff changeset
216 (list 'aset (list 'aref message 1) 16 layout))
859a2309aef8 Import from CVS: tag r19-15b93
cvs
parents: 0
diff changeset
217 (defmacro vm-set-mime-encoded-header-flag-of (message flag)
859a2309aef8 Import from CVS: tag r19-15b93
cvs
parents: 0
diff changeset
218 (list 'aset (list 'aref message 1) 17 flag))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 (defmacro vm-set-attributes-of (message attrs) (list 'aset message 2 attrs))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 ;; The other routines in attributes group are part of the undo system.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 (defun vm-set-edited-flag-of (message flag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 (aset (aref message 2) 7 flag)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 (vm-mark-for-summary-update message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 (if (eq vm-flush-interval t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 (vm-stuff-virtual-attributes message)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 (vm-set-modflag-of message t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 (and (not (buffer-modified-p)) (vm-set-buffer-modified-p t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 (vm-clear-modification-flag-undos))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 (defmacro vm-set-cache-of (message cache) (list 'aset message 3 cache))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 (defmacro vm-set-byte-count-of (message count)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 (list 'aset (list 'aref message 3) 0 count))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 (defmacro vm-set-weekday-of (message val)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 (list 'aset (list 'aref message 3) 1 val))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 (defmacro vm-set-monthday-of (message val)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 (list 'aset (list 'aref message 3) 2 val))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 (defmacro vm-set-month-of (message val)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 (list 'aset (list 'aref message 3) 3 val))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 (defmacro vm-set-year-of (message val)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 (list 'aset (list 'aref message 3) 4 val))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 (defmacro vm-set-hour-of (message val)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 (list 'aset (list 'aref message 3) 5 val))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 (defmacro vm-set-zone-of (message val)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 (list 'aset (list 'aref message 3) 6 val))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 (defmacro vm-set-full-name-of (message author)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 (list 'aset (list 'aref message 3) 7 author))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 (defmacro vm-set-from-of (message author)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 (list 'aset (list 'aref message 3) 8 author))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 (defmacro vm-set-message-id-of (message id)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 (list 'aset (list 'aref message 3) 9 id))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 (defmacro vm-set-line-count-of (message count)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 (list 'aset (list 'aref message 3) 10 count))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 (defmacro vm-set-subject-of (message subject)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 (list 'aset (list 'aref message 3) 11 subject))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 (defmacro vm-set-vheaders-regexp-of (message regexp)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 (list 'aset (list 'aref message 3) 12 regexp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 (defmacro vm-set-to-of (message recips)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 (list 'aset (list 'aref message 3) 13 recips))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 (defmacro vm-set-to-names-of (message recips)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 (list 'aset (list 'aref message 3) 14 recips))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 (defmacro vm-set-month-number-of (message val)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 (list 'aset (list 'aref message 3) 15 val))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 (defmacro vm-set-sortable-datestring-of (message val)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 (list 'aset (list 'aref message 3) 16 val))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 (defmacro vm-set-sortable-subject-of (message val)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 (list 'aset (list 'aref message 3) 17 val))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 (defmacro vm-set-summary-of (message val)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 (list 'aset (list 'aref message 3) 18 val))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 (defmacro vm-set-parent-of (message val)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 (list 'aset (list 'aref message 3) 19 val))
36
c53a95d3c46d Import from CVS: tag r19-15b101
cvs
parents: 20
diff changeset
270 (defmacro vm-set-references-of (message val)
c53a95d3c46d Import from CVS: tag r19-15b101
cvs
parents: 20
diff changeset
271 (list 'aset (list 'aref message 3) 20 val))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 (defmacro vm-set-mirror-data-of (message data)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 (list 'aset message 4 data))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 (defmacro vm-set-edit-buffer-of (message buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 (list 'aset (list 'aref message 4) 0 buf))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 (defmacro vm-set-virtual-messages-of (message list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 (list 'set (list 'aref (list 'aref message 4) 1) list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 (defmacro vm-set-virtual-messages-sym-of (message sym)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 (list 'aset (list 'aref message 4) 1 sym))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 (defmacro vm-set-modflag-of (message val)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 (list 'aset (list 'aref message 4) 2 val))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 (defmacro vm-set-labels-of (message labels)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 (list 'aset (list 'aref message 4) 3 labels))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 (defmacro vm-set-label-string-of (message string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 (list 'aset (list 'aref message 4) 4 string))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 (defun vm-make-message ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 (let ((v (make-vector 5 nil)) sym)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 (vm-set-softdata-of v (make-vector vm-softdata-vector-length nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 (vm-set-location-data-of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 v (make-vector vm-location-data-vector-length nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 (vm-set-mirror-data-of v (make-vector vm-mirror-data-vector-length nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 (vm-set-message-id-number-of v (int-to-string vm-message-id-number))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 (vm-increment vm-message-id-number)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 (vm-set-buffer-of v (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 ;; We use an uninterned symbol here as a level of indirection
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 ;; from a purely self-referential structure. This is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298 ;; necessary so that Emacs debugger can be used on this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 ;; program.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 (setq sym (make-symbol "<<>>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 (set sym v)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 (vm-set-real-message-sym-of v sym)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 ;; Another uninterned symbol for the virtual messages list.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 (setq sym (make-symbol "<v>"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 (set sym nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 (vm-set-virtual-messages-sym-of v sym)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 ;; Another uninterned symbol for the reverse link
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 ;; into the message list.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 (setq sym (make-symbol "<--"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 (vm-set-reverse-link-sym-of v sym)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 v ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 (defun vm-find-and-set-text-of (m)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 (set-buffer (vm-buffer-of m))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 (save-restriction
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 (widen)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 (goto-char (vm-headers-of m))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 (search-forward "\n\n" (vm-text-end-of m) 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 (vm-set-text-of m (point-marker)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 (defun vm-virtual-message-p (m)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 (not (eq m (vm-real-message-of m))))