- (mime/decode-message/partial-region beg end cal))
- (progn
- (set-buffer subject-buf)
- (setq part-missing (mime/gp:part-missing-p subject-id (string-to-int total)))
- (if part-missing
- (progn
- (kill-buffer buffer)
- (error "Couldn't find part %d" part-missing)))
- (save-excursion
- (while (<= part-num (string-to-int total))
- (goto-char (point-min))
- (message "Grabbing part %d of %d" part-num (string-to-int total))
- (re-search-forward
- (concat (regexp-quote subject-id) "0*"
- (int-to-string part-num)) nil t)
- (mime/gp:display-article)
- (save-excursion
- (set-buffer article-buf)
- (goto-char (point-min))
- (re-search-forward "^$")
- (let ((delimit (point)))
- (goto-char (point-min))
- (if (not
- (and
- (re-search-forward
- "^[Cc]ontent-[Tt]ype:[ \t]*message/partial;" delimit t)
- (re-search-forward
- (concat "[ \t]+id=[ \t]*\""
- (regexp-quote id) "\";") delimit)
- (re-search-forward
- (concat "[ \t]+number=[ \t]*"
- (int-to-string part-num) ";") delimit)))
- (progn
- (kill-buffer buffer)
- (error "Couldn't find part %d" part-num)))
- (append-to-buffer buffer (+ delimit 1) (point-max))))
- (setq part-num (+ part-num 1))))
- (mime/gp:display-article)
- (save-excursion
- (set-buffer article-buf)
- ;; (make-variable-buffer-local 'mime/content-list)
- ;; (setq mime/content-list (mime/parse-contents))
- (make-variable-buffer-local 'mime::article/content-info)
- (setq mime::article/content-info (mime-viewer/parse))
- )
- (delete-other-windows)
- (switch-to-buffer buffer)
- (goto-char (point-min))
- (setq major-mode 'mime/show-message-mode)
- (mime/viewer-mode mother)
- (pop-to-buffer (current-buffer))
- ))))
-
-;; Check if all the parts are there
-(defun mime/gp:part-missing-p (subject-string num-parts)
- (save-excursion
- (let ((part-num 1)
- (cant-find nil))
+ (mime-article/decode-message/partial beg end cal)
+ )
+ (let (cinfo the-id parameters)
+ (setq subject-id (rfc822/get-field-body "Subject"))
+ (if (string-match "[0-9\n]+" subject-id)
+ (setq subject-id (substring subject-id 0 (match-beginning 0)))
+ )
+ (pop-to-buffer subject-buf)
+ (while (search-backward subject-id nil t)
+ )
+ (catch 'tag
+ (while t
+ (tm-partial/preview-article target)
+ (pop-to-buffer article-buffer)
+ (switch-to-buffer mime::article/preview-buffer)
+ (setq cinfo
+ (mime::preview-content-info/content-info
+ (car mime::preview/content-list)))
+ (setq parameters (mime::content-info/parameters cinfo))
+ (setq the-id (assoc-value "id" parameters))
+ (if (equal the-id id)
+ (progn
+ (switch-to-buffer article-buffer)
+ (mime-article/decode-message/partial
+ (point-min)(point-max) parameters)
+ (if (file-exists-p full-file)
+ (throw 'tag nil)
+ )
+ ))
+ (if (not (progn
+ (pop-to-buffer subject-buf)
+ (end-of-line)
+ (search-forward subject-id nil t)
+ ))
+ (error "not found")
+ )
+ ))))))