aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Bader2006-04-26 21:58:05 +0000
committerMiles Bader2006-04-26 21:58:05 +0000
commit0565caebd9a781b845722fe8ea191eea90b45bb8 (patch)
treedcfd1d6be2e726bd6ea29bdb2a119f398156c296
parent8570ce80826e511612edc65b659466503c176b58 (diff)
downloademacs-0565caebd9a781b845722fe8ea191eea90b45bb8.tar.gz
emacs-0565caebd9a781b845722fe8ea191eea90b45bb8.zip
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-249
Merge from gnus--rel--5.10 Patches applied: * gnus--rel--5.10 (patch 91-95) - Merge from emacs--devo--0 - Update from CVS
-rw-r--r--lisp/gnus/ChangeLog39
-rw-r--r--lisp/gnus/deuglify.el3
-rw-r--r--lisp/gnus/message.el20
-rw-r--r--lisp/gnus/mm-decode.el2
-rw-r--r--lisp/gnus/mm-uu.el47
-rw-r--r--lisp/gnus/mml-sec.el51
-rw-r--r--lisp/gnus/mml.el159
-rw-r--r--lisp/gnus/mml1991.el86
-rw-r--r--lisp/gnus/nnweb.el4
-rw-r--r--man/ChangeLog9
-rw-r--r--man/pgg.texi8
11 files changed, 338 insertions, 90 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index c66def4af66..2976d0db3e4 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,42 @@
12006-04-26 Reiner Steib <Reiner.Steib@gmx.de>
2
3 * deuglify.el (gnus-outlook-deuglify-unwrap-min)
4 (gnus-outlook-deuglify-unwrap-max): Remove autoload.
5
6 * mml-sec.el (mml-secure-method): New internal variable.
7 (mml-secure-sign, mml-secure-encrypt, mml-secure-message-sign)
8 (mml-secure-message-sign-encrypt, mml-secure-message-encrypt): New
9 functions using mml-secure-method. Sync from the trunk.
10
11 * mml.el (mml-mode-map): Add key bindings for those functions.
12 (mml-menu): Simplify security menu entries. Suggested by Jesper
13 Harder <harder@myrealbox.com>. Sync from the trunk.
14
15 * message.el (message-valid-fqdn-regexp): Add TLDs .cat, jobs,
16 .mobi and .travel. Remove .nato, .bitnet and .uucp.
17 (message-in-body-p): New function. Sync from the trunk.
18
19 * mml.el (mml-mode, mml-dnd-protocol-alist)
20 (mml-dnd-attach-options, mml-dnd-attach-file)
21 (mml-attach-file, mml-attach-buffer, mml-attach-external): Sync
22 DND support and use of message-in-body-p from the trunk.
23
242006-04-25 Andreas Seltenreich <uwi7@rz.uni-karlsruhe.de>
25
26 * nnweb.el (nnweb-google-wash-article): Sync up to new Google
27 HTML.
28
292006-04-25 Katsumi Yamaoka <yamaoka@jpl.org>
30
31 * mm-uu.el (mm-uu-pgp-signed-test): Erase prompt.
32 (mm-uu-pgp-encrypted-test): Ditto.
33 (mm-uu-pgp-encrypted-extract-1): Make sure there's a blank line
34 between header and body; return application/pgp-encrypted handle
35 if decryption failed; decode decrypted body by charset.
36
37 * mm-decode.el (mm-automatic-display): Don't make application/pgp
38 element match to application/pgp-*.
39
12006-04-20 Reiner Steib <Reiner.Steib@gmx.de> 402006-04-20 Reiner Steib <Reiner.Steib@gmx.de>
2 41
3 * gnus-util.el (gnus-replace-in-string): Prefer 42 * gnus-util.el (gnus-replace-in-string): Prefer
diff --git a/lisp/gnus/deuglify.el b/lisp/gnus/deuglify.el
index 4096324fdaa..404aebbd921 100644
--- a/lisp/gnus/deuglify.el
+++ b/lisp/gnus/deuglify.el
@@ -234,14 +234,12 @@
234 :version "22.1" 234 :version "22.1"
235 :group 'gnus) 235 :group 'gnus)
236 236
237;;;###autoload
238(defcustom gnus-outlook-deuglify-unwrap-min 45 237(defcustom gnus-outlook-deuglify-unwrap-min 45
239 "Minimum length of the cited line above the (possibly) wrapped line." 238 "Minimum length of the cited line above the (possibly) wrapped line."
240 :version "22.1" 239 :version "22.1"
241 :type 'integer 240 :type 'integer
242 :group 'gnus-outlook-deuglify) 241 :group 'gnus-outlook-deuglify)
243 242
244;;;###autoload
245(defcustom gnus-outlook-deuglify-unwrap-max 95 243(defcustom gnus-outlook-deuglify-unwrap-max 95
246 "Maximum length of the cited line after unwrapping." 244 "Maximum length of the cited line after unwrapping."
247 :version "22.1" 245 :version "22.1"
@@ -288,7 +286,6 @@
288 :type 'string 286 :type 'string
289 :group 'gnus-outlook-deuglify) 287 :group 'gnus-outlook-deuglify)
290 288
291;;;###autoload
292(defcustom gnus-outlook-display-hook nil 289(defcustom gnus-outlook-display-hook nil
293 "A hook called after an deuglified article has been prepared. 290 "A hook called after an deuglified article has been prepared.
294It is run after `gnus-article-prepare-hook'." 291It is run after `gnus-article-prepare-hook'."
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 472eb2468dd..8bc0f704b5c 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -1586,11 +1586,16 @@ functionality to work."
1586(defcustom message-valid-fqdn-regexp 1586(defcustom message-valid-fqdn-regexp
1587 (concat "[a-z0-9][-.a-z0-9]+\\." ;; [hostname.subdomain.]domain. 1587 (concat "[a-z0-9][-.a-z0-9]+\\." ;; [hostname.subdomain.]domain.
1588 ;; valid TLDs: 1588 ;; valid TLDs:
1589 "\\([a-z][a-z]" ;; two letter country TDLs 1589 "\\([a-z][a-z]\\|" ;; two letter country TDLs
1590 "\\|biz\\|com\\|edu\\|gov\\|int\\|mil\\|net\\|org" 1590 "aero\\|arpa\\|bitnet\\|biz\\|bofh\\|"
1591 "\\|aero\\|coop\\|info\\|name\\|museum" 1591 "cat\\|com\\|coop\\|edu\\|gov\\|"
1592 "\\|arpa\\|pro\\|uucp\\|bitnet\\|bofh" ;; old style? 1592 "info\\|int\\|jobs\\|"
1593 "\\)") 1593 "mil\\|mobi\\|museum\\|name\\|net\\|"
1594 "org\\|pro\\|travel\\|uucp\\)")
1595 ;; http://en.wikipedia.org/wiki/List_of_Internet_top-level_domains
1596 ;; http://en.wikipedia.org/wiki/GTLD
1597 ;; `in the process of being approved': .asia .post .tel .sex
1598 ;; "dead" nato bitnet uucp
1594 "Regular expression that matches a valid FQDN." 1599 "Regular expression that matches a valid FQDN."
1595 ;; see also: gnus-button-valid-fqdn-regexp 1600 ;; see also: gnus-button-valid-fqdn-regexp
1596 :version "22.1" 1601 :version "22.1"
@@ -2679,6 +2684,11 @@ M-RET `message-newline-and-reformat' (break the line and reformat)."
2679 (or (search-forward (concat "\n" mail-header-separator "\n") nil t) 2684 (or (search-forward (concat "\n" mail-header-separator "\n") nil t)
2680 (search-forward-regexp "[^:]+:\\([^\n]\\|\n[ \t]\\)+\n\n" nil t))) 2685 (search-forward-regexp "[^:]+:\\([^\n]\\|\n[ \t]\\)+\n\n" nil t)))
2681 2686
2687(defun message-in-body-p ()
2688 "Return t if point is in the message body."
2689 (let ((body (save-excursion (message-goto-body) (point))))
2690 (>= (point) body)))
2691
2682(defun message-goto-eoh () 2692(defun message-goto-eoh ()
2683 "Move point to the end of the headers." 2693 "Move point to the end of the headers."
2684 (interactive) 2694 (interactive)
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index 5ee47a8ce26..b79e081f0e1 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -307,7 +307,7 @@ when selecting a different article."
307 "application/pkcs7-signature" "application/x-pkcs7-mime" 307 "application/pkcs7-signature" "application/x-pkcs7-mime"
308 "application/pkcs7-mime" 308 "application/pkcs7-mime"
309 ;; Mutt still uses this even though it has already been withdrawn. 309 ;; Mutt still uses this even though it has already been withdrawn.
310 "application/pgp") 310 "application/pgp\\'")
311 "A list of MIME types to be displayed automatically." 311 "A list of MIME types to be displayed automatically."
312 :type '(repeat regexp) 312 :type '(repeat regexp)
313 :group 'mime-display) 313 :group 'mime-display)
diff --git a/lisp/gnus/mm-uu.el b/lisp/gnus/mm-uu.el
index 9029e0d699c..944e40bc964 100644
--- a/lisp/gnus/mm-uu.el
+++ b/lisp/gnus/mm-uu.el
@@ -352,7 +352,9 @@ Return that buffer."
352 ((eq mm-verify-option 'never) nil) 352 ((eq mm-verify-option 'never) nil)
353 ((eq mm-verify-option 'always) t) 353 ((eq mm-verify-option 'always) t)
354 ((eq mm-verify-option 'known) t) 354 ((eq mm-verify-option 'known) t)
355 (t (y-or-n-p "Verify pgp signed part? "))))) 355 (t (prog1
356 (y-or-n-p "Verify pgp signed part? ")
357 (message ""))))))
356 358
357(eval-when-compile 359(eval-when-compile
358 (defvar gnus-newsgroup-charset)) 360 (defvar gnus-newsgroup-charset))
@@ -403,15 +405,44 @@ Return that buffer."
403 ((eq mm-decrypt-option 'never) nil) 405 ((eq mm-decrypt-option 'never) nil)
404 ((eq mm-decrypt-option 'always) t) 406 ((eq mm-decrypt-option 'always) t)
405 ((eq mm-decrypt-option 'known) t) 407 ((eq mm-decrypt-option 'known) t)
406 (t (y-or-n-p "Decrypt pgp encrypted part? "))))) 408 (t (prog1
409 (y-or-n-p "Decrypt pgp encrypted part? ")
410 (message ""))))))
407 411
408(defun mm-uu-pgp-encrypted-extract-1 (handles ctl) 412(defun mm-uu-pgp-encrypted-extract-1 (handles ctl)
409 (let ((buf (mm-uu-copy-to-buffer (point-min) (point-max)))) 413 (let ((buf (mm-uu-copy-to-buffer (point-min) (point-max)))
410 (if (mm-uu-pgp-encrypted-test) 414 (first t)
411 (with-current-buffer buf 415 charset)
412 (mml2015-clean-buffer) 416 ;; Make sure there's a blank line between header and body.
413 (funcall (mml2015-clear-decrypt-function)))) 417 (with-current-buffer buf
414 (list (mm-make-handle buf mm-uu-text-plain-type)))) 418 (goto-char (point-min))
419 (while (prog2
420 (forward-line 1)
421 (if first
422 (looking-at "[^\t\n ]+:")
423 (looking-at "[^\t\n ]+:\\|[\t ]"))
424 (setq first nil)))
425 (unless (memq (char-after) '(?\n nil))
426 (insert "\n"))
427 (save-restriction
428 (narrow-to-region (point-min) (point))
429 (setq charset (mail-fetch-field "charset")))
430 (if (and (mm-uu-pgp-encrypted-test)
431 (progn
432 (mml2015-clean-buffer)
433 (funcall (mml2015-clear-decrypt-function))
434 (equal (mm-handle-multipart-ctl-parameter mm-security-handle
435 'gnus-info)
436 "OK")))
437 (progn
438 ;; Decode charset.
439 (when (and (or charset
440 (setq charset gnus-newsgroup-charset))
441 (setq charset (mm-charset-to-coding-system charset))
442 (not (eq charset 'ascii)))
443 (mm-decode-coding-region (point-min) (point-max) charset))
444 (list (mm-make-handle buf mm-uu-text-plain-type)))
445 (list (mm-make-handle buf '("application/pgp-encrypted")))))))
415 446
416(defun mm-uu-pgp-encrypted-extract () 447(defun mm-uu-pgp-encrypted-extract ()
417 (let ((mm-security-handle (list (format "multipart/encrypted")))) 448 (let ((mm-security-handle (list (format "multipart/encrypted"))))
diff --git a/lisp/gnus/mml-sec.el b/lisp/gnus/mml-sec.el
index 2af068897f0..df301dc74b7 100644
--- a/lisp/gnus/mml-sec.el
+++ b/lisp/gnus/mml-sec.el
@@ -188,6 +188,29 @@ You can also customize or set `mml-signencrypt-style-alist' instead."
188 (cons method tags)))) 188 (cons method tags))))
189 (t (error "The message is corrupted. No mail header separator")))))) 189 (t (error "The message is corrupted. No mail header separator"))))))
190 190
191(defvar mml-secure-method
192 (if (equal mml-default-encrypt-method mml-default-sign-method)
193 mml-default-sign-method
194 "pgpmime")
195 "Current security method. Internal variable.")
196
197(defun mml-secure-sign (&optional method)
198 "Add MML tags to sign this MML part.
199Use METHOD if given. Else use `mml-secure-method' or
200`mml-default-sign-method'."
201 (interactive)
202 (mml-secure-part
203 (or method mml-secure-method mml-default-sign-method)
204 'sign))
205
206(defun mml-secure-encrypt (&optional method)
207 "Add MML tags to encrypt this MML part.
208Use METHOD if given. Else use `mml-secure-method' or
209`mml-default-sign-method'."
210 (interactive)
211 (mml-secure-part
212 (or method mml-secure-method mml-default-sign-method)))
213
191(defun mml-secure-sign-pgp () 214(defun mml-secure-sign-pgp ()
192 "Add MML tags to PGP sign this MML part." 215 "Add MML tags to PGP sign this MML part."
193 (interactive) 216 (interactive)
@@ -249,6 +272,34 @@ You can also customize or set `mml-signencrypt-style-alist' instead."
249 (when (re-search-backward "^<#secure.*>\n" nil t) 272 (when (re-search-backward "^<#secure.*>\n" nil t)
250 (delete-region (match-beginning 0) (match-end 0))))) 273 (delete-region (match-beginning 0) (match-end 0)))))
251 274
275
276(defun mml-secure-message-sign (&optional method)
277 "Add MML tags to sign this MML part.
278Use METHOD if given. Else use `mml-secure-method' or
279`mml-default-sign-method'."
280 (interactive)
281 (mml-secure-part
282 (or method mml-secure-method mml-default-sign-method)
283 'sign))
284
285(defun mml-secure-message-sign-encrypt (&optional method)
286 "Add MML tag to sign and encrypt the entire message.
287Use METHOD if given. Else use `mml-secure-method' or
288`mml-default-sign-method'."
289 (interactive)
290 (mml-secure-message
291 (or method mml-secure-method mml-default-sign-method)
292 'signencrypt))
293
294(defun mml-secure-message-encrypt (&optional method)
295 "Add MML tag to encrypt the entire message.
296Use METHOD if given. Else use `mml-secure-method' or
297`mml-default-sign-method'."
298 (interactive)
299 (mml-secure-message
300 (or method mml-secure-method mml-default-sign-method)
301 'encrypt))
302
252(defun mml-secure-message-sign-smime () 303(defun mml-secure-message-sign-smime ()
253 "Add MML tag to encrypt/sign the entire message." 304 "Add MML tag to encrypt/sign the entire message."
254 (interactive) 305 (interactive)
diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el
index 5fb6da07668..159039914f5 100644
--- a/lisp/gnus/mml.el
+++ b/lisp/gnus/mml.el
@@ -40,7 +40,8 @@
40 (autoload 'message-fetch-field "message") 40 (autoload 'message-fetch-field "message")
41 (autoload 'message-info "message") 41 (autoload 'message-info "message")
42 (autoload 'fill-flowed-encode "flow-fill") 42 (autoload 'fill-flowed-encode "flow-fill")
43 (autoload 'message-posting-charset "message")) 43 (autoload 'message-posting-charset "message")
44 (autoload 'dnd-get-local-file-name "dnd"))
44 45
45(defvar gnus-article-mime-handles) 46(defvar gnus-article-mime-handles)
46(defvar gnus-mouse-2) 47(defvar gnus-mouse-2)
@@ -51,6 +52,7 @@
51(defvar message-posting-charset) 52(defvar message-posting-charset)
52(defvar message-required-mail-headers) 53(defvar message-required-mail-headers)
53(defvar message-required-news-headers) 54(defvar message-required-news-headers)
55(defvar dnd-protocol-alist)
54 56
55(defcustom mml-content-type-parameters 57(defcustom mml-content-type-parameters
56 '(name access-type expiration size permission format) 58 '(name access-type expiration size permission format)
@@ -878,6 +880,11 @@ If HANDLES is non-nil, use it instead reparsing the buffer."
878 (encryptpart (make-sparse-keymap)) 880 (encryptpart (make-sparse-keymap))
879 (map (make-sparse-keymap)) 881 (map (make-sparse-keymap))
880 (main (make-sparse-keymap))) 882 (main (make-sparse-keymap)))
883 (define-key map "\C-s" 'mml-secure-message-sign)
884 (define-key map "\C-c" 'mml-secure-message-encrypt)
885 (define-key map "\C-e" 'mml-secure-message-sign-encrypt)
886 (define-key map "\C-p\C-s" 'mml-secure-sign)
887 (define-key map "\C-p\C-c" 'mml-secure-encrypt)
881 (define-key sign "p" 'mml-secure-message-sign-pgpmime) 888 (define-key sign "p" 'mml-secure-message-sign-pgpmime)
882 (define-key sign "o" 'mml-secure-message-sign-pgp) 889 (define-key sign "o" 'mml-secure-message-sign-pgp)
883 (define-key sign "s" 'mml-secure-message-sign-smime) 890 (define-key sign "s" 'mml-secure-message-sign-smime)
@@ -915,26 +922,54 @@ If HANDLES is non-nil, use it instead reparsing the buffer."
915 ["Attach File..." mml-attach-file 922 ["Attach File..." mml-attach-file
916 ,@(if (featurep 'xemacs) '(t) 923 ,@(if (featurep 'xemacs) '(t)
917 '(:help "Attach a file at point"))] 924 '(:help "Attach a file at point"))]
918 ["Attach Buffer..." mml-attach-buffer t] 925 ["Attach Buffer..." mml-attach-buffer
919 ["Attach External..." mml-attach-external t] 926 ,@(if (featurep 'xemacs) '(t)
920 ["Insert Part..." mml-insert-part t] 927 '(:help "Attach a buffer to the outgoing MIME message"))]
921 ["Insert Multipart..." mml-insert-multipart t] 928 ["Attach External..." mml-attach-external
922 ["PGP/MIME Sign" mml-secure-message-sign-pgpmime t] 929 ,@(if (featurep 'xemacs) '(t)
923 ["PGP/MIME Encrypt" mml-secure-message-encrypt-pgpmime t] 930 '(:help "Attach reference to file"))]
924 ["PGP Sign" mml-secure-message-sign-pgp t] 931 ;;
925 ["PGP Encrypt" mml-secure-message-encrypt-pgp t] 932 ("Change Security Method"
926 ["S/MIME Sign" mml-secure-message-sign-smime t] 933 ["PGP/MIME"
927 ["S/MIME Encrypt" mml-secure-message-encrypt-smime t] 934 (lambda () (interactive) (setq mml-secure-method "pgpmime"))
928 ("Secure MIME part" 935 ,@(if (featurep 'xemacs) nil
929 ["PGP/MIME Sign Part" mml-secure-sign-pgpmime t] 936 '(:help "Set Security Method to PGP/MIME"))
930 ["PGP/MIME Encrypt Part" mml-secure-encrypt-pgpmime t] 937 :style radio
931 ["PGP Sign Part" mml-secure-sign-pgp t] 938 :selected (equal mml-secure-method "pgpmime") ]
932 ["PGP Encrypt Part" mml-secure-encrypt-pgp t] 939 ["S/MIME"
933 ["S/MIME Sign Part" mml-secure-sign-smime t] 940 (lambda () (interactive) (setq mml-secure-method "smime"))
934 ["S/MIME Encrypt Part" mml-secure-encrypt-smime t]) 941 ,@(if (featurep 'xemacs) nil
935 ["Encrypt/Sign off" mml-unsecure-message t] 942 '(:help "Set Security Method to S/MIME"))
943 :style radio
944 :selected (equal mml-secure-method "smime") ]
945 ["Inline PGP"
946 (lambda () (interactive) (setq mml-secure-method "pgp"))
947 ,@(if (featurep 'xemacs) nil
948 '(:help "Set Security Method to inline PGP"))
949 :style radio
950 :selected (equal mml-secure-method "pgp") ] )
951 ;;
952 ["Sign Message" mml-secure-message-sign t]
953 ["Encrypt Message" mml-secure-message-encrypt t]
954 ["Sign and Encrypt Message" mml-secure-message-sign-encrypt t]
955 ["Encrypt/Sign off" mml-unsecure-message
956 ,@(if (featurep 'xemacs) '(t)
957 '(:help "Don't Encrypt/Sign Message"))]
958 ;; Maybe we could remove these, because people who write MML most probably
959 ;; don't use the menu:
960 ["Insert Part..." mml-insert-part
961 :active (message-in-body-p)]
962 ["Insert Multipart..." mml-insert-multipart
963 :active (message-in-body-p)]
964 ;;
965 ;; Do we have separate encrypt and encrypt/sign commands for parts?
966 ["Sign Part" mml-secure-sign t]
967 ["Encrypt Part" mml-secure-encrypt t]
936 ;;["Narrow" mml-narrow-to-part t] 968 ;;["Narrow" mml-narrow-to-part t]
937 ["Quote MML" mml-quote-region t] 969 ["Quote MML in region" mml-quote-region
970 :active (message-mark-active-p)
971 ,@(if (featurep 'xemacs) nil
972 '(:help "Quote MML tags in region"))]
938 ["Validate MML" mml-validate t] 973 ["Validate MML" mml-validate t]
939 ["Preview" mml-preview t] 974 ["Preview" mml-preview t]
940 "----" 975 "----"
@@ -958,8 +993,11 @@ See Info node `(emacs-mime)Composing'.
958 (when (set (make-local-variable 'mml-mode) 993 (when (set (make-local-variable 'mml-mode)
959 (if (null arg) (not mml-mode) 994 (if (null arg) (not mml-mode)
960 (> (prefix-numeric-value arg) 0))) 995 (> (prefix-numeric-value arg) 0)))
961 (gnus-add-minor-mode 'mml-mode " MML" mml-mode-map) 996 (add-minor-mode 'mml-mode " MML" mml-mode-map)
962 (easy-menu-add mml-menu mml-mode-map) 997 (easy-menu-add mml-menu mml-mode-map)
998 (when (boundp 'dnd-protocol-alist)
999 (set (make-local-variable 'dnd-protocol-alist)
1000 (append mml-dnd-protocol-alist dnd-protocol-alist)))
963 (run-hooks 'mml-mode-hook))) 1001 (run-hooks 'mml-mode-hook)))
964 1002
965;;; 1003;;;
@@ -1057,6 +1095,36 @@ See Info node `(emacs-mime)Composing'.
1057 1095
1058;;; Attachment functions. 1096;;; Attachment functions.
1059 1097
1098(defcustom mml-dnd-protocol-alist
1099 '(("^file:///" . mml-dnd-attach-file)
1100 ("^file://" . dnd-open-file)
1101 ("^file:" . mml-dnd-attach-file))
1102 "The functions to call when a drop in `mml-mode' is made.
1103See `dnd-protocol-alist' for more information. When nil, behave
1104as in other buffers."
1105 :type '(choice (repeat (cons (regexp) (function)))
1106 (const :tag "Behave as in other buffers" nil))
1107 :version "22.1" ;; Gnus 5.10.9
1108 :group 'message)
1109
1110(defcustom mml-dnd-attach-options nil
1111 "Which options should be queried when attaching a file via drag and drop.
1112
1113If it is a list, valid members are `type', `description' and
1114`disposition'. `disposition' implies `type'. If it is nil,
1115don't ask for options. If it is t, ask the user whether or not
1116to specify options."
1117 :type '(choice
1118 (const :tag "Non" nil)
1119 (const :tag "Query" t)
1120 (list :value (type description disposition)
1121 (set :inline t
1122 (const type)
1123 (const description)
1124 (const disposition))))
1125 :version "22.1" ;; Gnus 5.10.9
1126 :group 'message)
1127
1060(defun mml-attach-file (file &optional type description disposition) 1128(defun mml-attach-file (file &optional type description disposition)
1061 "Attach a file to the outgoing MIME message. 1129 "Attach a file to the outgoing MIME message.
1062The file is not inserted or encoded until you send the message with 1130The file is not inserted or encoded until you send the message with
@@ -1074,11 +1142,37 @@ body) or \"attachment\" (separate from the body)."
1074 (description (mml-minibuffer-read-description)) 1142 (description (mml-minibuffer-read-description))
1075 (disposition (mml-minibuffer-read-disposition type))) 1143 (disposition (mml-minibuffer-read-disposition type)))
1076 (list file type description disposition))) 1144 (list file type description disposition)))
1077 (mml-insert-empty-tag 'part 1145 (save-excursion
1078 'type type 1146 (unless (message-in-body-p) (goto-char (point-max)))
1079 'filename file 1147 (mml-insert-empty-tag 'part
1080 'disposition (or disposition "attachment") 1148 'type type
1081 'description description)) 1149 'filename file
1150 'disposition (or disposition "attachment")
1151 'description description)))
1152
1153(defun mml-dnd-attach-file (uri action)
1154 "Attach a drag and drop file.
1155
1156Ask for type, description or disposition according to
1157`mml-dnd-attach-options'."
1158 (let ((file (dnd-get-local-file-name uri t)))
1159 (when (and file (file-regular-p file))
1160 (let ((mml-dnd-attach-options mml-dnd-attach-options)
1161 type description disposition)
1162 (setq mml-dnd-attach-options
1163 (when (and (eq mml-dnd-attach-options t)
1164 (not
1165 (y-or-n-p
1166 "Use default type, disposition and description? ")))
1167 '(type description disposition)))
1168 (when (or (memq 'type mml-dnd-attach-options)
1169 (memq 'disposition mml-dnd-attach-options))
1170 (setq type (mml-minibuffer-read-type file)))
1171 (when (memq 'description mml-dnd-attach-options)
1172 (setq description (mml-minibuffer-read-description)))
1173 (when (memq 'disposition mml-dnd-attach-options)
1174 (setq disposition (mml-minibuffer-read-disposition type)))
1175 (mml-attach-file file type description disposition)))))
1082 1176
1083(defun mml-attach-buffer (buffer &optional type description) 1177(defun mml-attach-buffer (buffer &optional type description)
1084 "Attach a buffer to the outgoing MIME message. 1178 "Attach a buffer to the outgoing MIME message.
@@ -1088,8 +1182,11 @@ See `mml-attach-file' for details of operation."
1088 (type (mml-minibuffer-read-type buffer "text/plain")) 1182 (type (mml-minibuffer-read-type buffer "text/plain"))
1089 (description (mml-minibuffer-read-description))) 1183 (description (mml-minibuffer-read-description)))
1090 (list buffer type description))) 1184 (list buffer type description)))
1091 (mml-insert-empty-tag 'part 'type type 'buffer buffer 1185 (save-excursion
1092 'disposition "attachment" 'description description)) 1186 (unless (message-in-body-p) (goto-char (point-max)))
1187 (mml-insert-empty-tag 'part 'type type 'buffer buffer
1188 'disposition "attachment"
1189 'description description)))
1093 1190
1094(defun mml-attach-external (file &optional type description) 1191(defun mml-attach-external (file &optional type description)
1095 "Attach an external file into the buffer. 1192 "Attach an external file into the buffer.
@@ -1100,8 +1197,10 @@ TYPE is the MIME type to use."
1100 (type (mml-minibuffer-read-type file)) 1197 (type (mml-minibuffer-read-type file))
1101 (description (mml-minibuffer-read-description))) 1198 (description (mml-minibuffer-read-description)))
1102 (list file type description))) 1199 (list file type description)))
1103 (mml-insert-empty-tag 'external 'type type 'name file 1200 (save-excursion
1104 'disposition "attachment" 'description description)) 1201 (unless (message-in-body-p) (goto-char (point-max)))
1202 (mml-insert-empty-tag 'external 'type type 'name file
1203 'disposition "attachment" 'description description)))
1105 1204
1106(defun mml-insert-multipart (&optional type) 1205(defun mml-insert-multipart (&optional type)
1107 (interactive (list (completing-read "Multipart type (default mixed): " 1206 (interactive (list (completing-read "Multipart type (default mixed): "
diff --git a/lisp/gnus/mml1991.el b/lisp/gnus/mml1991.el
index 0c6bb675388..23953cd6208 100644
--- a/lisp/gnus/mml1991.el
+++ b/lisp/gnus/mml1991.el
@@ -229,23 +229,25 @@
229 (defvar pgg-output-buffer)) 229 (defvar pgg-output-buffer))
230 230
231(defun mml1991-pgg-sign (cont) 231(defun mml1991-pgg-sign (cont)
232 ;; Make sure to load pgg.el before binding pgg-* variables.
233 (require 'pgg)
232 (let ((pgg-text-mode t) 234 (let ((pgg-text-mode t)
235 (pgg-default-user-id (or (message-options-get 'mml-sender)
236 pgg-default-user-id))
233 headers cte) 237 headers cte)
234 ;; Don't sign headers. 238 ;; Don't sign headers.
235 (goto-char (point-min)) 239 (goto-char (point-min))
236 (while (not (looking-at "^$")) 240 (when (re-search-forward "^$" nil t)
237 (forward-line))
238 (unless (eobp) ;; no headers?
239 (setq headers (buffer-substring (point-min) (point))) 241 (setq headers (buffer-substring (point-min) (point)))
240 (forward-line) ;; skip header/body separator 242 (save-restriction
241 (delete-region (point-min) (point))) 243 (narrow-to-region (point-min) (point))
242 (when (string-match "^Content-Transfer-Encoding: \\(.+\\)" headers) 244 (setq cte (mail-fetch-field "content-transfer-encoding")))
243 (setq cte (intern (match-string 1 headers)))) 245 (forward-line 1)
244 (mm-decode-content-transfer-encoding cte) 246 (delete-region (point-min) (point))
245 (unless (let ((pgg-default-user-id 247 (when cte
246 (or (message-options-get 'mml-sender) 248 (setq cte (intern (downcase cte)))
247 pgg-default-user-id))) 249 (mm-decode-content-transfer-encoding cte)))
248 (pgg-sign-region (point-min) (point-max) t)) 250 (unless (pgg-sign-region (point-min) (point-max) t)
249 (pop-to-buffer pgg-errors-buffer) 251 (pop-to-buffer pgg-errors-buffer)
250 (error "Encrypt error")) 252 (error "Encrypt error"))
251 (delete-region (point-min) (point-max)) 253 (delete-region (point-min) (point-max))
@@ -254,7 +256,8 @@
254 (goto-char (point-min)) 256 (goto-char (point-min))
255 (while (re-search-forward "\r+$" nil t) 257 (while (re-search-forward "\r+$" nil t)
256 (replace-match "" t t)) 258 (replace-match "" t t))
257 (mm-encode-content-transfer-encoding cte) 259 (when cte
260 (mm-encode-content-transfer-encoding cte))
258 (goto-char (point-min)) 261 (goto-char (point-min))
259 (when headers 262 (when headers
260 (insert headers)) 263 (insert headers))
@@ -262,34 +265,35 @@
262 t)) 265 t))
263 266
264(defun mml1991-pgg-encrypt (cont &optional sign) 267(defun mml1991-pgg-encrypt (cont &optional sign)
265 (let ((pgg-text-mode t) 268 (goto-char (point-min))
266 cte) 269 (when (re-search-forward "^$" nil t)
267 ;; Strip MIME Content[^ ]: headers since it will be ASCII ARMOURED 270 (let ((cte (save-restriction
268 (goto-char (point-min)) 271 (narrow-to-region (point-min) (point))
269 (while (looking-at "^Content[^ ]+:") 272 (mail-fetch-field "content-transfer-encoding"))))
270 (when (looking-at "^Content-Transfer-Encoding: \\(.+\\)") 273 ;; Strip MIME headers since it will be ASCII armoured.
271 (setq cte (intern (match-string 1)))) 274 (forward-line 1)
272 (forward-line)) 275 (delete-region (point-min) (point))
273 (unless (bobp) 276 (when cte
274 (delete-region (point-min) (point))) 277 (mm-decode-content-transfer-encoding (intern (downcase cte))))))
275 (mm-decode-content-transfer-encoding cte) 278 (unless (progn
276 (unless (pgg-encrypt-region 279 ;; Make sure to load pgg.el before binding `pgg-text-mode'.
277 (point-min) (point-max) 280 (require 'pgg)
278 (split-string 281 (let ((pgg-text-mode t))
279 (or 282 (pgg-encrypt-region
280 (message-options-get 'message-recipients) 283 (point-min) (point-max)
281 (message-options-set 'message-recipients 284 (split-string
282 (read-string "Recipients: "))) 285 (or
283 "[ \f\t\n\r\v,]+") 286 (message-options-get 'message-recipients)
284 sign) 287 (message-options-set 'message-recipients
285 (pop-to-buffer pgg-errors-buffer) 288 (read-string "Recipients: ")))
286 (error "Encrypt error")) 289 "[ \f\t\n\r\v,]+")
287 (delete-region (point-min) (point-max)) 290 sign)))
288 ;;(insert "Content-Type: application/pgp-encrypted\n\n") 291 (pop-to-buffer pgg-errors-buffer)
289 ;;(insert "Version: 1\n\n") 292 (error "Encrypt error"))
290 (insert "\n") 293 (delete-region (point-min) (point-max))
291 (insert-buffer-substring pgg-output-buffer) 294 (insert "\n")
292 t)) 295 (insert-buffer-substring pgg-output-buffer)
296 t)
293 297
294;;;###autoload 298;;;###autoload
295(defun mml1991-encrypt (cont &optional sign) 299(defun mml1991-encrypt (cont &optional sign)
diff --git a/lisp/gnus/nnweb.el b/lisp/gnus/nnweb.el
index 134b62e97b9..a67d5a469f6 100644
--- a/lisp/gnus/nnweb.el
+++ b/lisp/gnus/nnweb.el
@@ -307,8 +307,8 @@ Valid types include `google', `dejanews', and `gmane'.")
307(defun nnweb-google-wash-article () 307(defun nnweb-google-wash-article ()
308 ;; We have Google's masked e-mail addresses here. :-/ 308 ;; We have Google's masked e-mail addresses here. :-/
309 (let ((case-fold-search t) 309 (let ((case-fold-search t)
310 (start-re "<pre>\n *") 310 (start-re "<pre>[\r\n ]*")
311 (end-re "\n *</pre>")) 311 (end-re "[\r\n ]*</pre>"))
312 (goto-char (point-min)) 312 (goto-char (point-min))
313 (if (save-excursion 313 (if (save-excursion
314 (or (re-search-forward "The requested message.*could not be found." 314 (or (re-search-forward "The requested message.*could not be found."
diff --git a/man/ChangeLog b/man/ChangeLog
index 020da464a18..1f417968fa9 100644
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,3 +1,12 @@
12006-04-26 Reiner Steib <Reiner.Steib@gmx.de>
2
3 * pgg.texi (Caching passphrase): Fix markup and typos. Simplify.
4
52006-04-26 Sascha Wilde <wilde@sha-bang.de>
6
7 * pgg.texi (Caching passphrase): Added documentation for
8 pgg-gpg-use-agent.
9
12006-04-24 Bill Wohler <wohler@newt.com> 102006-04-24 Bill Wohler <wohler@newt.com>
2 11
3 * mh-e.texi (Getting Started): Made it more explicit that you need 12 * mh-e.texi (Getting Started): Made it more explicit that you need
diff --git a/man/pgg.texi b/man/pgg.texi
index 80dce7a9639..b8934b526e3 100644
--- a/man/pgg.texi
+++ b/man/pgg.texi
@@ -234,6 +234,14 @@ variable to @code{nil}.
234Elapsed time for expiration in seconds. 234Elapsed time for expiration in seconds.
235@end defvar 235@end defvar
236 236
237@defvar pgg-gpg-use-agent
238When using GnuPG (gpg) as PGP scheme you can use @code{gpg-agent} for
239caching@footnote{Actually @code{gpg-agent} does not cache passphrases
240but private keys. On the other hand, from a users point of view this
241technical difference isn't visible.}. If non-@code{nil} try to use a
242running @code{gpg-agent}. It defaults to @code{nil}.
243@end defvar
244
237@node Default user identity 245@node Default user identity
238@section Default user identity 246@section Default user identity
239 247