/[emacs]/emacs/lisp/gnus/mm-partial.el
ViewVC logotype

Diff of /emacs/lisp/gnus/mm-partial.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by pj, Sun Jul 15 17:42:53 2001 UTC revision 1.3.8.1 by miles, Fri Apr 4 06:20:21 2003 UTC
# Line 25  Line 25 
25    
26  ;;; Code:  ;;; Code:
27    
28  (eval-when-compile  (eval-when-compile
29    (require 'cl))    (require 'cl))
30    
31  (require 'gnus-sum)  (require 'gnus-sum)
# Line 40  Line 40 
40      (while (setq header (pop headers))      (while (setq header (pop headers))
41        (unless (eq (aref header 0) art)        (unless (eq (aref header 0) art)
42          (mm-with-unibyte-buffer          (mm-with-unibyte-buffer
43            (gnus-request-article-this-buffer (aref header 0)            (gnus-request-article-this-buffer (aref header 0)
44                                              gnus-newsgroup-name)                                              gnus-newsgroup-name)
45            (when (search-forward id nil t)            (when (search-forward id nil t)
46              (let ((nhandles (mm-dissect-buffer)) nid)              (let ((nhandles (mm-dissect-buffer)) nid)
47                (if (consp (car nhandles))                (if (consp (car nhandles))
48                    (mm-destroy-parts nhandles)                    (mm-destroy-parts nhandles)
49                  (setq nid (cdr (assq 'id                  (setq nid (cdr (assq 'id
50                                       (cdr (mm-handle-type nhandles)))))                                       (cdr (mm-handle-type nhandles)))))
51                  (if (not (equal id nid))                  (if (not (equal id nid))
52                      (mm-destroy-parts nhandles)                      (mm-destroy-parts nhandles)
# Line 56  Line 56 
56  ;;;###autoload  ;;;###autoload
57  (defun mm-inline-partial (handle &optional no-display)  (defun mm-inline-partial (handle &optional no-display)
58    "Show the partial part of HANDLE.    "Show the partial part of HANDLE.
59  This function replaces the buffer of HANDLE with a buffer contains  This function replaces the buffer of HANDLE with a buffer contains
60  the entire message.  the entire message.
61  If NO-DISPLAY is nil, display it. Otherwise, do nothing after replacing."  If NO-DISPLAY is nil, display it. Otherwise, do nothing after replacing."
62    (let ((id (cdr (assq 'id (cdr (mm-handle-type handle)))))    (let ((id (cdr (assq 'id (cdr (mm-handle-type handle)))))
63          phandles          phandles
64          (b (point)) (n 1) total          (b (point)) (n 1) total
65          phandle nn ntotal          phandle nn ntotal
# Line 68  If NO-DISPLAY is nil, display it. Otherw Line 68  If NO-DISPLAY is nil, display it. Otherw
68        (unless id        (unless id
69          (error "Can not find message/partial id"))          (error "Can not find message/partial id"))
70        (setq phandles        (setq phandles
71              (sort (cons handle              (sort (cons handle
72                          (mm-partial-find-parts                          (mm-partial-find-parts
73                           id                           id
74                           (save-excursion                           (save-excursion
75                             (set-buffer gnus-summary-buffer)                             (set-buffer gnus-summary-buffer)
76                             (gnus-summary-article-number))))                             (gnus-summary-article-number))))
77                    #'(lambda (a b)                    #'(lambda (a b)
78                        (let ((anumber (string-to-number                        (let ((anumber (string-to-number
79                                        (cdr (assq 'number                                        (cdr (assq 'number
80                                                   (cdr (mm-handle-type a))))))                                                   (cdr (mm-handle-type a))))))
81                              (bnumber (string-to-number                              (bnumber (string-to-number
82                                        (cdr (assq 'number                                        (cdr (assq 'number
83                                                   (cdr (mm-handle-type b)))))))                                                   (cdr (mm-handle-type b)))))))
84                          (< anumber bnumber)))))                          (< anumber bnumber)))))
85        (setq gnus-article-mime-handles        (setq gnus-article-mime-handles
# Line 90  If NO-DISPLAY is nil, display it. Otherw Line 90  If NO-DISPLAY is nil, display it. Otherw
90        (save-excursion        (save-excursion
91          (set-buffer (generate-new-buffer " *mm*"))          (set-buffer (generate-new-buffer " *mm*"))
92          (while (setq phandle (pop phandles))          (while (setq phandle (pop phandles))
93            (setq nn (string-to-number            (setq nn (string-to-number
94                      (cdr (assq 'number                      (cdr (assq 'number
95                                 (cdr (mm-handle-type phandle))))))                                 (cdr (mm-handle-type phandle))))))
96            (setq ntotal (string-to-number            (setq ntotal (string-to-number
97                          (cdr (assq 'total                          (cdr (assq 'total
98                                     (cdr (mm-handle-type phandle))))))                                     (cdr (mm-handle-type phandle))))))
99            (if ntotal            (if ntotal
100                (if total                (if total
101                    (unless (eq total ntotal)                    (unless (eq total ntotal)
102                    (error "The numbers of total are different"))                    (error "The numbers of total are different"))
103                  (setq total ntotal)))                  (setq total ntotal)))
104            (unless (< nn n)            (unless (< nn n)
# Line 134  If NO-DISPLAY is nil, display it. Otherw Line 134  If NO-DISPLAY is nil, display it. Otherw
134                    (nconc (if (listp (car gnus-article-mime-handles))                    (nconc (if (listp (car gnus-article-mime-handles))
135                             gnus-article-mime-handles                             gnus-article-mime-handles
136                             (list gnus-article-mime-handles))                             (list gnus-article-mime-handles))
137                           (if (listp (car handles))                           (if (listp (car handles))
138                               handles (list handles)))))                               handles (list handles)))))
139            (mm-handle-set-undisplayer            (mm-handle-set-undisplayer
140             handle             handle

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.3.8.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26