64
61
dnd-protocol-alist))))
66
63
(defun mew-draft-mode (&optional encrypted)
67
"\\<mew-draft-mode-map>
68
Mew Draft mode:: major mode for composing a MIME message.
69
Key actions are different in each region: Header, Body, and Attachment.
71
To send a draft, type \\[mew-draft-make-message] and \\[mew-draft-send-message]. To make multipart, type
72
\\[mew-draft-prepare-attachments], edit attachments, type \\[mew-draft-make-message] and \\[mew-draft-send-message].
74
*Whole buffer key assignment:
76
\\[mew-draft-make-message] Compose a MIME message then put it into a queue folder.
77
\\[mew-draft-send-message] Compose a MIME message then send it.
79
\\[mew-draft-prepare-attachments] Prepare an attachment region in the bottom of the draft.
80
To compose a multipart message, you should execute this
83
\\[mew-draft-set-case] Guess case and set the case for output to it.
84
\\[mew-draft-rehighlight] Highlight header and body again.
86
\\[mew-draft-kill] Kill this draft.
88
\\[mew-pgp-sign-message] Sign the entire draft with PGP. Input your passphrase.
89
\\[mew-pgp-encrypt-message] Encrypt the entire draft with PGP.
90
\\[mew-pgp-sign-encrypt-message] Sign then encrypt the entire draft with PGP.
91
Input your passphrase.
92
\\[mew-pgp-encrypt-sign-message] Encrypt then sign the entire draft with PGP.
93
Input your passphrase.
95
\\[mew-draft-toggle-privacy-always] Toggle whether or not all drafts are protected.
96
\\[mew-draft-toggle-privacy-encrypted] Toggle whether or not drafts replying to encrypted messages
98
\\[mew-draft-set-privacy-type] Set privacy service which will be effective when \\[mew-draft-make-message].
99
\\<mew-draft-header-map>
100
*Header region key assignment:
102
\\[mew-draft-header-comp] Complete field keys.
103
Complete and expand an address short name.
104
Complete folder names.
105
\\[mew-draft-circular-comp] Complete your mail domain.
106
\\[mew-draft-expand] Replace an address with 'NAME <address>'.
108
*Body region key assignment:
110
\\<mew-draft-body-map>\\[mew-draft-insert-signature] Insert '~/.signature' on the cursor point.
111
\\<mew-draft-mode-map>\\[mew-draft-cite] Copy and paste a part of message from Message mode with
112
citation prefix and label.
113
1. Roughly speaking, it copies the body in Message mode.
114
For example, if text/plain is displayed, the entire Message
115
mode is copied. If message/rfc822 is displayed, the body
116
without the header is copied.
117
2. If called with '\\[universal-argument]', the header is also copied if exists.
118
3. If an Emacs mark exists, the target is the region between
119
the mark and the cursor.
120
\\[mew-draft-yank] Copy and paste a part of message from Message mode WITHOUT
121
citation prefix and label.
123
*Attachments region Key assignment:
124
\\<mew-draft-attach-map>
125
\\[mew-attach-forward] Go to the first subdirectory.
126
\\[mew-attach-backforward] Go to the parent directory.
127
\\[mew-attach-next] Go to the next file in the current directory.
128
\\[mew-attach-previous] Go to the previous file in the current directory.
130
\\[mew-attach-copy] Copy a file (via networks) on '.'.
131
To copy a remote file, use the '/[user@]hostname:/filepath' syntax.
132
\\[mew-attach-link] Link a file with a symbolic link on '.'.
133
\\[mew-attach-link-message] Link the message displayed in Message mode with a symbolic link on '.'.
134
\\[mew-attach-delete] Delete this file or this directory.
135
\\[mew-attach-multipart] Create a subdirectory(i.e. multipart) on '.'.
136
\\[mew-attach-find-file] Open this file into a buffer.
137
\\[mew-attach-find-new-file] Open a new file into a buffer on '.'.
138
\\[mew-attach-external-body] Input external-body on '.'.
139
\\[mew-attach-audio] Sampling voice and insert as audio file on '.'.
140
\\[mew-attach-pgp-public-key] Extract the PGP key for the specified user on '.'.
141
\\[mew-attach-description] Input a description(Content-Description:).
142
\\[mew-attach-disposition] Change the file name(Content-Disposition:).
143
\\[mew-attach-type] Change the data type(Content-Type:).
144
\\[mew-attach-charset] Specify the charset parameter for a Text/* object.
145
\\[mew-attach-icharset] Specify a input coding-system for a text file.
147
\\[mew-attach-base64] Put the 'B' mark to encode with Base64.
148
\\[mew-attach-quoted-printable] Put the 'Q' mark to encode with Quoted-Printable.
149
\\[mew-attach-gzip64] Put the 'G' mark to encode with Gzip64. This is applicable
150
only to Text/Plain and Application/Postscript since compression
151
is not effective other objects. For example, JPEG is already
153
\\[mew-attach-pgp-sign] Put the 'PS' mark to sign with PGP.
154
\\[mew-attach-pgp-enc] Put the 'PE' mark to encrypt with PGP.
155
Input decryptors' addresses.
156
\\[mew-attach-undo] Unmark. The original mark appears.
159
\\<mew-draft-mode-map>
160
Prepare '~/.mew-fib' like;
162
name: Kazuhiko Yamamoto
163
email: kazu@example.org
165
If you receive a message like;
168
Your e-mail address: |>email<|
170
Type \\<mew-summary-mode-map>\\[mew-summary-reply] in Summary mode to enter Draft mode.
171
Then type \\<mew-draft-mode-map>\\[mew-draft-yank], \\[mew-fib-fill-default], and \\[mew-fib-delete-frame] makes following
174
Your name : Kazuhiko Yamamoto
175
Your e-mail address: kazu@example.org
177
In this way, mew-fil fills up items quoted like |> <| from '~/.mew-fib'.
178
The fill functions described below.
180
\\[mew-fib-fill-default] Fill |>item<| from '~/.mew-fib'.
181
\\[mew-fib-delete-frame] Delete all quotations, i.e. |> <|.
182
\\[mew-fib-next-item] Jump to the next fib item.
183
\\[mew-fib-previous-item] Jump to the previous fib item.
184
\\[mew-fib-flush-input] Flush input from '~/.mew-fib'.
186
Moreover, '~/.mew-fib' supports aliases like;
188
email: kazu@example.org
64
"A major mode for composing a MIME message.
66
\\{mew-draft-mode-map}"
193
68
(setq major-mode 'mew-draft-mode)
194
69
(setq mode-line-buffer-identification mew-mode-line-id)
195
(mew-draft-mode-name)
196
70
(mew-draft-set-local-variables)
197
71
(use-local-map mew-draft-mode-map)
198
72
(set-syntax-table mew-draft-mode-syntax-table)
210
85
(setq buffer-undo-list nil))
212
87
(defun mew-draft-mode-name (&optional header)
88
(let ((case (mew-tinfo-get-case))
215
91
((or (mew-tinfo-get-privacy-type) (mew-tinfo-get-privacy-err))
216
92
;; If privacy err, don't display mew-protect-privacy-always-type etc.
217
93
(setq pcdb (mew-pcdb-by-service (mew-tinfo-get-privacy-type)))
218
94
(setq sub (mew-pcdb-mark pcdb)))
219
((and (mew-tinfo-get-encrypted-p) mew-protect-privacy-encrypted)
220
(setq pcdb (mew-pcdb-by-service mew-protect-privacy-encrypted-type))
95
((and (mew-tinfo-get-encrypted-p) (mew-protect-privacy-encrypted case))
96
(setq pcdb (mew-pcdb-by-service (mew-protect-privacy-encrypted-type case)))
221
97
(setq sub (mew-pcdb-mark pcdb)))
222
(mew-protect-privacy-always
223
(setq pcdb (mew-pcdb-by-service mew-protect-privacy-always-type))
98
((mew-protect-privacy-always case)
99
(setq pcdb (mew-pcdb-by-service (mew-protect-privacy-always-type case)))
224
100
(setq sub (mew-pcdb-mark pcdb))))
225
101
(setq mode-name (if header mew-mode-name-header mew-mode-name-draft))
226
102
(if sub (setq mode-name (concat mode-name " " sub)))
994
(defvar mew-draft-privacy-method 'pgp)
867
(defvar mew-draft-privacy-method-alist '(("pgp" . pgp) ("smime" . smime)))
869
(defun mew-draft-set-privacy-method ()
870
"Set mew-draft-privacy-method. 'pgp or 'smime."
872
(let ((method (completing-read "Privacy method: " mew-draft-privacy-method-alist nil t)))
873
(setq mew-draft-privacy-method
874
(cdr (assoc method mew-draft-privacy-method-alist)))))
876
(defmacro mew-draft-privacy-switch (&rest form)
877
`(let ((method (mew-draft-privacy-method (mew-tinfo-get-case))))
883
`((eq method ',(car x)) ,(car (cdr x)))))
885
(t (message "'%s' is not supported" method)))))
996
887
(defun mew-draft-sign-message (&optional arg)
997
888
"Sign the entire draft. Input your passphrase."
998
889
(interactive "P")
1000
((eq (mew-draft-privacy-method (mew-tinfo-get-case)) 'pgp)
1001
(mew-pgp-sign-message arg))
1002
((eq (mew-draft-privacy-method (mew-tinfo-get-case)) 'smime)
1003
(mew-smime-sign-message arg))
1005
(message "'%s' is not supported" (mew-draft-privacy-method (mew-tinfo-get-case))))))
890
(mew-draft-privacy-switch
891
(pgp (mew-pgp-sign-message arg))
892
(smime (mew-smime-sign-message arg))))
1007
894
(defun mew-draft-encrypt-message ()
1008
895
"Encrypt the entire draft with PGP."
1011
((eq (mew-draft-privacy-method (mew-tinfo-get-case)) 'pgp)
1012
(mew-pgp-encrypt-message))
1013
((eq (mew-draft-privacy-method (mew-tinfo-get-case)) 'smime)
1014
(mew-smime-encrypt-message))
1016
(message "'%s' is not supported" (mew-draft-privacy-method (mew-tinfo-get-case))))))
897
(mew-draft-privacy-switch
898
(pgp (mew-pgp-encrypt-message))
899
(smime (mew-smime-encrypt-message))))
1018
901
(defun mew-draft-sign-encrypt-message (&optional arg)
1019
902
"Sign then encrypt the entire draft. Input your passphrase."
1020
903
(interactive "P")
1022
((eq (mew-draft-privacy-method (mew-tinfo-get-case)) 'pgp)
1023
(mew-pgp-sign-encrypt-message arg))
1024
((eq (mew-draft-privacy-method (mew-tinfo-get-case)) 'smime)
1025
(mew-smime-sign-encrypt-message arg))
1027
(message "'%s' is not supported" (mew-draft-privacy-method (mew-tinfo-get-case))))))
904
(mew-draft-privacy-switch
905
(pgp (mew-pgp-sign-encrypt-message arg))
906
(smime (mew-smime-sign-encrypt-message arg))))
1030
908
(defun mew-draft-encrypt-sign-message (&optional arg)
1031
909
"Encrypt then sign the entire draft. Input your passphrase."
1032
910
(interactive "P")
1034
((eq (mew-draft-privacy-method (mew-tinfo-get-case)) 'pgp)
1035
(mew-pgp-encrypt-sign-message arg))
1036
((eq (mew-draft-privacy-method (mew-tinfo-get-case)) 'smime)
1037
(mew-smime-encrypt-sign-message arg))
1039
(message "'%s' is not supported" (mew-draft-privacy-method (mew-tinfo-get-case))))))
911
(mew-draft-privacy-switch
912
(pgp (mew-pgp-encrypt-sign-message arg))
913
(smime (mew-smime-encrypt-sign-message arg))))
1041
915
(provide 'mew-draft)
1043
917
;;; Copyright Notice:
1045
;; Copyright (C) 1996-2007 Mew developing team.
919
;; Copyright (C) 1996-2008 Mew developing team.
1046
920
;; All rights reserved.
1048
922
;; Redistribution and use in source and binary forms, with or without
1049
923
;; modification, are permitted provided that the following conditions
1052
926
;; 1. Redistributions of source code must retain the above copyright
1053
927
;; notice, this list of conditions and the following disclaimer.
1054
928
;; 2. Redistributions in binary form must reproduce the above copyright