+(defun post-prompt-for-attachment ()
+ "Prompt for an attachment."
+ (if (y-or-n-p "Do you want to attach anything? ")
+ (post-attach-file)))
+
+(defun post-references-p ()
+ "Is there a References header in this buffer?"
+ (save-excursion
+ (goto-char (point-min))
+ (looking-at "^References: ")))
+
+(defun post-body-says-attach-p ()
+ "Check if attach appears in the body."
+ (post-goto-body)
+
+ ;; Aargh it's annoying that how-many returns a string,
+ ;; "13 occurences" instead of a number, 13.
+ ;; As of Emacs 22 how-many returns an integer number. Consideration
+ ;; must be taken for both newer and older versions.
+ (let ((total-attach (how-many post-attachment-regexp)))
+ (if (string= (type-of total-attach) 'string)
+ (setq total-attach (string-to-number (how-many post-attachment-regexp))))
+ ;; And this mess is just to catch the unlikely false alarm of
+ ;; "attach" being in the signature, but not in the body.
+ (if (> total-attach 0)
+ (progn (post-goto-signature)
+ (if (string= (type-of (how-many post-attachment-regexp)) 'string)
+ (> total-attach (string-to-number (how-many
+ post-attachment-regexp)))
+ (> total-attach (how-many
+ post-attachment-regexp)))))))
+