org.el (org-fill-context-prefix): Fix auto-filling in `message-mode'.

* org.el (org-fill-context-prefix): Fix auto-filling in
`message-mode'.
This commit is contained in:
Bastien Guerry 2012-08-13 09:56:39 +02:00
parent 3496df0b4d
commit bbc1dde930
1 changed files with 41 additions and 39 deletions

View File

@ -20924,6 +20924,8 @@ hierarchy of headlines by UP levels before marking the subtree."
"Compute a fill prefix for the line at point P. "Compute a fill prefix for the line at point P.
Return fill prefix, as a string, or nil if current line isn't Return fill prefix, as a string, or nil if current line isn't
meant to be filled." meant to be filled."
(unless (and (derived-mode-p 'message-mode) (not (message-in-body-p)))
;; FIXME: This is really the job of orgstruct++-mode
(save-excursion (save-excursion
(goto-char p) (goto-char p)
(beginning-of-line) (beginning-of-line)
@ -20962,7 +20964,7 @@ meant to be filled."
(skip-chars-backward " \r\t\n") (skip-chars-backward " \r\t\n")
(line-beginning-position)))) (line-beginning-position))))
(when (and (>= p cbeg) (< p cend)) (when (and (>= p cbeg) (< p cend))
(if (looking-at "\\s-+") (match-string 0) ""))))))))) (if (looking-at "\\s-+") (match-string 0) ""))))))))))
(declare-function message-in-body-p "message" ()) (declare-function message-in-body-p "message" ())
(defvar org-element-paragraph-separate) ; From org-element.el (defvar org-element-paragraph-separate) ; From org-element.el