From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Different spacing in html output compared to info and pdf Date: Thu, 21 Mar 2013 20:12:57 +0100 Message-ID: <871ub8tvly.fsf@gmail.com> References: <87li9t8yea.fsf@Rainer.invalid> <87k3pc52l8.fsf@bzg.ath.cx> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:52108) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIkvE-00023Y-Fv for emacs-orgmode@gnu.org; Thu, 21 Mar 2013 15:13:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UIkvC-00025f-VA for emacs-orgmode@gnu.org; Thu, 21 Mar 2013 15:13:08 -0400 Received: from mail-wg0-f51.google.com ([74.125.82.51]:51291) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UIkvC-00025W-Nt for emacs-orgmode@gnu.org; Thu, 21 Mar 2013 15:13:06 -0400 Received: by mail-wg0-f51.google.com with SMTP id 8so2588970wgl.30 for ; Thu, 21 Mar 2013 12:13:05 -0700 (PDT) In-Reply-To: <87k3pc52l8.fsf@bzg.ath.cx> (Bastien's message of "Tue, 12 Mar 2013 11:34:11 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bastien Cc: Achim Gratz , emacs-orgmode@gnu.org, "Thomas S. Dye" --=-=-= Content-Type: text/plain Hello, Bastien writes: > the attached (dirty) patch fixes it. It's clearly not the right > approach, though. I hope Nicolas can have a look soon, as the problem > affect all uses of snippets in macros. What about the following patch? The export framework usually treats differently empty string from nil output. Only in the former blank lines/white spaces are preserved. With this patch it will not be possible anymore to make this distinction with export snippets. What do you think? I'll add some tests in test-ox.el if this patch is to be applied. Regards, -- Nicolas Goaziou --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-ox-White-spaces-after-export-snippets-are-never-igno.patch >From 9fed50f6760aa34a426981d3606285c090ffd5bd Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Thu, 21 Mar 2013 20:08:24 +0100 Subject: [PATCH] ox: White spaces after export snippets are never ignored * lisp/ox.el (org-export-data): White spaces after export snippets are never ignored. Back-end developers should pay attention to the fact that white spaces before and after an ignored export snippet now are accumulated in the output. --- lisp/ox.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/ox.el b/lisp/ox.el index a545bb9..160f73f 100644 --- a/lisp/ox.el +++ b/lisp/ox.el @@ -2062,8 +2062,12 @@ Return transcoded string." (eq (plist-get info :with-archived-trees) 'headline) (org-element-property :archivedp data))) (let ((transcoder (org-export-transcoder data info))) - (and (functionp transcoder) - (funcall transcoder data nil info)))) + (or (and (functionp transcoder) + (funcall transcoder data nil info)) + ;; Export snippets never return a nil value so + ;; that white spaces following them are never + ;; ignored. + (and (eq type 'export-snippet) "")))) ;; Element/Object with contents. (t (let ((transcoder (org-export-transcoder data info))) -- 1.8.2 --=-=-=--