Mercurial > emacs
comparison lisp/gnus/mm-partial.el @ 89971:cce1c0ee76ee
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-36
Merge from emacs--cvs-trunk--0, emacs--gnus--5.10, gnus--rel--5.10
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Merge from emacs--gnus--5.10, gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-524
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-534
Update from CVS
* miles@gnu.org--gnu-2004/emacs--gnus--5.10--base-0
tag of miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-464
* miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-1
Import from CVS branch gnus-5_10-branch
* miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-2
Merge from lorentey@elte.hu--2004/emacs--multi-tty--0, emacs--cvs-trunk--0
* miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-3
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-4
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-18
Update from CVS
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-19
Remove autoconf-generated files from archive
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-20
Update from CVS
author | Miles Bader <miles@gnu.org> |
---|---|
date | Thu, 09 Sep 2004 09:36:36 +0000 |
parents | 561b856c5b1f 55fd4f77387a |
children | f9a65d7ebd29 |
comparison
equal
deleted
inserted
replaced
89970:a849e5779b8c | 89971:cce1c0ee76ee |
---|---|
1 ;;; mm-partial.el --- showing message/partial | 1 ;;; mm-partial.el --- showing message/partial |
2 ;; Copyright (C) 2000 Free Software Foundation, Inc. | 2 ;; Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. |
3 | 3 |
4 ;; Author: Shenghuo Zhu <zsh@cs.rochester.edu> | 4 ;; Author: Shenghuo Zhu <zsh@cs.rochester.edu> |
5 ;; Keywords: message partial | 5 ;; Keywords: message partial |
6 | 6 |
7 ;; This file is part of GNU Emacs. | 7 ;; This file is part of GNU Emacs. |
23 | 23 |
24 ;;; Commentary: | 24 ;;; Commentary: |
25 | 25 |
26 ;;; Code: | 26 ;;; Code: |
27 | 27 |
28 (eval-when-compile | 28 (eval-when-compile (require 'cl)) |
29 (require 'cl)) | |
30 | 29 |
31 (require 'gnus-sum) | 30 (require 'gnus-sum) |
32 (require 'mm-util) | 31 (require 'mm-util) |
33 (require 'mm-decode) | 32 (require 'mm-decode) |
34 | 33 |
41 (unless (eq (aref header 0) art) | 40 (unless (eq (aref header 0) art) |
42 (mm-with-unibyte-buffer | 41 (mm-with-unibyte-buffer |
43 (gnus-request-article-this-buffer (aref header 0) | 42 (gnus-request-article-this-buffer (aref header 0) |
44 gnus-newsgroup-name) | 43 gnus-newsgroup-name) |
45 (when (search-forward id nil t) | 44 (when (search-forward id nil t) |
46 (let ((nhandles (mm-dissect-buffer)) nid) | 45 (let ((nhandles (mm-dissect-buffer |
46 nil gnus-article-loose-mime)) nid) | |
47 (if (consp (car nhandles)) | 47 (if (consp (car nhandles)) |
48 (mm-destroy-parts nhandles) | 48 (mm-destroy-parts nhandles) |
49 (setq nid (cdr (assq 'id | 49 (setq nid (cdr (assq 'id |
50 (cdr (mm-handle-type nhandles))))) | 50 (cdr (mm-handle-type nhandles))))) |
51 (if (not (equal id nid)) | 51 (if (not (equal id nid)) |
81 (bnumber (string-to-number | 81 (bnumber (string-to-number |
82 (cdr (assq 'number | 82 (cdr (assq 'number |
83 (cdr (mm-handle-type b))))))) | 83 (cdr (mm-handle-type b))))))) |
84 (< anumber bnumber))))) | 84 (< anumber bnumber))))) |
85 (setq gnus-article-mime-handles | 85 (setq gnus-article-mime-handles |
86 (append (if (listp (car gnus-article-mime-handles)) | 86 (mm-merge-handles gnus-article-mime-handles phandles)) |
87 gnus-article-mime-handles | |
88 (list gnus-article-mime-handles)) | |
89 phandles)) | |
90 (save-excursion | 87 (save-excursion |
91 (set-buffer (generate-new-buffer " *mm*")) | 88 (set-buffer (generate-new-buffer " *mm*")) |
92 (while (setq phandle (pop phandles)) | 89 (while (setq phandle (pop phandles)) |
93 (setq nn (string-to-number | 90 (setq nn (string-to-number |
94 (cdr (assq 'number | 91 (cdr (assq 'number |
115 (unless total | 112 (unless total |
116 (error "Don't known the total number of")) | 113 (error "Don't known the total number of")) |
117 (if (<= n total) | 114 (if (<= n total) |
118 (error "Missing part %d" n)) | 115 (error "Missing part %d" n)) |
119 (kill-buffer (mm-handle-buffer handle)) | 116 (kill-buffer (mm-handle-buffer handle)) |
117 (goto-char (point-min)) | |
118 (let ((point (if (search-forward "\n\n" nil t) | |
119 (1- (point)) | |
120 (point-max)))) | |
121 (goto-char (point-min)) | |
122 (unless (re-search-forward "^mime-version:" point t) | |
123 (insert "MIME-Version: 1.0\n"))) | |
120 (setcar handle (current-buffer)) | 124 (setcar handle (current-buffer)) |
121 (mm-handle-set-cache handle t))) | 125 (mm-handle-set-cache handle t))) |
122 (unless no-display | 126 (unless no-display |
123 (save-excursion | 127 (save-excursion |
124 (save-restriction | 128 (save-restriction |
129 (gnus-article-prepare-display) | 133 (gnus-article-prepare-display) |
130 (setq handles gnus-article-mime-handles)) | 134 (setq handles gnus-article-mime-handles)) |
131 (when handles | 135 (when handles |
132 ;; It is in article buffer. | 136 ;; It is in article buffer. |
133 (setq gnus-article-mime-handles | 137 (setq gnus-article-mime-handles |
134 (nconc (if (listp (car gnus-article-mime-handles)) | 138 (mm-merge-handles gnus-article-mime-handles handles))) |
135 gnus-article-mime-handles | |
136 (list gnus-article-mime-handles)) | |
137 (if (listp (car handles)) | |
138 handles (list handles))))) | |
139 (mm-handle-set-undisplayer | 139 (mm-handle-set-undisplayer |
140 handle | 140 handle |
141 `(lambda () | 141 `(lambda () |
142 (let (buffer-read-only) | 142 (let (buffer-read-only) |
143 (condition-case nil | 143 (condition-case nil |
147 (face-property 'default prop) (current-buffer))) | 147 (face-property 'default prop) (current-buffer))) |
148 '(background background-pixmap foreground)) | 148 '(background background-pixmap foreground)) |
149 (error nil)) | 149 (error nil)) |
150 (delete-region ,(point-min-marker) ,(point-max-marker)))))))))) | 150 (delete-region ,(point-min-marker) ,(point-max-marker)))))))))) |
151 | 151 |
152 (provide 'mm-partial) | |
153 | |
152 ;;; arch-tag: 460e7424-05f2-4a1d-a0f2-70ec081eff7d | 154 ;;; arch-tag: 460e7424-05f2-4a1d-a0f2-70ec081eff7d |
153 ;;; mm-partial.el ends here | 155 ;;; mm-partial.el ends here |