Debian Codegraph @

00api

raw
1 <API>
2 Kazu Yamamoto
3 Feb 16, 2004
4
5 ---
6 * '"'
7
8 A command specified by '"' is called with "Grep pattern" and file
9 names of the messages in the directory of a target folder. "Grep
10 pattern" is encoded according to 'mew-cs-database-for-arg'.
11
12 The command must produce output whose lines start with a file name of
13 matched messages. It's OK if the same file name appears multiple
14 times.
15
16 10: xxx pattern xxx
17 10: yyy pattern yyy
18 21: zzz pattern zzz
19
20 ---
21 * mew-scan-form-*
22
23 A symbol, say 'symb', in 'mew-scan-form' means to call the function
24 'mew-scan-form-symb'. Read the document of 'mew-scan-form' for more
25 information. This function MUST return a string.
26
27 mew-scan-form-* can use some functions (MEW-FOO) and variables (TOTAL,
28 WIDTH).
29
30 Users customizable variables are 'mew-scan-fields' and
31 'mew-scan-fields-alias'.
32
33 'mew-scan-fields' MUST start with ("Folder:" "Filename:"). (nthcdr 2
34 mew-scan-fields) passed to "mewl" and 'mew-vec', which contains each
35 value of field in 'mew-scan-fields', is created.
36
37 Each element of 'mew-scan-fields-alias' is corresponding to an element
38 of 'mew-scan-fields', respectively. Functions called MEW-FOO is
39 defined according to 'mew-scan-fields-alias'.
40
41 e.g.
42 (MEW-SUBJ) returns the value of Subject:
43 ;; MEW-SUBJ is defined as (aref mew-vec 3)
44
45 Pre-defined functions are:
46 MEW-FLD - Folder:
47 MEW-NUM - Filename:
48 MEW-SUBJ - Subject:
49 MEW-DATE - Date:
50 MEW-FROM - From:
51 MEW-TO - To:
52 MEW-CT - Content-Type:
53 MEW-ID - Message-ID:
54 MEW-UIDL - X-Mew-UIDL:
55
56 To get a size in X-Mew-UIDL:, call (mew-scan-get-size (MEW-UIDL)).
57 To get a uidl in X-Mew-UIDL:, call (mew-scan-get-uidl (MEW-UIDL)).
58
59 Also, two local variables are available:
60 TOTAL - the current total width
61 WIDTH - the width
62
63 After you change both 'mew-scan-fields' and 'mew-scan-fields-alias',
64 call 'mew-status-update' ("Z" in Summary mode).
65
66 ---
67 * Local mailbox
68
69 Mew uses POP to retrieve messages. If you want to retrieve them from a
70 local mailbox, set 'mew-mailbox-type' to 'mbox.
71
72 (setq mew-mailbox-type 'mbox)
73
74 In this case, Mew executes "mewl" with 'mew-mbox-command' and
75 'mew-mbox-command-arg'.
76
77 mewl -e mew-mbox-command -m mew-mbox-command-arg +folder
78
79 "mewl" then executes 'mew-mbox-command' like this:
80
81 mew-mbox-command mew-mbox-command-arg +folder
82
83 Note that 'mew-mbox-command' is executed in the destination directory
84 (e.g. +folder). So, 'mew-mbox-command' need not to expand/analysis the
85 destination folder string.
86
87 Note also that you can specifies a source of messages (i.e. local
88 mailbox) in 'mew-mbox-command-arg'. (The source need not to be the
89 folder format. Just a path is enough.)
90
91 'mew-mbox-command' MUST be move a message to the destination, then
92 print its file name (a message number) to stdout. Repeat this cycle
93 until the mailbox becomes empty.
94
95 "mewl" reads stdin, extracts a message number, opens the message,
96 then prints necessary fields. The extraction of a message number is
97 performed like "^[\t]*\\([0-9]+=\\)".
98
99 It is emphasized that 'mew-mbox-command' MUST print a resulting
100 message number just after it moves the corresponding file so that
101 "mewl" prints necessary fields immediately. It is a quite bad idea
102 that 'mew-mbox-command' moves all files first, then prints all message
103 numbers.
104
105 An example:
106
107 (setq mew-mbox-command "inc")
108 (setq mew-mbox-command-arg "-truncate -file /var/mail/user")
109
110 The image of this example is as follows:
111
112 mewl -e inc -m '-truncate -file /var/mail/user' +inbox
113 v
114 (fork)
115 v
116 inc -truncate -file /var/mail/user +inbox | mewl
117
118 ---