all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dan Davison <davison@stats.ox.ac.uk>
To: emacs org-mode mailing list <emacs-orgmode@gnu.org>
Subject: PATCH: prevent filling of #+ lines
Date: Sat, 05 Sep 2009 10:44:18 -0400	[thread overview]
Message-ID: <87d465cuyl.fsf@stats.ox.ac.uk> (raw)

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	other threads:[~2009-09-05 14:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d465cuyl.fsf@stats.ox.ac.uk \
    --to=davison@stats.ox.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.