From: Richard M. Stallman Date: Mon, 17 Sep 2012 11:41:39 +0000 (-0400) Subject: message-in-body-p should not alter anything. X-Git-Tag: emacs-24.2.90~269^2~54 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=cdfca592b027544972e92c7d0ae804581e925433;p=emacs.git message-in-body-p should not alter anything. --- 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 + * 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."