From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Guerry Subject: [Accepted] Preserve trailing blank lines Date: Wed, 9 Mar 2011 11:07:06 +0100 (CET) Message-ID: <20110309100706.8F3836A2D@myhost.localdomain> References: <878vxhgsyy.fsf@riotblast.dunsmor.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=46582 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PxGIi-0000ur-0P for emacs-orgmode@gnu.org; Wed, 09 Mar 2011 05:07:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PxGIg-0003RP-Iq for emacs-orgmode@gnu.org; Wed, 09 Mar 2011 05:07:27 -0500 Received: from mail-wy0-f169.google.com ([74.125.82.169]:58163) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PxGIg-0003RG-Dy for emacs-orgmode@gnu.org; Wed, 09 Mar 2011 05:07:26 -0500 Received: by wyf19 with SMTP id 19so344546wyf.0 for ; Wed, 09 Mar 2011 02:07:25 -0800 (PST) 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-orgmode@gnu.org Patch 617 (http://patchwork.newartisans.com/patch/617/) is now "Accepted". Maintainer comment: none This relates to the following submission: http://mid.gmane.org/%3C878vxhgsyy.fsf%40riotblast.dunsmor.com%3E Here is the original message containing the patch: > Content-Type: text/plain; charset="utf-8" > MIME-Version: 1.0 > Content-Transfer-Encoding: 7bit > Subject: [Orgmode] Preserve trailing blank lines > Date: Tue, 15 Feb 2011 21:31:17 -0000 > From: Jason Dunsmore > X-Patchwork-Id: 617 > Message-Id: <878vxhgsyy.fsf@riotblast.dunsmor.com> > To: Bastien > Cc: emacs-orgmode@gnu.org, Carsten Dominik > > Bastien writes: > > > However, with your patch, I get a weird behavior. > > > > Config: > > > > ,---- > > | (setq org-blank-before-new-entry '((heading . nil) > > | (plain-list-item . nil))) > > `---- > > > > Test file: > > > > ,---- > > | * Section > > | > > | ** Subsection 1 > > | Body > > | > > | ** Subsection 2 > > | Body > > `---- > > > > Trying to move Subsection 1 down (with org-metadown): > > > > ,---- > > | * Section > > | Body <<<<<< ?? > > | > > | ** Subsection 2 > > | > > | ** Subsection 1 > > | Body > > `---- > > > > Are you able to reproduce this? > > I finally had a chance to test this out with the latest Org from git and > a vanilla Emacs config, and I was unable to reproduce the behavior you > saw. Here is what I did: > > > $ git clone git://orgmode.org/org-mode.git > > $ emacs23 -Q & > > (Edit org.el to re-introduce patch.) > > $ cd org-mode/ > > $ git diff > > > Then I evaluated the following in Emacs: > > > (delete "/usr/share/emacs/23.2/lisp/org/" load-path) > (add-to-list 'load-path "~/tmp/org-mode/lisp") > (require 'org-install) > (setq org-blank-before-new-entry '((heading . nil) > (plain-list-item . nil))) > > > You can see what happened on my screen with the following: > > > wget http://98.129.169.48/tmp/emacs-testing.time > wget http://98.129.169.48/tmp/emacs-testing.script > scriptreplay emacs-testing.time emacs-testing.script > > > Would you mind testing it out again? > > Regards, > Jason > > > diff --git a/lisp/org.el b/lisp/org.el > index 164081c..4329def 100644 > --- a/lisp/org.el > +++ b/lisp/org.el > @@ -18507,10 +18507,10 @@ Taken from `count' in cl-seq.el with all keyword argum > "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)) > + ;;(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))) >