emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] PATCH: prevent filling of #+ lines


From: Dan Davison
Subject: [Orgmode] PATCH: prevent filling of #+ lines
Date: Sat, 05 Sep 2009 10:44:18 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (gnu/linux)

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---




reply via email to

[Prev in Thread] Current Thread [Next in Thread]