emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Orgmode] [PATCH] Preserve trailing blank lines


From: Jason Dunsmore
Subject: Re: [Orgmode] [PATCH] Preserve trailing blank lines
Date: Mon, 10 Jan 2011 09:58:13 -0600

Carsten Dominik <address@hidden> writes:

> On Jan 5, 2011, at 2:24 AM, Jason Dunsmore wrote:
>
>> I like to leave a blank line at the end of items that have bodies,
>> but I
>> found functions like org-metaup, org-metadown, and org-refile were
>> leaving that blank line behind.
>
> These commands treat empty lines as belonging to the entry
> below the empty line - which is, I think, the right convention here.

I now understand this is a formatting convention issue.  Here is an
updated patch that looks at the setting for `heading' in the variable
org-blank-before-new-entry:

diff --git a/lisp/org.el b/lisp/org.el
index 98c85d0..ee3f873 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -18477,7 +18477,9 @@ Taken from `count' in cl-seq.el with all keyword
argumen
   "Move backwards over whitespace, to the beginning of the first empty
   line.
 Returns the number of empty lines passed."
   (let ((pos (point)))
-    (skip-chars-backward " \t\n\r")
+    (if (cdr (assoc 'heading org-blank-before-new-entry))
+       (skip-chars-backward " \t\n\r")
+      (forward-line -1))
     (beginning-of-line 2)
     (goto-char (min (point) pos))
     (count-lines (point) pos)))



reply via email to

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