emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG][Babel] Exporting text before heading
@ 2010-07-16 14:12 Nicolas Goaziou
  2010-07-16 20:02 ` Eric Schulte
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2010-07-16 14:12 UTC (permalink / raw)
  To: Org Mode List

Hello,

I can't export the following file, would it be to latex or html.

-----
#+TITLE: Title

  - First element

    #+BEGIN_SRC org
    ,- one
    ,- two
    #+END_SRC

    1. sub-item

       #+BEGIN_EXAMPLE
       Line 1
       Line 2
       #+END_EXAMPLE

    2. another sub-item

  - Another element
-----

If I remove one of the blocks, I can export again to latex or html.
Same thing if I add an heading between the title and the first
element.

If I only add plain text before the first element, or an heading after
the list, it won't work.

I tried to bisect but it appears this org file had never been exported
successfully to html and stopped getting exported successfully to
latex since the following commit:

-----
commit d4781b9d88a6e85c0792e6e24de49834b19b4e57
Author: Carsten Dominik <carsten.dominik@gmail.com>
Date:   Fri Jul 9 10:06:17 2010 +0200

Keep BABEL meta lines in tact

* lisp/org-latex.el (org-export-latex-first-lines): Do not mark
  meta lines for removal. Do not remove BABEL config lines during export
-----

Because of this, I tend to think it is babel related, even though
removing only the example block also solves the problem.

Config is minimal, so all variables should be at default value, and
the last lines in *Message* buffer are :

-----
Exporting...
org-babel-exp processing...
setf: Wrong type argument: consp, nil
-----

Regards,

-- Nicolas

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

* Re: [BUG][Babel] Exporting text before heading
  2010-07-16 14:12 [BUG][Babel] Exporting text before heading Nicolas Goaziou
@ 2010-07-16 20:02 ` Eric Schulte
  2010-07-16 20:44   ` Nicolas Goaziou
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Schulte @ 2010-07-16 20:02 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org Mode List

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

Hi Nicolas,

I was able to export your example to html without any problems, however
I did receive the same error you mentioned when exporting to LaTeX.

The attached patch fixes the LaTeX export on my system, please give it a
try and let me know if it works for you.  I'm going to look into this a
little bit more, as it seems that for LaTeX export the "#+begin_src org"
block is being processed /twice/ by org-exp (probably due to the LaTeX
exports mechanism for first exporting the header of a file and then
exporting the body), which is not desirable and could be the root issue
which this patch may just paper over.

Cheers -- Eric


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: require-info-for-org-exp-block.patch --]
[-- Type: text/x-diff, Size: 1066 bytes --]

diff --git a/lisp/ob-exp.el b/lisp/ob-exp.el
index b500e55..565c75f 100644
--- a/lisp/ob-exp.el
+++ b/lisp/ob-exp.el
@@ -97,13 +97,15 @@ none ----- do not display either code or results upon export"
     (goto-char (match-beginning 0))
     (let* ((info (org-babel-get-src-block-info))
 	   (params (nth 2 info)))
-      ;; expand noweb references in the original file
-      (setf (nth 1 info)
-	    (if (and (cdr (assoc :noweb params))
-		     (string= "yes" (cdr (assoc :noweb params))))
-		(org-babel-expand-noweb-references
-		 info (get-file-buffer org-current-export-file))
-	      (nth 1 info)))
+      ;; bail if we couldn't get any info from the block
+      (when info
+	;; expand noweb references in the original file
+	(setf (nth 1 info)
+	      (if (and (cdr (assoc :noweb params))
+		       (string= "yes" (cdr (assoc :noweb params))))
+		  (org-babel-expand-noweb-references
+		   info (get-file-buffer org-current-export-file))
+		(nth 1 info))))
       (org-babel-exp-do-export info 'block))))
 
 (defun org-babel-exp-inline-src-blocks (start end)

[-- Attachment #3: Type: text/plain, Size: 1759 bytes --]


Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
> I can't export the following file, would it be to latex or html.
>
> -----
> #+TITLE: Title
>
>   - First element
>
>     #+BEGIN_SRC org
>     ,- one
>     ,- two
>     #+END_SRC
>
>     1. sub-item
>
>        #+BEGIN_EXAMPLE
>        Line 1
>        Line 2
>        #+END_EXAMPLE
>
>     2. another sub-item
>
>   - Another element
> -----
>
> If I remove one of the blocks, I can export again to latex or html.
> Same thing if I add an heading between the title and the first
> element.
>
> If I only add plain text before the first element, or an heading after
> the list, it won't work.
>
> I tried to bisect but it appears this org file had never been exported
> successfully to html and stopped getting exported successfully to
> latex since the following commit:
>
> -----
> commit d4781b9d88a6e85c0792e6e24de49834b19b4e57
> Author: Carsten Dominik <carsten.dominik@gmail.com>
> Date:   Fri Jul 9 10:06:17 2010 +0200
>
> Keep BABEL meta lines in tact
>
> * lisp/org-latex.el (org-export-latex-first-lines): Do not mark
>   meta lines for removal. Do not remove BABEL config lines during export
> -----
>
> Because of this, I tend to think it is babel related, even though
> removing only the example block also solves the problem.
>
> Config is minimal, so all variables should be at default value, and
> the last lines in *Message* buffer are :
>
> -----
> Exporting...
> org-babel-exp processing...
> setf: Wrong type argument: consp, nil
> -----
>
> Regards,
>
> -- Nicolas
>
> _______________________________________________
> 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

[-- Attachment #4: Type: text/plain, Size: 201 bytes --]

_______________________________________________
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

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

* Re: [BUG][Babel] Exporting text before heading
  2010-07-16 20:02 ` Eric Schulte
@ 2010-07-16 20:44   ` Nicolas Goaziou
  2010-07-16 22:32     ` Eric Schulte
  0 siblings, 1 reply; 6+ messages in thread
From: Nicolas Goaziou @ 2010-07-16 20:44 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Org Mode List

Hello,

>>>>> Eric Schulte writes:

> Hi Nicolas,

> I was able to export your example to html without any problems, however
> I did receive the same error you mentioned when exporting to LaTeX.

HTML problem was indeed from my side.

> The attached patch fixes the LaTeX export on my system, please give it a
> try and let me know if it works for you.  I'm going to look into this a
> little bit more, as it seems that for LaTeX export the "#+begin_src org"
> block is being processed /twice/ by org-exp (probably due to the LaTeX
> exports mechanism for first exporting the header of a file and then
> exporting the body), which is not desirable and could be the root issue
> which this patch may just paper over.

It works again with your patch.

Thanks.

-- Nicolas

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

* Re: [BUG][Babel] Exporting text before heading
  2010-07-16 20:44   ` Nicolas Goaziou
@ 2010-07-16 22:32     ` Eric Schulte
  2010-07-18  6:14       ` Carsten Dominik
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Schulte @ 2010-07-16 22:32 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org Mode List

Hi Nicolas,

I'll apply this patch now.  Thanks for catching this -- Eric

Nicolas Goaziou <n.goaziou@gmail.com> writes:

> Hello,
>
>>>>>> Eric Schulte writes:
>
>> Hi Nicolas,
>
>> I was able to export your example to html without any problems, however
>> I did receive the same error you mentioned when exporting to LaTeX.
>
> HTML problem was indeed from my side.
>
>> The attached patch fixes the LaTeX export on my system, please give it a
>> try and let me know if it works for you.  I'm going to look into this a
>> little bit more, as it seems that for LaTeX export the "#+begin_src org"
>> block is being processed /twice/ by org-exp (probably due to the LaTeX
>> exports mechanism for first exporting the header of a file and then
>> exporting the body), which is not desirable and could be the root issue
>> which this patch may just paper over.
>
> It works again with your patch.
>
> Thanks.
>
> -- Nicolas

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

* Re: [BUG][Babel] Exporting text before heading
  2010-07-16 22:32     ` Eric Schulte
@ 2010-07-18  6:14       ` Carsten Dominik
  2010-07-18 17:06         ` Eric Schulte
  0 siblings, 1 reply; 6+ messages in thread
From: Carsten Dominik @ 2010-07-18  6:14 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Org Mode List, Nicolas Goaziou

Hi Eric,

have you applied this patch?  If yes, please mark it so on the  
patchwork server.

Thanks!

- Carsten



On Jul 17, 2010, at 12:32 AM, Eric Schulte wrote:

> Hi Nicolas,
>
> I'll apply this patch now.  Thanks for catching this -- Eric
>
> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>
>> Hello,
>>
>>>>>>> Eric Schulte writes:
>>
>>> Hi Nicolas,
>>
>>> I was able to export your example to html without any problems,  
>>> however
>>> I did receive the same error you mentioned when exporting to LaTeX.
>>
>> HTML problem was indeed from my side.
>>
>>> The attached patch fixes the LaTeX export on my system, please  
>>> give it a
>>> try and let me know if it works for you.  I'm going to look into  
>>> this a
>>> little bit more, as it seems that for LaTeX export the "# 
>>> +begin_src org"
>>> block is being processed /twice/ by org-exp (probably due to the  
>>> LaTeX
>>> exports mechanism for first exporting the header of a file and then
>>> exporting the body), which is not desirable and could be the root  
>>> issue
>>> which this patch may just paper over.
>>
>> It works again with your patch.
>>
>> Thanks.
>>
>> -- Nicolas
>
> _______________________________________________
> 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] 6+ messages in thread

* Re: [BUG][Babel] Exporting text before heading
  2010-07-18  6:14       ` Carsten Dominik
@ 2010-07-18 17:06         ` Eric Schulte
  0 siblings, 0 replies; 6+ messages in thread
From: Eric Schulte @ 2010-07-18 17:06 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Org Mode List, Nicolas Goaziou

Done -- Eric

Carsten Dominik <carsten.dominik@gmail.com> writes:

> Hi Eric,
>
> have you applied this patch?  If yes, please mark it so on the
> patchwork server.
>
> Thanks!
>
> - Carsten
>
>
>
> On Jul 17, 2010, at 12:32 AM, Eric Schulte wrote:
>
>> Hi Nicolas,
>>
>> I'll apply this patch now.  Thanks for catching this -- Eric
>>
>> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>>
>>> Hello,
>>>
>>>>>>>> Eric Schulte writes:
>>>
>>>> Hi Nicolas,
>>>
>>>> I was able to export your example to html without any problems,
>>>> however
>>>> I did receive the same error you mentioned when exporting to LaTeX.
>>>
>>> HTML problem was indeed from my side.
>>>
>>>> The attached patch fixes the LaTeX export on my system, please
>>>> give it a
>>>> try and let me know if it works for you.  I'm going to look into
>>>> this a
>>>> little bit more, as it seems that for LaTeX export the "#
>>>> +begin_src org"
>>>> block is being processed /twice/ by org-exp (probably due to the
>>>> LaTeX
>>>> exports mechanism for first exporting the header of a file and then
>>>> exporting the body), which is not desirable and could be the root
>>>> issue
>>>> which this patch may just paper over.
>>>
>>> It works again with your patch.
>>>
>>> Thanks.
>>>
>>> -- Nicolas
>>
>> _______________________________________________
>> 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] 6+ messages in thread

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-16 14:12 [BUG][Babel] Exporting text before heading Nicolas Goaziou
2010-07-16 20:02 ` Eric Schulte
2010-07-16 20:44   ` Nicolas Goaziou
2010-07-16 22:32     ` Eric Schulte
2010-07-18  6:14       ` Carsten Dominik
2010-07-18 17:06         ` Eric Schulte

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