173
172
(defvar mew-addrbook-switch
174
'((shortname . mew-addrbook-shortname-get)
176
(username . mew-addrstr-extract-user)
177
(nickname . mew-addrbook-nickname-get)
178
(name . mew-addrbook-name-get))
173
'((shortname mew-addrbook-shortname-get)
175
(username mew-addrstr-extract-user)
176
(nickname mew-addrbook-nickname-get)
177
(name mew-addrbook-name-get))
179
178
"Function database to get each field of Addrbook.
180
179
'shortname, 'address, 'username, 'nickname, and 'name is defined.")
182
(defsubst mew-addrbook-func (key)
183
(cdr (assq key mew-addrbook-switch)))
181
(defun mew-addrbook-func (key)
182
(mew-alist-get-value (assq key mew-addrbook-switch)))
186
184
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
191
(defsubst mew-ct-textp (ct)
189
(defun mew-ct-textp (ct)
192
190
(string-match "^Text" (capitalize ct)))
194
(defsubst mew-ct-imagep (ct)
192
(defun mew-ct-imagep (ct)
195
193
(string-match "^Image" (capitalize ct)))
197
(defsubst mew-ct-modelp (ct)
195
(defun mew-ct-modelp (ct)
198
196
(string-match "^Model" (capitalize ct)))
200
(defsubst mew-ct-multipartp (ct)
198
(defun mew-ct-multipartp (ct)
201
199
(string-match "^Multipart" (capitalize ct)))
203
(defsubst mew-ct-messagep (ct)
201
(defun mew-ct-messagep (ct)
204
202
(string-match "^Message" (capitalize ct)))
206
(defsubst mew-ct-linebasep (ct)
204
(defun mew-ct-linebasep (ct)
207
205
(or (mew-ct-textp ct)
208
206
(mew-case-equal ct mew-ct-aps)
209
207
(mew-case-equal ct mew-ct-msg))) ;; xxx mew-ct-messagep?
221
219
(defconst mew-custom-type-of-field-completion
222
'(alist key-type: string :value-type function))
220
'(list (list string function)))
224
222
(defcustom mew-field-completion-switch
225
'(("To:" . mew-complete-address)
226
("Cc:" . mew-complete-address)
227
("Dcc:" . mew-complete-address)
228
("Bcc:" . mew-complete-address)
229
("Reply-To:" . mew-complete-address)
230
("Fcc:" . mew-complete-local-folder)
231
("Resent-To:" . mew-complete-address)
232
("Resent-Cc:" . mew-complete-address)
233
("Resent-Dcc:" . mew-complete-address)
234
("Resent-Bcc:" . mew-complete-address)
235
("Resent-Fcc:" . mew-complete-local-folder)
236
("Newsgroups:" . mew-complete-newsgroups)
237
("Followup-To:" . mew-complete-newsgroups))
223
'(("To:" mew-complete-address)
224
("Cc:" mew-complete-address)
225
("Dcc:" mew-complete-address)
226
("Bcc:" mew-complete-address)
227
("Reply-To:" mew-complete-address)
228
("Fcc:" mew-complete-local-folder)
229
("Resent-To:" mew-complete-address)
230
("Resent-Cc:" mew-complete-address)
231
("Resent-Dcc:" mew-complete-address)
232
("Resent-Bcc:" mew-complete-address)
233
("Resent-Fcc:" mew-complete-local-folder)
234
("Newsgroups:" mew-complete-newsgroups)
235
("Followup-To:" mew-complete-newsgroups))
238
236
"*Completion function alist concerned with the key."
239
237
:group 'mew-complete
240
238
:type mew-custom-type-of-field-completion)
242
240
(defcustom mew-field-circular-completion-switch
243
'(("To:" . mew-circular-complete-domain)
244
("Cc:" . mew-circular-complete-domain)
245
("Dcc:" . mew-circular-complete-domain)
246
("Bcc:" . mew-circular-complete-domain)
247
("Reply-To:" . mew-circular-complete-domain)
248
("Resent-To:" . mew-circular-complete-domain)
249
("Resent-Cc:" . mew-circular-complete-domain)
250
("Resent-Dcc:" . mew-circular-complete-domain)
251
("Resent-Bcc:" . mew-circular-complete-domain)
252
("From:" . mew-circular-complete-from)
253
("Resent-From:" . mew-circular-complete-from))
241
'(("To:" mew-circular-complete-domain)
242
("Cc:" mew-circular-complete-domain)
243
("Dcc:" mew-circular-complete-domain)
244
("Bcc:" mew-circular-complete-domain)
245
("Reply-To:" mew-circular-complete-domain)
246
("Resent-To:" mew-circular-complete-domain)
247
("Resent-Cc:" mew-circular-complete-domain)
248
("Resent-Dcc:" mew-circular-complete-domain)
249
("Resent-Bcc:" mew-circular-complete-domain)
250
("From:" mew-circular-complete-from)
251
("Resent-From:" mew-circular-complete-from))
254
252
"*Circular completion function alist concerned with the key."
255
253
:group 'mew-complete
256
254
:type mew-custom-type-of-field-completion)
258
256
(defcustom mew-field-expansion-switch
259
'(("To:" . mew-expand-address)
260
("Cc:" . mew-expand-address)
261
("Dcc:" . mew-expand-address)
262
("Bcc:" . mew-expand-address)
263
("Reply-To:" . mew-expand-address)
264
("Resent-To:" . mew-expand-address)
265
("Resent-Cc:" . mew-expand-address)
266
("Resent-Dcc:" . mew-expand-address)
267
("Resent-Bcc:" . mew-expand-address))
257
'(("To:" mew-expand-address)
258
("Cc:" mew-expand-address)
259
("Dcc:" mew-expand-address)
260
("Bcc:" mew-expand-address)
261
("Reply-To:" mew-expand-address)
262
("Resent-To:" mew-expand-address)
263
("Resent-Cc:" mew-expand-address)
264
("Resent-Dcc:" mew-expand-address)
265
("Resent-Bcc:" mew-expand-address))
268
266
"*Expansion function alist concerned with the key."
269
267
:group 'mew-complete
270
268
:type mew-custom-type-of-field-completion)
272
(defsubst mew-field-get-func (key switch)
273
(cdr (mew-assoc-match key switch 0)))
270
(defun mew-field-get-func (key switch)
271
(mew-alist-get-value (mew-assoc-match key switch 0)))
275
273
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
326
324
Equivalent to (\"prog\" args async).
328
326
(1) Displayed 'type \\[mew-summary-execute-external]'.
329
(2) <func2> is called.
327
(2) <func2> is called.
331
329
(1) <func1> is called.
332
330
(2) <func2> is called.
333
331
If the original content-type is Application/Octet-Stream,
334
332
you are asked to choose <func1> or <func2>.
335
333
- (func1 \"prog\")
336
(1) <func1> is called.
334
(1) <func1> is called.
337
335
(2) \"prog\" is executed asynchronously.
338
336
If the original content-type is Application/Octet-Stream,
339
337
you are asked to choose <func1> or \"prog\".
340
- (func1 (\"prog\" args async))
341
(1) <func1> is called.
338
- (func1 (\"prog\" args async))
339
(1) <func1> is called.
342
340
(2) \"prog\" is executed asynchronously with <args>.
343
341
If the original content-type is Application/Octet-Stream,
344
342
you are asked to choose <func1> or \"prog\".
346
344
Note that (1) indicates the action for '\\[mew-summary-display]' and
347
(2) indicates the action for '\\[mew-summary-execute-external]'.
345
\(2) indicates the action for '\\[mew-summary-execute-external]'.
349
347
If you want to add an entry for new content-type, please let the author
350
348
know. Such an entry should be shared by all users and be included in
351
349
the next version of Mew.")
353
(defsubst mew-ctdb-by-ct (ct)
351
(defun mew-ctdb-by-ct (ct)
354
352
(mew-assoc-match2 ct mew-mime-content-type 0))
356
(defsubst mew-ctdb-by-file (file)
354
(defun mew-ctdb-by-file (file)
357
355
(mew-assoc-match2 file mew-mime-content-type 1))
359
(defsubst mew-ctdb-ct (attr)
357
(defun mew-ctdb-ct (attr)
360
358
(and (nth 0 attr) (mew-capitalize (nth 0 attr))))
362
(defsubst mew-ctdb-regex (attr)
360
(defun mew-ctdb-regex (attr)
365
(defsubst mew-ctdb-cte (attr)
363
(defun mew-ctdb-cte (attr)
366
364
(symbol-value (nth 2 attr)))
368
(defsubst mew-ctdb-prog (attr)
366
(defun mew-ctdb-prog (attr)
369
367
(let ((val (symbol-value (nth 3 attr))))
370
368
(if (and (listp val) (eq 'if (car val)))
374
(defsubst mew-ctdb-icon (attr)
372
(defun mew-ctdb-icon (attr)
375
373
(symbol-value (nth 4 attr)))
377
(defsubst mew-mime-image-format-name (ct)
375
(defun mew-mime-image-format-name (ct)
378
376
(nth 5 (mew-ctdb-by-ct ct)))
380
378
(defvar mew-mime-content-type-for-ooffice nil
419
417
(smime-encryption ((,mew-ct-smm ,mew-ct-smm-enc)) "SE")
420
418
(smime-signature-encryption
421
419
((,mew-ct-smm ,mew-ct-smm-sig) (,mew-ct-smm ,mew-ct-smm-enc)) "SSSE")
422
(smie-encryption-signature
420
(smime-encryption-signature
423
421
((,mew-ct-smm ,mew-ct-smm-enc) (,mew-ct-smm ,mew-ct-smm-sig)) "SESS"))
424
422
"*Alist of key, a list of privacy Content-Type, and its mark."
425
423
:group 'mew-privacy
428
(defsubst mew-pcdb-services ()
426
(defun mew-pcdb-services ()
429
427
(mapcar 'car mew-privacy-database))
431
(defsubst mew-pcdb-by-service (service)
429
(defun mew-pcdb-by-service (service)
432
430
(assq service mew-privacy-database))
434
(defsubst mew-pcdb-ct (pcdb)
432
(defun mew-pcdb-ct (pcdb)
437
(defsubst mew-pcdb-mark (pcdb)
435
(defun mew-pcdb-mark (pcdb)
440
438
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
628
626
(defvar mew-highlight-mark-keywords
629
`((,mew-mark-review . mew-face-mark-review)
630
(,mew-mark-escape . mew-face-mark-escape)
631
(,mew-mark-delete . mew-face-mark-delete)
632
(,mew-mark-unlink . mew-face-mark-unlink)
633
(,mew-mark-refile . mew-face-mark-refile)
634
(,mew-mark-unread . mew-face-mark-unread))
627
`((,mew-mark-review mew-face-mark-review)
628
(,mew-mark-escape mew-face-mark-escape)
629
(,mew-mark-delete mew-face-mark-delete)
630
(,mew-mark-unlink mew-face-mark-unlink)
631
(,mew-mark-refile mew-face-mark-refile)
632
(,mew-mark-unread mew-face-mark-unread))
635
633
"A list of mark-face pair to used in Summary/Virtual mode.")
637
(defsubst mew-highlight-mark-get-face (mark)
638
(cdr (assoc mark mew-highlight-mark-keywords)))
635
(defun mew-highlight-mark-get-face (mark)
636
(mew-alist-get-value (assoc mark mew-highlight-mark-keywords)))
640
638
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
656
654
0th (the first element of a list) is a mark value. A mark value is
657
655
ASCII code of the mark. For example, the value of the '*' mark
658
(mew-mark-review) is 42.
656
\(mew-mark-review) is 42.
660
658
Seven values following a mark value means as follows:
662
660
1st is the case of no mark.
663
661
2nd is the case where the new mark is equal to the old one.
664
3rd is the case where level of the new mark is greater than that of the
662
3rd is the case where level of the new mark is greater than that of the
666
664
4th, 5th, and 6th is the case where levels are equal.
667
665
4th and 5th is the case that the old mark has state.
668
666
4th means that the old mark is overrode.
669
667
5th means that the old mark remains.
670
668
6th is the case that the old mark does not have state.
671
7th is the case where level of the new mark is smaller than that of the
669
7th is the case where level of the new mark is smaller than that of the
674
672
The value of cursor actions means as follows:
677
675
1 means moving according to the direction,
678
2 means moving according to the direction
676
2 means moving according to the direction
679
677
then displaying the next message.
681
679
For more detail, see mew-mark-put-mark and mew-mark-afterstep.")
683
(defsubst mew-markas-nth (mark case)
681
(defun mew-markas-nth (mark case)
684
682
(nth case (assoc mark mew-mark-afterstep-spec)))
686
684
(defvar mew-mark-spec
702
700
"Collecting all defined marks."
703
701
(mapcar 'car mew-mark-spec))
705
(defsubst mew-markdb-by-mark (mark)
703
(defun mew-markdb-by-mark (mark)
706
704
(assoc mark mew-mark-spec))
708
(defsubst mew-markdb-name (mark)
706
(defun mew-markdb-name (mark)
709
707
(nth 1 (mew-markdb-by-mark mark)))
711
(defsubst mew-markdb-level (mark)
709
(defun mew-markdb-level (mark)
712
710
(nth 2 (mew-markdb-by-mark mark)))
714
(defsubst mew-markdb-statefullp (mark)
712
(defun mew-markdb-statefullp (mark)
715
713
(nth 3 (mew-markdb-by-mark mark)))
717
(defsubst mew-markdb-killp (mark)
715
(defun mew-markdb-killp (mark)
718
716
(nth 4 (mew-markdb-by-mark mark)))
720
(defsubst mew-markdb-func-undo (mark)
718
(defun mew-markdb-func-undo (mark)
721
719
(nth 5 (mew-markdb-by-mark mark)))
723
(defsubst mew-markdb-func-exec (mark)
721
(defun mew-markdb-func-exec (mark)
724
722
(nth 6 (mew-markdb-by-mark mark)))
726
(defsubst mew-markdb-func-sanity (mark)
724
(defun mew-markdb-func-sanity (mark)
727
725
(nth 7 (mew-markdb-by-mark mark)))
729
727
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
780
778
If you are using 'bogofilter' which adds the \"X-Bogosity:\" field
781
779
to messages and puts them to your mailbox, configure as follows:
783
(setq mew-spam: \"X-Bogosity:\")
781
\(setq mew-spam: \"X-Bogosity:\")
785
(defun mew-spam-bogofilter (val)
783
\(defun mew-spam-bogofilter (val)
786
784
(let ((case-fold-search t))
787
785
(if (string-match \"yes\" val) ?D)))
789
(setq mew-inbox-action-alist
787
\(setq mew-inbox-action-alist
790
788
'((\"X-Bogosity:\" mew-spam-bogofilter)))
793
791
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
798
(defvar mew-ext-url-alist
799
'(("^application" "Fetch by w3" mew-ext-url-fetch-by-w3 nil)
800
(t "Browse by mozilla" "mozilla" ("-install")))
801
"*Alist of (REGEXP DOC PROGRAM ARGS-LIST) to define
802
an appropriate method for a content-type in external-body. Note
803
this phantom body is defined RFC 2017.
805
If REGEXP is 't', every content-type is matched to the list.
806
If PROGRAM is a string, it is considered an external program.
807
If PROGRAM is a symbol, the lisp function whose name is PROGRAM is called.
809
'mew-ext-url-show-by-w3' and 'mew-ext-url-fetch-by-w3' are pre-defined
812
If you want to use \"w3.el\" instead of \"mozilla\", configure like this:
813
(setq mew-ext-url-alist
814
'((t (\"Browse by w3\" mew-ext-url-show-by-w3 nil))))
815
If you want to use \"lynx\" instead of \"mozilla\", configure like this:
816
(setq mew-ext-url-alist
817
'((t (\"Browse by lynx\" \"kterm\" (\"-e\" \"lynx\" \"-color\")))))
820
(defsubst mew-ext-url-by-ct (ct)
821
(mew-assoc-match2 ct mew-ext-url-alist 0))
823
(defsubst mew-ext-url-get-doc (prog-list)
826
(defsubst mew-ext-url-get-prog (prog-list)
829
(defsubst mew-ext-url-get-args (prog-list)
832
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
905
864
(defcustom mew-config-alist nil
906
"*Alist of config. This is a list of
907
(<case> (<key> . <value>) (<key> . <value>) ...).
865
"*Alist of config. This is a list of
866
(<case> (<key> <value>) (<key> <value>) ...).
908
867
- <case> is a string of case.
909
- <key> is a string of Mew value with the \"mew-\" prefix removed.
868
- <key> is a symbol of Mew value with the 'mew-' prefix removed.
910
869
- <value> is a string.
912
Currently, the following keys are supported:
913
\"name\", \"user\", \"mail-domain\",
914
\"cc\", \"fcc\", \"dcc\", \"reply-to\", \"organization\", \"header-alist\",
916
\"smtp-server\", \"smtp-port\", \"smtp-ssh-server\", \"smtp-ssl\", \"smtp-ssl-port\",
917
\"smtp-user\", \"smtp-auth-list\",
918
\"smtp-msgid-user\", \"smtp-msgid-domain\", \"smtp-helo-domain\", \"smtp-mail-from\",
919
\"pop-server\", \"pop-port\", \"pop-ssh-server\", \"pop-ssl\", \"pop-ssl-port\",
920
\"pop-user\", \"pop-auth\", \"pop-auth-list\",
921
\"pop-size\", \"pop-body-lines\", \"pop-delete\", \"pop-body-lines\",
922
\"pop-proxy-server\", \"pop-proxy-port\",
923
\"imap-server\", \"imap-port\", \"imap-ssh-server\", \"imap-ssl\", \"imap-ssl-port\",
924
\"imap-user\", \"imap-auth\", \"imap-auth-list\",
925
\"imap-size\", \"imap-header-only\", \"imap-delete\",
926
\"imap-trash-folder\", \"imap-queue-folder\", \"imap-spam-field\", \"imap-spam-word\",
927
\"imap-proxy-server\", \"imap-proxy-port\",
928
\"nntp-server\", \"nntp-port\", \"nntp-ssh-server\", \"nntp-ssl\", \"nntp-ssl-port\",
929
\"nntp-user\", \"nntp-size\", \"nntp-header-only\",
930
\"nntp-msgid-user\", \"nntp-msgid-domain\",
931
\"ssl-cert-directory\", \"ssl-verify-level\",
932
\"inbox-folder\", \"queue-folder\", \"postq-folder\",
933
\"mailbox-type\", \"mbox-command\", \"mbox-command-arg\",
934
\"signature-file\", \"content-type\", \"refile-guess-alist\",
935
\"spam-prog\", \"spam-prog-args\", \"ham-prog\", \"ham-prog-args\",
871
Currently, the following keys are supported:
872
name, user, mail-domain,
873
cc, fcc, dcc, reply-to, organization, header-alist, proto,
874
smtp-server, smtp-port, smtp-ssh-server, smtp-ssl, smtp-ssl-port,
875
smtp-user, smtp-auth-list,
876
smtp-msgid-user, smtp-msgid-domain, smtp-helo-domain, smtp-mail-from,
877
pop-server, pop-port, pop-ssh-server, pop-ssl, pop-ssl-port,
878
pop-user, pop-auth, pop-auth-list,
879
pop-size, pop-header-only, pop-delete, pop-body-lines,
880
pop-proxy-server, pop-proxy-port,
881
imap-server, imap-port, imap-ssh-server, imap-ssl, imap-ssl-port,
882
imap-user, imap-auth, imap-auth-list,
883
imap-size, imap-header-only, imap-delete,
884
imap-trash-folder, imap-queue-folder, imap-spam-field, imap-spam-word,
885
imap-proxy-server, imap-proxy-port,
886
nntp-server, nntp-port, nntp-ssh-server, nntp-ssl, nntp-ssl-port,
887
nntp-user, nntp-size, nntp-header-only,
888
nntp-msgid-user, nntp-msgid-domain,
889
ssl-cert-directory, ssl-verify-level,
890
inbox-folder, queue-folder, postq-folder,
891
mailbox-type, mbox-command, mbox-command-arg,
892
signature-file, content-type, refile-guess-alist,
893
spam-prog, spam-prog-args, ham-prog, ham-prog-args,
894
use-old-pgp, pgp-signer, smime-signer, privacy-method,
895
protect-privacy-always, protect-privacy-always-type,
896
protect-privacy-encrypted, protect-privacy-encrypted-type,
897
protect-privacy-with-old-pgp-signature
938
899
from = name <user@mail-domain>
939
900
message-id = *random*.smtp-msgid-user@smtp-msgid-domain
942
903
An example is as follows:
944
(setq mew-config-alist
946
(\"mail-domain\" . \"example.org\")
947
(\"inbox-folder\" . \"+inbox-mew\"))
949
(\"cc\" . \"kazu@example.jp\")
950
(\"user\" . \"pooh\")
951
(\"mail-domain\" . \"example.net\"))
953
(\"name\" . \"Kazu Yamamoto\")
954
(\"mail-domain\" . \"example.jp\"))))
905
\(setq mew-config-alist
907
(mail-domain \"example.org\")
908
(inbox-folder \"+inbox-mew\"))
910
(cc \"kazu@example.jp\")
912
(mail-domain \"example.net\"))
914
(name \"Kazu Yamamoto\")
915
(mail-domain \"example.jp\"))))
957
918
:type '(alist :key-type string
958
919
:value-type (repeat (cons string string))))
960
(defsubst mew-cfent-by-case (case)
921
(defun mew-cfent-by-case (case)
962
(assoc mew-case-default mew-config-alist)
963
(assoc case mew-config-alist)))
923
(or (assoc mew-case-default mew-config-alist)
924
(assoc (intern mew-case-default) mew-config-alist))
925
(or (assoc case mew-config-alist)
926
(assoc (intern case) mew-config-alist))))
965
928
(provide 'mew-vars2)
967
930
;;; Copyright Notice:
969
;; Copyright (C) 2000-2007 Mew developing team.
932
;; Copyright (C) 2000-2008 Mew developing team.
970
933
;; All rights reserved.
972
935
;; Redistribution and use in source and binary forms, with or without
973
936
;; modification, are permitted provided that the following conditions
976
939
;; 1. Redistributions of source code must retain the above copyright
977
940
;; notice, this list of conditions and the following disclaimer.
978
941
;; 2. Redistributions in binary form must reproduce the above copyright