This patch prevents fill-paragraph from acting on lines that start with #+ (optionally preceded by spaces or tabs).
For example, at the moment if you have #+HTML: some html here Long line of normal text here and it goes on and on and on and on and on and on and on And then issue fill-paragraph (M-q) on the "Long line of normal text..." line, I end up with #+HTML: some html here Long line of normal text here and it goes on and on and on and on and on and on and on With this patch I get #+HTML: some html here Long line of normal text here and it goes on and on and on and on and on and on and on Same problem for paragraphs below source code blocks, etc. Dan --8<---------------cut here---------------start------------->8--- diff --git a/lisp/org.el b/lisp/org.el index 87b044b..e943fa5 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -16312,7 +16312,7 @@ which make use of the date at the cursor." ;; text in a line directly attached to a headline would otherwise ;; fill the headline as well. (org-set-local 'comment-start-skip "^#+[ \t]*") - (org-set-local 'paragraph-separate "\f\\|\\*+ \\|[ ]*$\\|[ \t]*[:|]") + (org-set-local 'paragraph-separate "\f\\|\\*+ \\|[ ]*$\\|[ \t]*[:|]\\|[ \t]*#\\+") ;; The paragraph starter includes hand-formatted lists. (org-set-local 'paragraph-start @@ -16320,6 +16320,7 @@ which make use of the date at the cursor." "\f" "\\|" "[ ]*$" "\\|" "\\*+ " "\\|" + "[ \t]*#\\+" "\\|" "[ \t]*\\([-+*][ \t]+\\|[0-9]+[.)][ \t]+\\)" "\\|" "[ \t]*[:|]" "\\|" "\\$\\$" "\\|" --8<---------------cut here---------------end--------------->8--- _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode