(message-narrow-to-headers-or-head): Ignore mail-header-separator in the body.
authorKatsumi Yamaoka <yamaoka@jpl.org>
Thu, 24 May 2007 01:00:25 +0000 (01:00 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Thu, 24 May 2007 01:00:25 +0000 (01:00 +0000)
lisp/ChangeLog
lisp/message.el

index c9a3b1f..bb83413 100644 (file)
@@ -1,3 +1,8 @@
+2007-05-24  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+       * message.el (message-narrow-to-headers-or-head): Ignore
+       mail-header-separator in the body.
+
 2007-05-23  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * mm-decode.el (mm-image-fit-p): Return t if image size is just the
index ffcd10b..0511478 100644 (file)
@@ -2371,14 +2371,16 @@ Point is left at the beginning of the narrowed-to region."
   (widen)
   (narrow-to-region
    (goto-char (point-min))
-   (cond
-    ((re-search-forward
-      (concat "^" (regexp-quote mail-header-separator) "\n") nil t)
-     (match-beginning 0))
-    ((search-forward "\n\n" nil t)
-     (1- (point)))
-    (t
-     (point-max))))
+   (let ((end (if (search-forward "\n\n" nil t)
+                 (prog1
+                     (1- (point))
+                   (goto-char (point-min)))
+               (point-max))))
+     (if (re-search-forward
+         (concat "^" (regexp-quote mail-header-separator) "\n")
+         end t)
+        (match-beginning 0)
+       end)))
   (goto-char (point-min)))
 
 (defun message-news-p ()