Function: mm-inline-partial
mm-inline-partial is an autoloaded and byte-compiled function defined
in mm-partial.el.gz.
Signature
(mm-inline-partial HANDLE &optional NO-DISPLAY)
Documentation
Show the partial part of HANDLE.
This function replaces the buffer of HANDLE with a buffer contains the entire message. If NO-DISPLAY is nil, display it. Otherwise, do nothing after replacing.
Source Code
;; Defined in /usr/src/emacs/lisp/gnus/mm-partial.el.gz
;;;###autoload
(defun mm-inline-partial (handle &optional no-display)
"Show the partial part of HANDLE.
This function replaces the buffer of HANDLE with a buffer contains
the entire message.
If NO-DISPLAY is nil, display it. Otherwise, do nothing after replacing."
(let ((id (cdr (assq 'id (cdr (mm-handle-type handle)))))
phandles
(b (point)) (n 1) total
phandle nn ntotal
gnus-displaying-mime handles) ;; buffer
(unless (mm-handle-cache handle)
(unless id
(error "Can not find message/partial id"))
(setq phandles
(sort (cons handle
(mm-partial-find-parts
id
(with-current-buffer gnus-summary-buffer
(gnus-summary-article-number))))
(lambda (a b)
(let ((anumber (string-to-number
(cdr (assq 'number
(cdr (mm-handle-type a))))))
(bnumber (string-to-number
(cdr (assq 'number
(cdr (mm-handle-type b)))))))
(< anumber bnumber)))))
(setq gnus-article-mime-handles
(mm-merge-handles gnus-article-mime-handles phandles))
(with-current-buffer (generate-new-buffer " *mm*")
(while (setq phandle (pop phandles))
(setq nn (string-to-number
(cdr (assq 'number
(cdr (mm-handle-type phandle))))))
(setq ntotal (string-to-number
(cdr (assq 'total
(cdr (mm-handle-type phandle))))))
(if ntotal
(if total
(unless (eq total ntotal)
(error "The numbers of total are different"))
(setq total ntotal)))
(unless (< nn n)
(unless (eq nn n)
(error "Missing part %d" n))
(mm-insert-part phandle)
(goto-char (point-max))
(when (not (eq 0 (skip-chars-backward "\r\n")))
;; remove tail blank spaces except one
(if (looking-at "\r?\n")
(goto-char (match-end 0)))
(delete-region (point) (point-max)))
(setq n (+ n 1))))
(unless total
(error "Don't known the total number of"))
(if (<= n total)
(error "Missing part %d" n))
(kill-buffer (mm-handle-buffer handle))
(goto-char (point-min))
(let ((point (if (search-forward "\n\n" nil t)
(1- (point))
(point-max))))
(goto-char (point-min))
(unless (re-search-forward "^mime-version:" point t)
(insert "MIME-Version: 1.0\n")))
(setcar handle (current-buffer))
(mm-handle-set-cache handle t)))
(unless no-display
(save-excursion
(save-restriction
(narrow-to-region b b)
(mm-insert-part handle)
(let (gnus-article-mime-handles)
(run-hooks 'gnus-article-decode-hook)
(gnus-article-prepare-display)
(setq handles gnus-article-mime-handles))
(when handles
;; It is in article buffer.
(setq gnus-article-mime-handles
(mm-merge-handles gnus-article-mime-handles handles)))
(mm-handle-set-undisplayer
handle
(let ((beg (point-min-marker))
(end (point-max-marker)))
(lambda ()
(let ((inhibit-read-only t))
(delete-region beg end))))))))))