annotate lisp/mh-e/mh-gnus.el @ 106075:c05b4dd65527

*** empty log message ***
author Jay Belanger <jay.p.belanger@gmail.com>
date Mon, 16 Nov 2009 23:41:36 +0000
parents 3688f1456c9e
children 1d1d5d9bd884
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
1 ;;; mh-gnus.el --- make MH-E compatible with various versions of Gnus
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
2
101472
f3a44ea3d1ae Follow Glenn's lead and update format of Copyright.
Bill Wohler <wohler@newt.com>
parents: 100908
diff changeset
3 ;; Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009
f3a44ea3d1ae Follow Glenn's lead and update format of Copyright.
Bill Wohler <wohler@newt.com>
parents: 100908
diff changeset
4 ;; Free Software Foundation, Inc.
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
5
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
6 ;; Author: Satyaki Das <satyaki@theforce.stanford.edu>
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
7 ;; Maintainer: Bill Wohler <wohler@newt.com>
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
8 ;; Keywords: mail
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
9 ;; See: mh-e.el
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
10
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
11 ;; This file is part of GNU Emacs.
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
12
94663
90c9ebd43589 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
13 ;; GNU Emacs is free software: you can redistribute it and/or modify
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
14 ;; it under the terms of the GNU General Public License as published by
94663
90c9ebd43589 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
15 ;; the Free Software Foundation, either version 3 of the License, or
90c9ebd43589 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
16 ;; (at your option) any later version.
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
17
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
18 ;; GNU Emacs is distributed in the hope that it will be useful,
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
19 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
21 ;; GNU General Public License for more details.
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
22
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
23 ;; You should have received a copy of the GNU General Public License
94663
90c9ebd43589 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
24 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
25
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
26 ;;; Commentary:
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
27
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
28 ;;; Change Log:
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
29
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
30 ;;; Code:
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
31
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
32 (require 'mh-e)
68137
ec4727559827 * mh-acros.el (mh-defun-compat, mh-defmacro-compat): Move here from
Bill Wohler <wohler@newt.com>
parents: 67758
diff changeset
33
68529
7daec5f4a289 * mh-alias.el (mh-alias-gecos-name): Use mh-replace-regexp-in-string
Bill Wohler <wohler@newt.com>
parents: 68520
diff changeset
34 (mh-require 'gnus-util nil t)
7daec5f4a289 * mh-alias.el (mh-alias-gecos-name): Use mh-replace-regexp-in-string
Bill Wohler <wohler@newt.com>
parents: 68520
diff changeset
35 (mh-require 'mm-bodies nil t)
7daec5f4a289 * mh-alias.el (mh-alias-gecos-name): Use mh-replace-regexp-in-string
Bill Wohler <wohler@newt.com>
parents: 68520
diff changeset
36 (mh-require 'mm-decode nil t)
7daec5f4a289 * mh-alias.el (mh-alias-gecos-name): Use mh-replace-regexp-in-string
Bill Wohler <wohler@newt.com>
parents: 68520
diff changeset
37 (mh-require 'mm-view nil t)
7daec5f4a289 * mh-alias.el (mh-alias-gecos-name): Use mh-replace-regexp-in-string
Bill Wohler <wohler@newt.com>
parents: 68520
diff changeset
38 (mh-require 'mml nil t)
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
39
68137
ec4727559827 * mh-acros.el (mh-defun-compat, mh-defmacro-compat): Move here from
Bill Wohler <wohler@newt.com>
parents: 67758
diff changeset
40 ;; Copy of function from gnus-util.el.
101559
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
41 ;; TODO This is not in Gnus 5.11.
70061
b3ab71ac7f4e * mh-acros.el (mh-defun-compat): Rename to defun-mh in order that
Bill Wohler <wohler@newt.com>
parents: 68529
diff changeset
42 (defun-mh mh-gnus-local-map-property gnus-local-map-property (map)
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
43 "Return a list suitable for a text property list specifying keymap MAP."
86202
794e428cd497 * eshell/esh-util.el (eshell-under-xemacs-p): Remove.
Dan Nicolaescu <dann@ics.uci.edu>
parents: 78231
diff changeset
44 (cond ((featurep 'xemacs) (list 'keymap map))
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
45 ((>= emacs-major-version 21) (list 'keymap map))
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
46 (t (list 'local-map map))))
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
47
68137
ec4727559827 * mh-acros.el (mh-defun-compat, mh-defmacro-compat): Move here from
Bill Wohler <wohler@newt.com>
parents: 67758
diff changeset
48 ;; Copy of function from mm-decode.el.
70061
b3ab71ac7f4e * mh-acros.el (mh-defun-compat): Rename to defun-mh in order that
Bill Wohler <wohler@newt.com>
parents: 68529
diff changeset
49 (defun-mh mh-mm-merge-handles mm-merge-handles (handles1 handles2)
101559
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
50 (append
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
51 (if (listp (car handles1))
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
52 handles1
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
53 (list handles1))
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
54 (if (listp (car handles2))
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
55 handles2
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
56 (list handles2))))
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
57
66354
cf99ce27df54 * mh-comp.el (mh-letter-menu): Rename
Bill Wohler <wohler@newt.com>
parents: 64085
diff changeset
58 ;; Copy of function from mm-decode.el.
70061
b3ab71ac7f4e * mh-acros.el (mh-defun-compat): Rename to defun-mh in order that
Bill Wohler <wohler@newt.com>
parents: 68529
diff changeset
59 (defun-mh mh-mm-set-handle-multipart-parameter
68520
6a7173abcf59 * mh-acros.el (mh-defun-compat, mh-defmacro-compat): Add name argument
Bill Wohler <wohler@newt.com>
parents: 68465
diff changeset
60 mm-set-handle-multipart-parameter (handle parameter value)
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
61 ;; HANDLE could be a CTL.
101559
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
62 (when handle
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
63 (put-text-property 0 (length (car handle)) parameter value
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
64 (car handle))))
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
65
66354
cf99ce27df54 * mh-comp.el (mh-letter-menu): Rename
Bill Wohler <wohler@newt.com>
parents: 64085
diff changeset
66 ;; Copy of function from mm-view.el.
70061
b3ab71ac7f4e * mh-acros.el (mh-defun-compat): Rename to defun-mh in order that
Bill Wohler <wohler@newt.com>
parents: 68529
diff changeset
67 (defun-mh mh-mm-inline-text-vcard mm-inline-text-vcard (handle)
101559
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
68 (let ((inhibit-read-only t))
56673
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56409
diff changeset
69 (mm-insert-inline
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56409
diff changeset
70 handle
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56409
diff changeset
71 (concat "\n-- \n"
101559
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
72 (ignore-errors
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
73 (if (fboundp 'vcard-pretty-print)
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
74 (vcard-pretty-print (mm-get-part handle))
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
75 (vcard-format-string
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
76 (vcard-parse-string (mm-get-part handle)
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
77 'vcard-standard-filter))))))))
56673
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56409
diff changeset
78
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56409
diff changeset
79 ;; Function from mm-decode.el used in PGP messages. Just define it with older
66354
cf99ce27df54 * mh-comp.el (mh-letter-menu): Rename
Bill Wohler <wohler@newt.com>
parents: 64085
diff changeset
80 ;; Gnus to avoid compiler warning.
70061
b3ab71ac7f4e * mh-acros.el (mh-defun-compat): Rename to defun-mh in order that
Bill Wohler <wohler@newt.com>
parents: 68529
diff changeset
81 (defun-mh mh-mm-possibly-verify-or-decrypt
68520
6a7173abcf59 * mh-acros.el (mh-defun-compat, mh-defmacro-compat): Add name argument
Bill Wohler <wohler@newt.com>
parents: 68465
diff changeset
82 mm-possibly-verify-or-decrypt (parts ctl)
56673
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56409
diff changeset
83 nil)
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56409
diff changeset
84
68137
ec4727559827 * mh-acros.el (mh-defun-compat, mh-defmacro-compat): Move here from
Bill Wohler <wohler@newt.com>
parents: 67758
diff changeset
85 ;; Copy of macro in mm-decode.el.
70061
b3ab71ac7f4e * mh-acros.el (mh-defun-compat): Rename to defun-mh in order that
Bill Wohler <wohler@newt.com>
parents: 68529
diff changeset
86 (defmacro-mh mh-mm-handle-multipart-ctl-parameter
68520
6a7173abcf59 * mh-acros.el (mh-defun-compat, mh-defmacro-compat): Add name argument
Bill Wohler <wohler@newt.com>
parents: 68465
diff changeset
87 mm-handle-multipart-ctl-parameter (handle parameter)
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
88 `(get-text-property 0 ,parameter (car ,handle)))
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
89
68137
ec4727559827 * mh-acros.el (mh-defun-compat, mh-defmacro-compat): Move here from
Bill Wohler <wohler@newt.com>
parents: 67758
diff changeset
90 ;; Copy of function in mm-decode.el.
70061
b3ab71ac7f4e * mh-acros.el (mh-defun-compat): Rename to defun-mh in order that
Bill Wohler <wohler@newt.com>
parents: 68529
diff changeset
91 (defun-mh mh-mm-readable-p mm-readable-p (handle)
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
92 "Say whether the content of HANDLE is readable."
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
93 (and (< (with-current-buffer (mm-handle-buffer handle)
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
94 (buffer-size)) 10000)
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
95 (mm-with-unibyte-buffer
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
96 (mm-insert-part handle)
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
97 (and (eq (mm-body-7-or-8) '7bit)
68520
6a7173abcf59 * mh-acros.el (mh-defun-compat, mh-defmacro-compat): Add name argument
Bill Wohler <wohler@newt.com>
parents: 68465
diff changeset
98 (not (mh-mm-long-lines-p 76))))))
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
99
68137
ec4727559827 * mh-acros.el (mh-defun-compat, mh-defmacro-compat): Move here from
Bill Wohler <wohler@newt.com>
parents: 67758
diff changeset
100 ;; Copy of function in mm-bodies.el.
70061
b3ab71ac7f4e * mh-acros.el (mh-defun-compat): Rename to defun-mh in order that
Bill Wohler <wohler@newt.com>
parents: 68529
diff changeset
101 (defun-mh mh-mm-long-lines-p mm-long-lines-p (length)
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
102 "Say whether any of the lines in the buffer is longer than LENGTH."
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
103 (save-excursion
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
104 (goto-char (point-min))
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
105 (end-of-line)
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
106 (while (and (not (eobp))
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
107 (not (> (current-column) length)))
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
108 (forward-line 1)
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
109 (end-of-line))
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
110 (and (> (current-column) length)
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
111 (current-column))))
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
112
70061
b3ab71ac7f4e * mh-acros.el (mh-defun-compat): Rename to defun-mh in order that
Bill Wohler <wohler@newt.com>
parents: 68529
diff changeset
113 (defun-mh mh-mm-keep-viewer-alive-p mm-keep-viewer-alive-p (handle)
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
114 ;; Released Gnus doesn't keep handles associated with externally displayed
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
115 ;; MIME parts. So this will always return nil.
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
116 nil)
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
117
70061
b3ab71ac7f4e * mh-acros.el (mh-defun-compat): Rename to defun-mh in order that
Bill Wohler <wohler@newt.com>
parents: 68529
diff changeset
118 (defun-mh mh-mm-destroy-parts mm-destroy-parts (list)
66354
cf99ce27df54 * mh-comp.el (mh-letter-menu): Rename
Bill Wohler <wohler@newt.com>
parents: 64085
diff changeset
119 "Older versions of Emacs don't have this function."
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
120 nil)
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
121
70061
b3ab71ac7f4e * mh-acros.el (mh-defun-compat): Rename to defun-mh in order that
Bill Wohler <wohler@newt.com>
parents: 68529
diff changeset
122 (defun-mh mh-mm-uu-dissect-text-parts mm-uu-dissect-text-parts (handles)
68465
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
123 "Emacs 21 and XEmacs don't have this function."
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
124 nil)
37d03b3298bf The Great Cleanup
Bill Wohler <wohler@newt.com>
parents: 68199
diff changeset
125
68137
ec4727559827 * mh-acros.el (mh-defun-compat, mh-defmacro-compat): Move here from
Bill Wohler <wohler@newt.com>
parents: 67758
diff changeset
126 ;; Copy of function in mml.el.
70061
b3ab71ac7f4e * mh-acros.el (mh-defun-compat): Rename to defun-mh in order that
Bill Wohler <wohler@newt.com>
parents: 68529
diff changeset
127 (defun-mh mh-mml-minibuffer-read-disposition
101559
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
128 mml-minibuffer-read-disposition (type &optional default filename)
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
129 (unless default
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
130 (setq default (mml-content-disposition type filename)))
66354
cf99ce27df54 * mh-comp.el (mh-letter-menu): Rename
Bill Wohler <wohler@newt.com>
parents: 64085
diff changeset
131 (let ((disposition (completing-read
101559
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
132 (format "Disposition (default %s): " default)
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
133 '(("attachment") ("inline") (""))
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
134 nil t nil nil default)))
66354
cf99ce27df54 * mh-comp.el (mh-letter-menu): Rename
Bill Wohler <wohler@newt.com>
parents: 64085
diff changeset
135 (if (not (equal disposition ""))
101559
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
136 disposition
66354
cf99ce27df54 * mh-comp.el (mh-letter-menu): Rename
Bill Wohler <wohler@newt.com>
parents: 64085
diff changeset
137 default)))
cf99ce27df54 * mh-comp.el (mh-letter-menu): Rename
Bill Wohler <wohler@newt.com>
parents: 64085
diff changeset
138
101559
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
139 ;; This is mm-save-part from Gnus 5.11 since that function in Emacs
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
140 ;; 21.2 is buggy (the args to read-file-name are incorrect) and the
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
141 ;; version in Emacs 22 is not consistent with C-x C-w in that you
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
142 ;; can't just specify a directory and have the right thing happen.
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
143 (defun mh-mm-save-part (handle &optional prompt)
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
144 "Write HANDLE to a file.
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
145 PROMPT overrides the default one used to ask user for a file name."
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
146 (let ((filename (or (mail-content-type-get
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
147 (mm-handle-disposition handle) 'filename)
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
148 (mail-content-type-get
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
149 (mm-handle-type handle) 'name)))
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
150 file)
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
151 (when filename
101559
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
152 (setq filename (gnus-map-function mm-file-name-rewrite-functions
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
153 (file-name-nondirectory filename))))
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
154 (setq file
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
155 (read-file-name (or prompt "Save MIME part to: ")
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
156 (or mm-default-directory default-directory)
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
157 nil nil (or filename "")))
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
158 (setq mm-default-directory (file-name-directory file))
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
159 (and (or (not (file-exists-p file))
101559
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
160 (yes-or-no-p (format "File %s already exists; overwrite? "
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
161 file)))
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
162 (progn
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
163 (mm-save-part-to-file handle file)
3688f1456c9e (mh-mm-merge-handles)
Bill Wohler <wohler@newt.com>
parents: 101472
diff changeset
164 file))))
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
165
56673
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56409
diff changeset
166 (defun mh-mm-text-html-renderer ()
66354
cf99ce27df54 * mh-comp.el (mh-letter-menu): Rename
Bill Wohler <wohler@newt.com>
parents: 64085
diff changeset
167 "Find the renderer Gnus is using to display text/html MIME parts."
56673
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56409
diff changeset
168 (or (and (boundp 'mm-inline-text-html-renderer) mm-inline-text-html-renderer)
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56409
diff changeset
169 (and (boundp 'mm-text-html-renderer) mm-text-html-renderer)))
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56409
diff changeset
170
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
171 (provide 'mh-gnus)
56673
e9a6cbc8ca5e Upgraded to MH-E version 7.4.80.
Bill Wohler <wohler@newt.com>
parents: 56409
diff changeset
172
67681
3a8785724cca * mh-acros.el:
Bill Wohler <wohler@newt.com>
parents: 66410
diff changeset
173 ;; Local Variables:
3a8785724cca * mh-acros.el:
Bill Wohler <wohler@newt.com>
parents: 66410
diff changeset
174 ;; no-byte-compile: t
3a8785724cca * mh-acros.el:
Bill Wohler <wohler@newt.com>
parents: 66410
diff changeset
175 ;; no-update-autoloads: t
3a8785724cca * mh-acros.el:
Bill Wohler <wohler@newt.com>
parents: 66410
diff changeset
176 ;; indent-tabs-mode: nil
3a8785724cca * mh-acros.el:
Bill Wohler <wohler@newt.com>
parents: 66410
diff changeset
177 ;; sentence-end-double-space: nil
3a8785724cca * mh-acros.el:
Bill Wohler <wohler@newt.com>
parents: 66410
diff changeset
178 ;; End:
56409
e6932c8dd59b Changes from arch/CVS synchronization
Miles Bader <miles@gnu.org>
parents: 56406
diff changeset
179
e6932c8dd59b Changes from arch/CVS synchronization
Miles Bader <miles@gnu.org>
parents: 56406
diff changeset
180 ;; arch-tag: 1e3638af-cad3-4c69-8427-bc8eb6e5e4fa
56406
d36b00b98db0 Upgraded to MH-E version 7.4.4.
Bill Wohler <wohler@newt.com>
parents:
diff changeset
181 ;;; mh-gnus.el ends here