- (progn
- ;;(delete-other-windows)
- (set-window-configuration win-conf)
- (select-window (or (get-buffer-window mother)
- (get-buffer-window
- (save-excursion
- (set-buffer mother)
- mime::preview/article-buffer))
- (get-largest-window)
+ (re-search-forward "^$")
+ (goto-char (1+ (match-end 0)))
+ (setq file (concat root-dir "/" number))
+ (mime-article::write-region (point) (point-max) file)
+ (let ((total-file (concat root-dir "/CT")))
+ (setq total
+ (if total
+ (progn
+ (or (file-exists-p total-file)
+ (save-excursion
+ (set-buffer
+ (get-buffer-create mime/temp-buffer-name))
+ (erase-buffer)
+ (insert total)
+ (write-file total-file)
+ (kill-buffer (current-buffer))
+ ))
+ (string-to-number total)
+ )
+ (and (file-exists-p total-file)
+ (save-excursion
+ (set-buffer (find-file-noselect total-file))
+ (prog1
+ (and (re-search-forward "[0-9]+" nil t)
+ (string-to-number
+ (buffer-substring (match-beginning 0)
+ (match-end 0)))
+ )
+ (kill-buffer (current-buffer))
+ )))
+ )))
+ (if (and total (> total 0))
+ (catch 'tag
+ (save-excursion
+ (set-buffer (get-buffer-create mime/temp-buffer-name))
+ (let ((full-buf (current-buffer)))
+ (erase-buffer)
+ (let ((i 1))
+ (while (<= i total)
+ (setq file (concat root-dir "/" (int-to-string i)))
+ (or (file-exists-p file)
+ (throw 'tag nil)
+ )
+ (as-binary-input-file (insert-file-contents file))
+ (goto-char (point-max))
+ (setq i (1+ i))
+ ))
+ (as-binary-output-file (write-file (concat root-dir "/FULL")))
+ (let ((i 1))
+ (while (<= i total)
+ (let ((file (format "%s/%d" root-dir i)))
+ (and (file-exists-p file)
+ (delete-file file)