emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] bug in orgmode parsing of results


From: daimrod
Subject: Re: [O] bug in orgmode parsing of results
Date: Wed, 28 Dec 2016 15:03:29 +0100
User-agent: Mozilla/5.0 (X11; OpenBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1


On 12/27/16 19:11, Charles C. Berry wrote:
> On Tue, 27 Dec 2016, daimrod wrote:
> 
>> Hi,
>>
>> I've found what I think is a bug in orgmode parsing.
>> When the following file is parsed :
>>
>> * Test
>> #+BEGIN_SRC emacs-lisp :exports results :results raw drawer
>> (format "- Test2")
>> #+END_SRC
>>
>> #+RESULTS:
>> :RESULTS:
>> - Test2
>> :END:
>>
> 
> [snip]
> 
>>
>> That is, it generates a DRAWER, which seems correct.
>>
>> However, when the following file is parsed :
>>
>> * Test
>> #+BEGIN_SRC emacs-lisp :exports results :results raw drawer
>> (format "* Test2")
>> #+END_SRC
>>
>> #+RESULTS:
>> :RESULTS:
>> * Test2
>> :END:
>>
> 
> [deleted]
> 
>> That is, it generates a PARAGRAPH which seems incorrect.
>>
>> WDYT?
>>
> 
> What I think is that you should run org-lint on your document. It will
> say something like this (but with different line numbers):
> 
>   Line Trust Warning
>      2 low   Forbidden combination in header ":results": raw, drawer
>     12 low   Forbidden combination in header ":results": raw, drawer
>     17 low   Possible incomplete drawer ":RESULTS:"
> 
> The last one should catch your eye.

Didn't know about org-lint. Thanks.

> If you want to generate results that have lines that start with `*' you
> need to protect them. A good way to do this is to wrap them in a src
> block or export block like this:
> 
> #+BEGIN_SRC emacs-lisp :exports results :wrap export latex
> (format "* Test2")
> #+END_SRC

The thing about :wrap export html is that I've to generate the HTML
myself, whereas when I export the :RESULTS: drawer, org-mode generates
the HTML. AFAIK there is no export block for org (no begin_export org).

As a workaround I can always use `:results raw` but then it can not
replace the result automatically. However, that's not a problem for my
use case I think...

Thanks for your help.

Best,

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]