summaryrefslogtreecommitdiff
path: root/lisp/gnus
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>2012-09-17 07:41:39 -0400
committerRichard M. Stallman <rms@gnu.org>2012-09-17 07:41:39 -0400
commitcdfca592b027544972e92c7d0ae804581e925433 (patch)
treeb0e9db78ca6b9329718912151109ddc4df4a073b /lisp/gnus
parent2e8efb2f47b90edd393bde33bf048333b3bde279 (diff)
downloademacs-cdfca592b027544972e92c7d0ae804581e925433.tar.gz
message-in-body-p should not alter anything.
Diffstat (limited to 'lisp/gnus')
-rw-r--r--lisp/gnus/ChangeLog2
-rw-r--r--lisp/gnus/message.el8
2 files changed, 8 insertions, 2 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 924e8ea95d8..45f23a6d99c 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -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.
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 42911ce0648..5360f008432 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -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."