emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Generic export: Missing (?) 'body-section-suffix'
@ 2010-01-07 21:26 Christian Lasarczyk
  2010-01-08 15:51 ` OrgmodeGeneric " Wes Hardaker
  0 siblings, 1 reply; 4+ messages in thread
From: Christian Lasarczyk @ 2010-01-07 21:26 UTC (permalink / raw)
  To: emacs-orgmode

Dear org-developers,

I tried to write a little export filter using the generic export mechanism 
and observed an unexpected -- at least to me -- behavior with 6.33f and git-
HEAD.

Here is the (unfinished) export setting:

(org-set-generic-type
 "Contralateral Mindmap"
 '(:file-suffix  ".asy"
		 :key-binding  ?C
		 
		 ;; For now we just need headers
		 :author-export             nil
		 :tags-export               nil
		 :drawers-export            nil
		 :toc-export                nil

		 :title-format "Node map = Node(\"%s\""

		 :body-section-header-prefix  ("\n  " "\n    " "\n      "
					       "\n        " "\n          " "\n            ")
		 :body-section-header-format  ", Node(\"%s\""
		 :body-section-suffix         ")"
		 :body-header-section-numbers nil
		 :body-line-format ""
		 :body-line-wrap   75
		 ))

Here is a minimal example (input):
#+TITLE: Mymap
* aaa
** bbb
   Ignore content, ignore content, ignore content
*** ccc
** ddd
*** eee
*** fff
* ggg
* hhh
** iii
** jjj


And here is the exported output:

Node map = Node("Mymap"
  , Node("aaa"
    , Node("bbb"
      , Node("ccc"))
    , Node("ddd"
      , Node("eee")
      , Node("fff")))
  , Node("ggg")
  , Node("hhh"
    , Node("iii")
    , Node("jjj"

In my opinion the body-section-suffix [ here =")" ] is missing for all last 
section levels (hhh & jjj), so I expected an additional "))" at the end.

BTW: Is there a way to add a footer? Because I have to add an additional 
");" (not expected to be done by my generic exporter settings yet).

Best regards,

   Christian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: OrgmodeGeneric export: Missing (?) 'body-section-suffix'
  2010-01-07 21:26 Generic export: Missing (?) 'body-section-suffix' Christian Lasarczyk
@ 2010-01-08 15:51 ` Wes Hardaker
  2010-01-08 16:35   ` Carsten Dominik
  2010-01-08 18:54   ` Christian Lasarczyk
  0 siblings, 2 replies; 4+ messages in thread
From: Wes Hardaker @ 2010-01-08 15:51 UTC (permalink / raw)
  To: Christian Lasarczyk; +Cc: emacs-orgmode

>>>>> On Thu, 07 Jan 2010 22:26:04 +0100, Christian Lasarczyk <christian@lasarczyk.de> said:

CL> In my opinion the body-section-suffix [ here =")" ] is missing for
CL> all last section levels (hhh & jjj), so I expected an additional
CL> "))" at the end.

You're right that after the parsing is done it doesn't "pop back up" the
level tree for any close-out stuff.  Good catch.

Here's a patch to fix this (Carsten: can you apply it to your git tree?)

diff --git a/contrib/lisp/org-export-generic.el b/contrib/lisp/org-export-generic.el
index 90517c0..7b4a30d 100644
--- a/contrib/lisp/org-export-generic.el
+++ b/contrib/lisp/org-export-generic.el
@@ -949,6 +949,15 @@ underlined headlines.  The default is 3."
                      (org-export-generic-wrap line bodylinewrap))
              (setq line line)))
        (insert (format bodylineform line)))))
+
+    ;; if we're at a level > 0; insert the closing body level stuff
+    (let ((counter 0))
+      (while (> (- level counter) 0)
+ (insert
+  (org-export-generic-format export-plist :body-section-suffix 0
+                             (- level counter)))
+ (setq counter (1+ counter))))
+
     (org-export-generic-check-section "bottom")

     (org-export-generic-push-links (nreverse link-buffer))

-- 
Wes Hardaker                                     
My Pictures:  http://capturedonearth.com/
My Thoughts:  http://pontifications.hardakers.net/

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: Re: OrgmodeGeneric export: Missing (?) 'body-section-suffix'
  2010-01-08 15:51 ` OrgmodeGeneric " Wes Hardaker
@ 2010-01-08 16:35   ` Carsten Dominik
  2010-01-08 18:54   ` Christian Lasarczyk
  1 sibling, 0 replies; 4+ messages in thread
From: Carsten Dominik @ 2010-01-08 16:35 UTC (permalink / raw)
  To: Wes Hardaker; +Cc: Christian Lasarczyk, emacs-orgmode

Applied, thanks.

- Carsten

On Jan 8, 2010, at 4:51 PM, Wes Hardaker wrote:

>>>>>> On Thu, 07 Jan 2010 22:26:04 +0100, Christian Lasarczyk <christian@lasarczyk.de 
>>>>>> > said:
>
> CL> In my opinion the body-section-suffix [ here =")" ] is missing for
> CL> all last section levels (hhh & jjj), so I expected an additional
> CL> "))" at the end.
>
> You're right that after the parsing is done it doesn't "pop back up"  
> the
> level tree for any close-out stuff.  Good catch.
>
> Here's a patch to fix this (Carsten: can you apply it to your git  
> tree?)
>
> diff --git a/contrib/lisp/org-export-generic.el b/contrib/lisp/org- 
> export-generic.el
> index 90517c0..7b4a30d 100644
> --- a/contrib/lisp/org-export-generic.el
> +++ b/contrib/lisp/org-export-generic.el
> @@ -949,6 +949,15 @@ underlined headlines.  The default is 3."
>                      (org-export-generic-wrap line bodylinewrap))
>              (setq line line)))
>        (insert (format bodylineform line)))))
> +
> +    ;; if we're at a level > 0; insert the closing body level stuff
> +    (let ((counter 0))
> +      (while (> (- level counter) 0)
> + (insert
> +  (org-export-generic-format export-plist :body-section-suffix 0
> +                             (- level counter)))
> + (setq counter (1+ counter))))
> +
>     (org-export-generic-check-section "bottom")
>
>     (org-export-generic-push-links (nreverse link-buffer))
>
> -- 
> Wes Hardaker
> My Pictures:  http://capturedonearth.com/
> My Thoughts:  http://pontifications.hardakers.net/
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: OrgmodeGeneric export: Missing (?) 'body-section-suffix'
  2010-01-08 15:51 ` OrgmodeGeneric " Wes Hardaker
  2010-01-08 16:35   ` Carsten Dominik
@ 2010-01-08 18:54   ` Christian Lasarczyk
  1 sibling, 0 replies; 4+ messages in thread
From: Christian Lasarczyk @ 2010-01-08 18:54 UTC (permalink / raw)
  To: emacs-orgmode

Dear Wes,

thank you fixing this issue so fast. I will test it, as so as patch is in 
the repository.

Best regards,
   Christian

Wes Hardaker wrote:

> Here's a patch to fix this (Carsten: can you apply it to your git tree?)
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-01-08 18:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-07 21:26 Generic export: Missing (?) 'body-section-suffix' Christian Lasarczyk
2010-01-08 15:51 ` OrgmodeGeneric " Wes Hardaker
2010-01-08 16:35   ` Carsten Dominik
2010-01-08 18:54   ` Christian Lasarczyk

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).