comparison lisp/mh-e/mh-gnus.el @ 68520:6a7173abcf59

* mh-acros.el (mh-defun-compat, mh-defmacro-compat): Add name argument since compatibility functions should have our package prefix (mh-) by Emacs convention and to avoid messing up checks for the same functions in other packages. Use explicit argument instead of forming name by adding mh-e prefix so that one can grep and find the definition. * mh-alias.el (mh-alias-local-users, mh-alias-reload) (mh-alias-expand, mh-alias-minibuffer-confirm-address): Use mh-assoc-string instead of assoc-string. * mh-compat.el (assoc-string): Rename to mh-assoc-string. (mh-mail-abbrev-make-syntax-table, mh-url-hexify-string): Move here from mh-utils.el. (mh-display-completion-list): Move here from mh-comp.el. (mh-face-foreground, mh-face-background): Move here from mh-xface.el. (mh-write-file-functions): Move here from mh-folder.el * mh-folder.el (mh-write-file-functions-compat): Move to mh-compat.el and rename to mh-write-file-functions. (mh-folder-mode): Use the new name. * mh-gnus.el (gnus-local-map-property): Rename to mh-gnus-local-map-property. (mm-merge-handles): Rename to mh-mm-merge-handles. (mm-set-handle-multipart-parameter): Rename to mh-mm-set-handle-multipart-parameter. (mm-inline-text-vcard): Rename to mh-mm-inline-text-vcard. (mm-possibly-verify-or-decrypt): Rename to mh-mm-possibly-verify-or-decrypt. (mm-handle-multipart-ctl-parameter): Rename to mh-mm-handle-multipart-ctl-parameter. (mm-readable-p): Rename to mh-mm-readable-p. (mm-long-lines-p): Rename to mh-mm-long-lines-p. (mm-keep-viewer-alive-p): Rename to mh-mm-keep-viewer-alive-p. (mm-destroy-parts): Rename to mh-mm-destroy-parts. (mm-uu-dissect-text-parts): Rename to mh-mm-uu-dissect-text-parts. (mml-minibuffer-read-disposition): Rename to mh-mml-minibuffer-read-disposition. * mh-identity.el (mh-identity-field-handler): Use mh-assoc-string instead of assoc-string. * mh-mime.el (mh-mm-inline-media-tests, mh-mm-inline-message) (mh-mime-display, mh-mime-display-security) (mh-insert-mime-button, mh-insert-mime-security-button) (mh-handle-set-external-undisplayer) (mh-mime-security-press-button, mh-mime-security-show-details) (mh-mml-attach-file, mh-mime-cleanup) (mh-destroy-postponed-handles): Use new mh-* names for compatibility functions. * mh-utils.el (mail-abbrev-make-syntax-table): Move to mh-compat.el and rename to mh-mail-abbrev-make-syntax-table. (mh-beginning-of-word): Use the new name. (mh-get-field): Delete ancient alias. * mh-xface.el (mh-face-foreground-compat): Move to mh-compat.el and rename to mh-face-foreground (mh-face-background-compat): Move to mh-compat.el and rename to mh-face-background. (mh-face-display-function): Use the new names. (mh-x-image-url-cache-canonicalize): Use mh-url-hexify-string instead of url-hexify-string. (url-unreserved-chars): Move to mh-compat.el and rename to mh-url-unreserved-chars. (url-hexify-string): Move to mh-compat.el and rename to mh-url-hexify-string.
author Bill Wohler <wohler@newt.com>
date Tue, 31 Jan 2006 20:46:15 +0000
parents 37d03b3298bf
children 7daec5f4a289
comparison
equal deleted inserted replaced
68519:bf46ace1ce4e 68520:6a7173abcf59
37 (require 'mm-decode nil t) 37 (require 'mm-decode nil t)
38 (require 'mm-view nil t) 38 (require 'mm-view nil t)
39 (require 'mml nil t) 39 (require 'mml nil t)
40 40
41 ;; Copy of function from gnus-util.el. 41 ;; Copy of function from gnus-util.el.
42 (mh-defun-compat gnus-local-map-property (map) 42 (mh-defun-compat mh-gnus-local-map-property gnus-local-map-property (map)
43 "Return a list suitable for a text property list specifying keymap MAP." 43 "Return a list suitable for a text property list specifying keymap MAP."
44 (cond (mh-xemacs-flag (list 'keymap map)) 44 (cond (mh-xemacs-flag (list 'keymap map))
45 ((>= emacs-major-version 21) (list 'keymap map)) 45 ((>= emacs-major-version 21) (list 'keymap map))
46 (t (list 'local-map map)))) 46 (t (list 'local-map map))))
47 47
48 ;; Copy of function from mm-decode.el. 48 ;; Copy of function from mm-decode.el.
49 (mh-defun-compat mm-merge-handles (handles1 handles2) 49 (mh-defun-compat mh-mm-merge-handles mm-merge-handles (handles1 handles2)
50 (append (if (listp (car handles1)) handles1 (list handles1)) 50 (append (if (listp (car handles1)) handles1 (list handles1))
51 (if (listp (car handles2)) handles2 (list handles2)))) 51 (if (listp (car handles2)) handles2 (list handles2))))
52 52
53 ;; Copy of function from mm-decode.el. 53 ;; Copy of function from mm-decode.el.
54 (mh-defun-compat mm-set-handle-multipart-parameter (handle parameter value) 54 (mh-defun-compat mh-mm-set-handle-multipart-parameter
55 mm-set-handle-multipart-parameter (handle parameter value)
55 ;; HANDLE could be a CTL. 56 ;; HANDLE could be a CTL.
56 (if handle 57 (if handle
57 (put-text-property 0 (length (car handle)) parameter value 58 (put-text-property 0 (length (car handle)) parameter value
58 (car handle)))) 59 (car handle))))
59 60
60 ;; Copy of function from mm-view.el. 61 ;; Copy of function from mm-view.el.
61 (mh-defun-compat mm-inline-text-vcard (handle) 62 (mh-defun-compat mh-mm-inline-text-vcard mm-inline-text-vcard (handle)
62 (let (buffer-read-only) 63 (let (buffer-read-only)
63 (mm-insert-inline 64 (mm-insert-inline
64 handle 65 handle
65 (concat "\n-- \n" 66 (concat "\n-- \n"
66 (ignore-errors 67 (ignore-errors
70 (vcard-parse-string (mm-get-part handle) 71 (vcard-parse-string (mm-get-part handle)
71 'vcard-standard-filter)))))))) 72 'vcard-standard-filter))))))))
72 73
73 ;; Function from mm-decode.el used in PGP messages. Just define it with older 74 ;; Function from mm-decode.el used in PGP messages. Just define it with older
74 ;; Gnus to avoid compiler warning. 75 ;; Gnus to avoid compiler warning.
75 (mh-defun-compat mm-possibly-verify-or-decrypt (parts ctl) 76 (mh-defun-compat mh-mm-possibly-verify-or-decrypt
77 mm-possibly-verify-or-decrypt (parts ctl)
76 nil) 78 nil)
77 79
78 ;; Copy of macro in mm-decode.el. 80 ;; Copy of macro in mm-decode.el.
79 (mh-defmacro-compat mm-handle-multipart-ctl-parameter (handle parameter) 81 (mh-defmacro-compat mh-mm-handle-multipart-ctl-parameter
82 mm-handle-multipart-ctl-parameter (handle parameter)
80 `(get-text-property 0 ,parameter (car ,handle))) 83 `(get-text-property 0 ,parameter (car ,handle)))
81 84
82 ;; Copy of function in mm-decode.el. 85 ;; Copy of function in mm-decode.el.
83 (mh-defun-compat mm-readable-p (handle) 86 (mh-defun-compat mh-mm-readable-p mm-readable-p (handle)
84 "Say whether the content of HANDLE is readable." 87 "Say whether the content of HANDLE is readable."
85 (and (< (with-current-buffer (mm-handle-buffer handle) 88 (and (< (with-current-buffer (mm-handle-buffer handle)
86 (buffer-size)) 10000) 89 (buffer-size)) 10000)
87 (mm-with-unibyte-buffer 90 (mm-with-unibyte-buffer
88 (mm-insert-part handle) 91 (mm-insert-part handle)
89 (and (eq (mm-body-7-or-8) '7bit) 92 (and (eq (mm-body-7-or-8) '7bit)
90 (not (mm-long-lines-p 76)))))) 93 (not (mh-mm-long-lines-p 76))))))
91 94
92 ;; Copy of function in mm-bodies.el. 95 ;; Copy of function in mm-bodies.el.
93 (mh-defun-compat mm-long-lines-p (length) 96 (mh-defun-compat mh-mm-long-lines-p mm-long-lines-p (length)
94 "Say whether any of the lines in the buffer is longer than LENGTH." 97 "Say whether any of the lines in the buffer is longer than LENGTH."
95 (save-excursion 98 (save-excursion
96 (goto-char (point-min)) 99 (goto-char (point-min))
97 (end-of-line) 100 (end-of-line)
98 (while (and (not (eobp)) 101 (while (and (not (eobp))
100 (forward-line 1) 103 (forward-line 1)
101 (end-of-line)) 104 (end-of-line))
102 (and (> (current-column) length) 105 (and (> (current-column) length)
103 (current-column)))) 106 (current-column))))
104 107
105 (mh-defun-compat mm-keep-viewer-alive-p (handle) 108 (mh-defun-compat mh-mm-keep-viewer-alive-p mm-keep-viewer-alive-p (handle)
106 ;; Released Gnus doesn't keep handles associated with externally displayed 109 ;; Released Gnus doesn't keep handles associated with externally displayed
107 ;; MIME parts. So this will always return nil. 110 ;; MIME parts. So this will always return nil.
108 nil) 111 nil)
109 112
110 (mh-defun-compat mm-destroy-parts (list) 113 (mh-defun-compat mh-mm-destroy-parts mm-destroy-parts (list)
111 "Older versions of Emacs don't have this function." 114 "Older versions of Emacs don't have this function."
112 nil) 115 nil)
113 116
114 (mh-defun-compat mm-uu-dissect-text-parts (handles) 117 (mh-defun-compat mh-mm-uu-dissect-text-parts mm-uu-dissect-text-parts (handles)
115 "Emacs 21 and XEmacs don't have this function." 118 "Emacs 21 and XEmacs don't have this function."
116 nil) 119 nil)
117 120
118 ;; Copy of function in mml.el. 121 ;; Copy of function in mml.el.
119 (mh-defun-compat mml-minibuffer-read-disposition (type &optional default) 122 (mh-defun-compat mh-mml-minibuffer-read-disposition
123 mml-minibuffer-read-disposition (type &optional default)
120 (unless default (setq default 124 (unless default (setq default
121 (if (and (string-match "\\`text/" type) 125 (if (and (string-match "\\`text/" type)
122 (not (string-match "\\`text/rtf\\'" type))) 126 (not (string-match "\\`text/rtf\\'" type)))
123 "inline" 127 "inline"
124 "attachment"))) 128 "attachment")))