- (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 (1+ (point))))
- (goto-char (point-min))
- (if (not
- (let ((params (cdr (mime/Content-Type))))
- (and (equal (assoc-value "id" params) id)
- (= (string-to-int (assoc-value "number" params))
- part-num)
- )))
- (progn
- (kill-buffer buffer)
- (error "Couldn't find part %d" part-num)))
- (if (< delimit (point-max))
- (append-to-buffer buffer delimit (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/parse-message))
- )
- (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))
-
- (while (and (<= part-num num-parts) (not cant-find))
- (goto-char (point-min))
- ;; If the parts are numbered 01/10, then chop off the leading 0
- (if (not (re-search-forward
- (concat (regexp-quote subject-id) "0*"
- (int-to-string part-num))
- nil t))
- (setq cant-find part-num)
- (progn
- (message "Found part %d of %d." part-num num-parts)
- (setq part-num (+ part-num 1)))))
- cant-find)))
-
-
-;;; @ set up
+ (mime-article/decode-message/partial beg end cal)
+ )
+ (let (cinfo the-id parameters)
+ (setq subject-id (std11-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")
+ )
+ ))))))
+
+
+;;; @ end