Mercurial > emacs
comparison lisp/gnus/mm-decode.el @ 90375:e6bf73e43cf4
Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-49
Merge from emacs--devo--0
Patches applied:
* emacs--devo--0 (patch 164-184)
- Update from CVS
- Merge from gnus--rel--5.10
- Update from CVS: man/mh-e.texi (Folders): Various edits.
- Update from erc--emacs--0
* gnus--rel--5.10 (patch 62-70)
- Merge from emacs--devo--0
- Update from CVS
author | Miles Bader <miles@gnu.org> |
---|---|
date | Tue, 28 Mar 2006 23:08:20 +0000 |
parents | e3bacb89536a ab0b847baba4 |
children | c156f6a9e7b5 |
comparison
equal
deleted
inserted
replaced
90374:cf65b3d033bb | 90375:e6bf73e43cf4 |
---|---|
1101 (mm-handle-media-type handle)) | 1101 (mm-handle-media-type handle)) |
1102 ,@forms))) | 1102 ,@forms))) |
1103 (put 'mm-with-part 'lisp-indent-function 1) | 1103 (put 'mm-with-part 'lisp-indent-function 1) |
1104 (put 'mm-with-part 'edebug-form-spec '(body)) | 1104 (put 'mm-with-part 'edebug-form-spec '(body)) |
1105 | 1105 |
1106 (defun mm-get-part (handle) | 1106 (defun mm-get-part (handle &optional no-cache) |
1107 "Return the contents of HANDLE as a string." | 1107 "Return the contents of HANDLE as a string. |
1108 (if (equal (mm-handle-media-type handle) "message/external-body") | 1108 If NO-CACHE is non-nil, cached contents of a message/external-body part |
1109 are ignored." | |
1110 (if (and (not no-cache) | |
1111 (equal (mm-handle-media-type handle) "message/external-body")) | |
1109 (progn | 1112 (progn |
1110 (unless (mm-handle-cache handle) | 1113 (unless (mm-handle-cache handle) |
1111 (mm-extern-cache-contents handle)) | 1114 (mm-extern-cache-contents handle)) |
1112 (with-current-buffer (mm-handle-buffer (mm-handle-cache handle)) | 1115 (with-current-buffer (mm-handle-buffer (mm-handle-cache handle)) |
1113 (buffer-string))) | 1116 (buffer-string))) |
1114 (mm-with-part handle | 1117 (mm-with-part handle |
1115 (buffer-string)))) | 1118 (buffer-string)))) |
1116 | 1119 |
1117 (defun mm-insert-part (handle) | 1120 (defun mm-insert-part (handle &optional no-cache) |
1118 "Insert the contents of HANDLE in the current buffer." | 1121 "Insert the contents of HANDLE in the current buffer. |
1122 If NO-CACHE is non-nil, cached contents of a message/external-body part | |
1123 are ignored." | |
1119 (save-excursion | 1124 (save-excursion |
1120 (insert | 1125 (insert |
1121 (cond ((eq (mail-content-type-get (mm-handle-type handle) 'charset) | 1126 (cond ((eq (mail-content-type-get (mm-handle-type handle) 'charset) |
1122 'gnus-decoded) | 1127 'gnus-decoded) |
1123 (with-current-buffer (mm-handle-buffer handle) | 1128 (with-current-buffer (mm-handle-buffer handle) |
1124 (buffer-string))) | 1129 (buffer-string))) |
1125 ((mm-multibyte-p) | 1130 ((mm-multibyte-p) |
1126 (mm-string-as-multibyte (mm-get-part handle))) | 1131 (mm-string-as-multibyte (mm-get-part handle no-cache))) |
1127 (t | 1132 (t |
1128 (mm-get-part handle)))))) | 1133 (mm-get-part handle no-cache)))))) |
1129 | 1134 |
1130 (defun mm-file-name-delete-whitespace (file-name) | 1135 (defun mm-file-name-delete-whitespace (file-name) |
1131 "Remove all whitespace characters from FILE-NAME." | 1136 "Remove all whitespace characters from FILE-NAME." |
1132 (while (string-match "\\s-+" file-name) | 1137 (while (string-match "\\s-+" file-name) |
1133 (setq file-name (replace-match "" t t file-name))) | 1138 (setq file-name (replace-match "" t t file-name))) |