From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Dunsmore Subject: Re: [PATCH] Preserve trailing blank lines Date: Mon, 10 Jan 2011 09:58:13 -0600 Message-ID: <87wrmchht6.fsf@riotblast.dunsmor.com> References: <87mxngqh1o.fsf@riotblast.dunsmor.com> <078486EA-3EAD-4E6B-B428-D0DC477DFCB3@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=42116 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PcK9V-0002T6-N3 for emacs-orgmode@gnu.org; Mon, 10 Jan 2011 10:59:27 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PcK8M-00022K-Tl for emacs-orgmode@gnu.org; Mon, 10 Jan 2011 10:58:15 -0500 Received: from deathroller.dunsmor.com ([98.129.169.48]:52284) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PcK8M-000225-OJ for emacs-orgmode@gnu.org; Mon, 10 Jan 2011 10:58:14 -0500 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: Carsten Dominik Cc: emacs-orgmode@gnu.org Carsten Dominik 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)))