- (if (string-match "^[ \t]*|[ \t]*\\(.*\\)[ \t]*$" file)
- ;; Pipe the article to the program in question.
- (call-process-region (point-min) (point-max) shell-file-name
- nil nil nil shell-command-switch
- (match-string 1 file))
- ;; Save the article.
- (setq file (expand-file-name file))
- (unless (file-exists-p (file-name-directory file))
- (make-directory (file-name-directory file) t))
- (if (and message-fcc-handler-function
- (not (eq message-fcc-handler-function 'rmail-output)))
- (funcall message-fcc-handler-function file)
- ;; FIXME this option, rmail-output (also used if
- ;; message-fcc-handler-function is nil) is not
- ;; documented anywhere AFAICS. It should work in Emacs
- ;; 23; I suspect it does not work in Emacs 22.
- ;; FIXME I don't see the need for the two different cases here.
- ;; mail-use-rfc822 makes no difference (in Emacs 23),and
- ;; the third argument just controls \"Wrote file\" message.
- (if (and (file-readable-p file) (mail-file-babyl-p file))
- (rmail-output file 1 nil t)
- (let ((mail-use-rfc822 t))
- (rmail-output file 1 t t))))))