From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: PATCH: prevent filling of #+ lines Date: Sat, 05 Sep 2009 10:44:18 -0400 Message-ID: <87d465cuyl.fsf@stats.ox.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MjwVA-0002xs-EZ for emacs-orgmode@gnu.org; Sat, 05 Sep 2009 10:44:28 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MjwV6-0002x9-1t for emacs-orgmode@gnu.org; Sat, 05 Sep 2009 10:44:27 -0400 Received: from [199.232.76.173] (port=43807 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MjwV5-0002x0-RK for emacs-orgmode@gnu.org; Sat, 05 Sep 2009 10:44:23 -0400 Received: from markov.stats.ox.ac.uk ([163.1.210.1]:47919) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MjwV5-00085e-BZ for emacs-orgmode@gnu.org; Sat, 05 Sep 2009 10:44:23 -0400 Received: from blackcap.stats.ox.ac.uk (blackcap.stats [163.1.210.5]) by markov.stats.ox.ac.uk (8.13.6/8.13.6) with ESMTP id n85EiKk4021955 for ; Sat, 5 Sep 2009 15:44:20 +0100 (BST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs org-mode mailing list 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---