From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: [PATCH] Remove some blank leading blank lines from ASCII export. Date: Sun, 9 Aug 2009 14:34:48 +0200 Message-ID: References: <1f38ae890908090420q6db51cdfubedcba3020ba7a71@mail.gmail.com> Mime-Version: 1.0 (Apple Message framework v935.3) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ma7c4-0000tR-Fv for emacs-orgmode@gnu.org; Sun, 09 Aug 2009 08:35:00 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ma7bz-0000fs-DX for emacs-orgmode@gnu.org; Sun, 09 Aug 2009 08:34:59 -0400 Received: from [199.232.76.173] (port=35481 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ma7bz-0000ff-A4 for emacs-orgmode@gnu.org; Sun, 09 Aug 2009 08:34:55 -0400 Received: from paard.ic.uva.nl ([145.18.40.182]:52504) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Ma7by-0006O1-QI for emacs-orgmode@gnu.org; Sun, 09 Aug 2009 08:34:55 -0400 In-Reply-To: <1f38ae890908090420q6db51cdfubedcba3020ba7a71@mail.gmail.com> 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: Andrew Stribblehill Cc: emacs-orgmode Applied, thanks. - Carsten On Aug 9, 2009, at 1:20 PM, Andrew Stribblehill wrote: > With the following org file: > ------ > Foo > > In which foos are described. > #+OPTIONS: num:nil author:nil creator:nil timestamp:nil d:nil > toc:nil skip:t > #+TITLE: > * The construction of a foo > ** Armaments > ------ > I found exporting to ASCII gave five leading blank lines. The > following patch reduces that to one. (I'd love some help in tracking > down that final one.) > > --- > lisp/ChangeLog | 5 +++++ > lisp/org-ascii.el | 11 +++++++---- > 2 files changed, 12 insertions(+), 4 deletions(-) > > diff --git a/lisp/ChangeLog b/lisp/ChangeLog > index dd00a9a..2c477d7 100755 > --- a/lisp/ChangeLog > +++ b/lisp/ChangeLog > @@ -1,3 +1,8 @@ > +2009-08-09 Andrew Stribblehill > + > + * org-ascii.el (org-export-as-ascii): Remove some leading blank > + lines from output when skipping preamble. > + > 2009-08-08 Bastien Guerry > > * org.el (org-iswitchb): Fix bug when aborting the `org-iswitchb' > diff --git a/lisp/org-ascii.el b/lisp/org-ascii.el > index ede4ccc..846be8a 100644 > --- a/lisp/org-ascii.el > +++ b/lisp/org-ascii.el > @@ -266,11 +266,13 @@ publishing directory." > > ;; File header > (unless body-only > - (if title (org-insert-centered title ?=)) > - (insert "\n") > + (when (and title (not (string= "" title))) > + (org-insert-centered title ?=) > + (insert "\n")) > + > (if (and (or author email) > org-export-author-info) > - (insert (concat (nth 1 lang-words) ": " (or author "") > + (insert(concat (nth 1 lang-words) ": " (or author "") > (if email (concat " <" email ">") "") > "\n"))) > > @@ -283,7 +285,8 @@ publishing directory." > (if (and date org-export-time-stamp-file) > (insert (concat (nth 2 lang-words) ": " date"\n"))) > > - (insert "\n\n")) > + (unless (= (point) (point-min)) > + (insert "\n\n"))) > > (if (and org-export-with-toc (not body-only)) > (progn > -- > 1.6.3.GIT > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode