>From c51cdb35453ae8c2964508fc1e98b89e6c709abb Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen Date: Tue, 10 Mar 2015 11:03:23 +0800 Subject: [PATCH] Narrow to message body when filling in message mode * lisp/org.el (org-adaptive-fill-function): Only take the message body into account when calculating the fill prefix. --- lisp/org.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lisp/org.el b/lisp/org.el index c566152..cf952ad 100755 --- a/lisp/org.el +++ b/lisp/org.el @@ -23015,6 +23015,12 @@ matches in paragraphs or comments, use it." ((looking-at org-outline-regexp) (throw 'exit (make-string (length (match-string 0)) ?\s)))))) (org-with-wide-buffer + (when (derived-mode-p 'message-mode) + (save-excursion + (goto-char (point-min)) + (when (re-search-forward mail-header-separator) + (narrow-to-region + (line-beginning-position 2) (point-max))))) (unless (org-at-heading-p) (let* ((p (line-beginning-position)) (element (save-excursion -- 2.3.2