:group 'message-various)
(defcustom message-subject-trailing-was-ask-regexp
- "[ \t]*\\([[(]+[Ww][Aa][Ss][ \t]*.*[\])]+\\)"
+ "[ \t]*\\([[(]+[Ww][Aa][Ss]:?[ \t]*.*[])]+\\)"
"*Regexp matching \"(was: <old subject>)\" in the subject line.
The function `message-strip-subject-trailing-was' uses this regexp if
(interactive)
(message-position-on-field "Summary" "Subject"))
-(defun message-goto-body (&optional interactivep)
+(eval-when-compile
+ (defmacro message-called-interactively-p (kind)
+ (condition-case nil
+ (progn
+ (eval '(called-interactively-p 'any))
+ ;; Emacs >=23.2
+ `(called-interactively-p ,kind))
+ ;; Emacs <23.2
+ (wrong-number-of-arguments '(called-interactively-p))
+ ;; XEmacs
+ (void-function '(interactive-p)))))
+
+(defun message-goto-body ()
"Move point to the beginning of the message body."
- (interactive (list t))
- (when (and interactivep
+ (interactive)
+ (when (and (message-called-interactively-p 'any)
(looking-at "[ \t]*\n"))
(expand-abbrev))
(goto-char (point-min))
(defun message-in-body-p ()
"Return t if point is in the message body."
- (let ((body (save-excursion (message-goto-body) (point))))
+ (let ((body (save-excursion (message-goto-body))))
(>= (point) body)))
(defun message-goto-eoh ()
;; FIXME: Should return nil if failure.
t))
-;;;###autoload
-(defun message-mailto (url)
- "Send a mail message to URL.
-The URL should be on the form \"mailto:<address>?params\"."
- (when (string-match "\\`mailto:" url)
- (setq url (substring url (match-end 0)))
- (let (to args)
- (if (string-match "\\?" url)
- (setq to (substring url 0 (match-beginning 0))
- args (substring url (match-end 0)))
- (setq to url))
- (if (not args)
- (message-mail to)
- (let ((pairs
- (mapcar (lambda (elem)
- (let ((key-val (split-string elem "=")))
- (list (capitalize (car key-val))
- (cadr key-val))))
- (split-string args "&")))
- subject)
- (when (setq subject (assoc "Subject" pairs))
- (setq pairs (delq subject pairs)
- subject (cadr subject)))
- (message-mail to subject pairs))))))
-
;;;###autoload
(defun message-news (&optional newsgroups subject)
"Start editing a news article to be sent."
(when (looking-at "From ")
(replace-match "X-From-Line: "))
;; Send it.
- (let ((message-inhibit-body-encoding t)
+ (let ((message-inhibit-body-encoding
+ ;; Don't do any further encoding if it looks like the
+ ;; message has already been encoded.
+ (let ((case-fold-search t))
+ (re-search-forward "^mime-version:" nil t)))
(message-inhibit-ecomplete t)
message-required-mail-headers
message-generate-hashcash