emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Bastien <bzg@altern.org>
Cc: Achim Gratz <Stromeko@nexgo.de>,
	emacs-orgmode@gnu.org, "Thomas S. Dye" <tsd@tsdye.com>
Subject: Re: Different spacing in html output compared to info and pdf
Date: Thu, 21 Mar 2013 20:12:57 +0100	[thread overview]
Message-ID: <871ub8tvly.fsf@gmail.com> (raw)
In-Reply-To: <87k3pc52l8.fsf@bzg.ath.cx> (Bastien's message of "Tue, 12 Mar 2013 11:34:11 +0100")

[-- Attachment #1: Type: text/plain, Size: 608 bytes --]

Hello,

Bastien <bzg@altern.org> 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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ox-White-spaces-after-export-snippets-are-never-igno.patch --]
[-- Type: text/x-patch, Size: 1319 bytes --]

From 9fed50f6760aa34a426981d3606285c090ffd5bd Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <n.goaziou@gmail.com>
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


  parent reply	other threads:[~2013-03-21 19:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-11 16:52 Different spacing in html output compared to info and pdf Thomas S. Dye
2013-03-11 20:38 ` Achim Gratz
2013-03-11 22:48   ` Thomas S. Dye
2013-03-12 10:34     ` Bastien
2013-03-13 18:25       ` Nicolas Goaziou
2013-03-21 19:12       ` Nicolas Goaziou [this message]
2013-03-25  5:41         ` Bastien
2013-03-25 19:30           ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871ub8tvly.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=Stromeko@nexgo.de \
    --cc=bzg@altern.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=tsd@tsdye.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).