emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Babel should not work in the subtree marked as not exported


From: Andreas Leha
Subject: Re: [O] Babel should not work in the subtree marked as not exported
Date: Fri, 14 Mar 2014 09:41:15 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Hi Eric,

Eric Schulte <address@hidden> writes:

> Andreas Leha <address@hidden> writes:
>
>> Hi Eric,
>>
>> Eric Schulte <address@hidden> writes:
>>
>>>>>>>
>>>>>>> So what is your suggestion for the OP to achieve what he is after?
>>>>>>> noexport and noeval at the same time.
>>>>>>>
>>>
>>> I'm jumping in half way through here,
>>
>> Thanks for jumping in.
>>
>>> but wouldn't setting the :noeval
>>> property to "yes" and :export property to "none" on the subtree work?
>>
>> Well, the property-setting works, but that is really cumbersome.  In a
>> typical org file, it takes 5 keystrokes to toggle the :noexport: tag
>> (C-c C-c n TAB RET).  But I do not want to count the keystrokes it take
>> to additionally set these properties.
>>
>
> Not that bad "C-c C-x p n RET yes", I get 8 to set noeval, if you've
> done it already in that Org file.  You could also easily wrap this
> behavior into a function and bind that to a key-chord.
>

Plus setting :noexport: or COMMENT ;-)

Well, the most serious downside is, that there is no visual
feedback here.  So, if I want both export and evaluation to be
disabled for a subtree, I first need to remember to also set the
property.  And coming back later to that file, I also need to
check the property of each subtree in question to see, whether
evaluation is disabled.  A TAG or the COMMENt are visible
immediately.

In my opinion, excluding a subtree from export *and* evaluation
is not an esoteric use case and deserves better support.


>>
>> Just to confirm.  This is what you suggest, correct?
>>
>> --8<---------------cut here---------------start------------->8---
>> * test
>>
>> ** Not exported                                                         
>> :noexport:
>>    :PROPERTIES:
>>    :noeval: "yes"
>>    :export: "none"
>>    :END:
>>    #+BEGIN_SRC ditaa :file test.png :cmdline -E
>>           +--------+---+---+---+---+---+---+---+  
>> +---+---+---+---+---+---+---+---+
>>       x   | 0 cRED | 0 | 0 | 0 | 0 | 0 | 0 | 0 |  | 0 | 0 | 0 | 0 | 1 | 0 | 
>> 1 | 1 |
>>           +--------+---+---+---+---+---+---+---+  
>> +---+---+---+---+---+---+---+---+
>>    #+END_SRC
>>
>> ** blah blah
>>    blah blah blah
>> --8<---------------cut here---------------end--------------->8---
>>
>>
>>
>>>
>>> One may also want to COMMENT the subtree to inhibit it's export
>>> wholepiece (not just code blocks).
>>
>> This does not seem to work, as the test.png is also created here.
>>
>> Again, just to confirm.  This is your suggestion, correct?
>>
>> --8<---------------cut here---------------start------------->8---
>> * test
>>
>> ** COMMENT Not exported
>>    #+BEGIN_SRC ditaa :file test.png :cmdline -E
>>           +--------+---+---+---+---+---+---+---+  
>> +---+---+---+---+---+---+---+---+
>>       x   | 0 cRED | 0 | 0 | 0 | 0 | 0 | 0 | 0 |  | 0 | 0 | 0 | 0 | 1 | 0 | 
>> 1 | 1 |
>>           +--------+---+---+---+---+---+---+---+  
>> +---+---+---+---+---+---+---+---+
>>    #+END_SRC
>>
>> ** blah blah
>>    blah blah blah
>> --8<---------------cut here---------------end--------------->8---
>>
>
> Close, I meant the following alternative
>
> * test
>
> ** COMMENT Not exported
>    :PROPERTIES:
>    :noeval: "yes"
>    :END:
>    #+BEGIN_SRC ditaa :file test.png :cmdline -E
>           +--------+---+---+---+---+---+---+---+  
> +---+---+---+---+---+---+---+---+
>       x   | 0 cRED | 0 | 0 | 0 | 0 | 0 | 0 | 0 |  | 0 | 0 | 0 | 0 | 1 | 0 | 1 
> | 1 |
>           +--------+---+---+---+---+---+---+---+  
> +---+---+---+---+---+---+---+---+
>    #+END_SRC
>
> ** blah blah
>    blah blah blah
>
>>
>>
>> So, my question to this thread is: What is the easiest way to disable a
>> subtree during export completely so that also none of the code blocks is
>> evaluated (regardless of its :session argument).
>>
>
> My example immediately above.
>
>>
>> Or even more precisely: Couldn't the COMMENT keyword do exactly that?  I
>> do not expect code from inside a COMMENT subtree to be considered during
>> export.
>>
>
> No.  This has been raised previously and there was a consensus that it
> is often desirable for code in a COMMENT section to be evaluated on
> export.  Personally I often stuff code blocks into COMMENT sections
> which I want run as part of my publishing process (e.g., to create
> resources used in the exported document).
>


Sorry for being unclear here.  I wanted to propose different
behaviour for TAGs (lets say :noexport:) and the COMMENT keyword.
I am perfectly fine with :noexport: only prohibiting export but
still allowing evaluation.

But I propose that COMMENT be more treated like a comment, so more
like a shorthand for commenting out that subtree using '# '.
That way, evaluation would be disabled.

I see two benefits:
1. It serves the use-case where one wants a subtree to be not
   exported and not evaluated.
2. It more resembles Orgs idea of comments.

And since the other use case (no export but still evaluation) is
still very well supported via :noexport: there would be not too
much loss.

(IIRC, the COMMENT keyword was close to removal from Orgs syntax
recently.  So, why not add some real additional functionality to
it?)

WDYT?

Regards,
Andreas

PS:  IIUC, Samuel proposed the same thing:
http://permalink.gmane.org/gmane.emacs.orgmode/83459




reply via email to

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