gnus-msg: remove nastygram
[gnus] / lisp / message.el
index 22bf45b..8a729f6 100644 (file)
@@ -326,7 +326,7 @@ used."
   :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
@@ -3091,10 +3091,22 @@ M-RET    `message-newline-and-reformat' (break the line and reformat)."
   (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))
@@ -3103,7 +3115,7 @@ M-RET    `message-newline-and-reformat' (break the line and reformat)."
 
 (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 ()
@@ -6551,31 +6563,6 @@ is a function used to switch to and display the mail buffer."
     ;; FIXME: Should return nil if failure.
     t))
 
-;;;###autoload
-(defun message-mailto (url &rest args)
-  "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."
@@ -7501,7 +7488,11 @@ is for the internal use."
       (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