]> code.delx.au - gnu-emacs/commitdiff
message-in-body-p should not alter anything.
authorRichard M. Stallman <rms@gnu.org>
Mon, 17 Sep 2012 11:41:39 +0000 (07:41 -0400)
committerRichard M. Stallman <rms@gnu.org>
Mon, 17 Sep 2012 11:41:39 +0000 (07:41 -0400)
lisp/gnus/ChangeLog
lisp/gnus/message.el

index 924e8ea95d860e483cc8eba1e1011122ac9ff87c..45f23a6d99c84710410b82505169c01028ab0ee5 100644 (file)
@@ -1,5 +1,7 @@
 2012-09-17  Richard Stallman  <rms@gnu.org>
 
+       * message.el (message-in-body-p): Don't set mark or modify buffer.
+
        * mml.el (mml-attach-file): Doc fix.
        (mml-attach-external, mml-attach-buffer, mml-attach-file):
        Set mail-encode-mml when in Mail mode.
index 42911ce06488fd2b86cf1baf6ec99e9e3b0f1682..5360f008432441c2184d346f60416e6cb7621e42 100644 (file)
@@ -3160,8 +3160,12 @@ 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) body)))
+  (>= (point)
+      (save-excursion
+       (goto-char (point-min))
+       (or (search-forward (concat "\n" mail-header-separator "\n") nil t)
+           (search-forward-regexp "[^:]+:\\([^\n]\\|\n[ \t]\\)+\n\n" nil t))
+       (point))))
 
 (defun message-goto-eoh ()
   "Move point to the end of the headers."