emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* disable tangling for an entire section?
@ 2013-05-07  5:47 Bill White
  2013-05-07  7:14 ` Christian Moe
  0 siblings, 1 reply; 7+ messages in thread
From: Bill White @ 2013-05-07  5:47 UTC (permalink / raw)
  To: emacs-orgmode

Is there a simple way to disable tangling for an entire section's code
blocks?  Or to put it a different way, can tangling be toggled at the
section level and not just the code-block level?

I tried this:

** a section in my file
:PROPERTIES:
:tangle: no
:END:

by analogy from 
   #+PROPERTY: tangle yes
in (info "(org) Header arguments in Org mode properties"), but code
blocks in that section were still tangled.

Org-mode version 8.0.2 (release_8.0.2-61-g22dfa7 @ /home/billw/Dropbox/org/org-mode/lisp/)
GNU Emacs 24.3.1 (i686-pc-linux-gnu, GTK+ Version 3.6.0) of 2013-03-11 on wri

Thanks -

bw
-- 
Bill White . billw@wolfram.com
"No ma'am, we're musicians."

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

* Re: disable tangling for an entire section?
  2013-05-07  5:47 disable tangling for an entire section? Bill White
@ 2013-05-07  7:14 ` Christian Moe
  2013-05-07 12:23   ` Sebastien Vauban
  0 siblings, 1 reply; 7+ messages in thread
From: Christian Moe @ 2013-05-07  7:14 UTC (permalink / raw)
  To: Bill White; +Cc: emacs-orgmode


Hi,

That should work, I think, and it does work for me (on 8.0.1).
I cannot reproduce the problem.

Yours,
Christian

Bill White writes:

> Is there a simple way to disable tangling for an entire section's code
> blocks?  Or to put it a different way, can tangling be toggled at the
> section level and not just the code-block level?
>
> I tried this:
>
> ** a section in my file
> :PROPERTIES:
> :tangle: no
> :END:
>
> by analogy from 
>    #+PROPERTY: tangle yes
> in (info "(org) Header arguments in Org mode properties"), but code
> blocks in that section were still tangled.
>
> Org-mode version 8.0.2 (release_8.0.2-61-g22dfa7 @ /home/billw/Dropbox/org/org-mode/lisp/)
> GNU Emacs 24.3.1 (i686-pc-linux-gnu, GTK+ Version 3.6.0) of 2013-03-11 on wri
>
> Thanks -
>
> bw

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

* Re: disable tangling for an entire section?
  2013-05-07  7:14 ` Christian Moe
@ 2013-05-07 12:23   ` Sebastien Vauban
  2013-05-08 17:00     ` Bill White
  0 siblings, 1 reply; 7+ messages in thread
From: Sebastien Vauban @ 2013-05-07 12:23 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Christian Moe wrote:
> Bill White writes:
>> Is there a simple way to disable tangling for an entire section's code
>> blocks? Or to put it a different way, can tangling be toggled at the
>> section level and not just the code-block level?
>>
>> I tried this:
>>
>> ** a section in my file
>> :PROPERTIES:
>> :tangle: no
>> :END:
>>
>> by analogy from 
>>    #+PROPERTY: tangle yes
>> in (info "(org) Header arguments in Org mode properties"), but code
>> blocks in that section were still tangled.
>
> That should work, I think, and it does work for me (on 8.0.1).
> I cannot reproduce the problem.

That must work, yes. Except if you have ":tangle" header arguments set on
sub-subtrees, or on code blocks, of course.

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: disable tangling for an entire section?
  2013-05-07 12:23   ` Sebastien Vauban
@ 2013-05-08 17:00     ` Bill White
  2013-05-09  6:54       ` Christian Moe
  0 siblings, 1 reply; 7+ messages in thread
From: Bill White @ 2013-05-08 17:00 UTC (permalink / raw)
  To: emacs-orgmode

On Tue May 07 2013 at 07:23, "Sebastien Vauban" <sva-news@mygooglest.com> wrote:

> Christian Moe wrote:
>> Bill White writes:
>>> Is there a simple way to disable tangling for an entire section's code
>>> blocks? Or to put it a different way, can tangling be toggled at the
>>> section level and not just the code-block level?
>>>
>>> I tried this:
>>>
>>> ** a section in my file
>>> :PROPERTIES:
>>> :tangle: no
>>> :END:
>>>
>>> by analogy from 
>>>    #+PROPERTY: tangle yes
>>> in (info "(org) Header arguments in Org mode properties"), but code
>>> blocks in that section were still tangled.
>>
>> That should work, I think, and it does work for me (on 8.0.1).
>> I cannot reproduce the problem.
>
> That must work, yes. Except if you have ":tangle" header arguments set
> on sub-subtrees, or on code blocks, of course.

Thank you Christian and Sebastien for your replies.

I was hoping that a higher-level setting would override all tangle
settings under it, no matter what they might be.  This would make it
possible to change an entire section's tangling without fussing with
each code block's setting.

For example, I had hoped that the following would disable tangling for
both code blocks, but for me[1] even under 'emacs -Q' the first block is
tangled:

* headline
:PROPERTIES:
:tangle:   no
:END:

#+begin_src perl :tangle yes
2 + 2
#+end_src

#+begin_src perl :tangle no
3 + 3
#+end_src

[1]:
Org-mode version 8.0.2 (release_8.0.2-61-g22dfa7 @ /home/billw/Dropbox/org/org-mode/lisp/)
GNU Emacs 24.3.1 (i686-pc-linux-gnu, GTK+ Version 3.6.0) of 2013-03-11 on wri

Cheers -

bw
-- 
Bill White . billw@wolfram.com
"No ma'am, we're musicians."

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

* Re: disable tangling for an entire section?
  2013-05-08 17:00     ` Bill White
@ 2013-05-09  6:54       ` Christian Moe
  2013-05-13  8:23         ` Rainer M. Krug
  0 siblings, 1 reply; 7+ messages in thread
From: Christian Moe @ 2013-05-09  6:54 UTC (permalink / raw)
  To: Bill White; +Cc: emacs-orgmode


> I was hoping that a higher-level setting would override all tangle
> settings under it, no matter what they might be.  This would make it
> possible to change an entire section's tangling without fussing with
> each code block's setting.

The status quo makes more sense, I think. It allows you to easily change
an entire section's tangling but make specific exceptions that
override the general setting.

Yours,
Christian

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

* Re: disable tangling for an entire section?
  2013-05-09  6:54       ` Christian Moe
@ 2013-05-13  8:23         ` Rainer M. Krug
  2013-05-13 15:51           ` Bill White
  0 siblings, 1 reply; 7+ messages in thread
From: Rainer M. Krug @ 2013-05-13  8:23 UTC (permalink / raw)
  To: Christian Moe; +Cc: emacs-orgmode, Bill White

Christian Moe <mail@christianmoe.com> writes:

>> I was hoping that a higher-level setting would override all tangle
>> settings under it, no matter what they might be.  This would make it
>> possible to change an entire section's tangling without fussing with
>> each code block's setting.
>
> The status quo makes more sense, I think. It allows you to easily change
> an entire section's tangling but make specific exceptions that
> override the general setting.

I agree with Christian here. But you could trick org into achieving what
you want, in specifying a tangle target in the PROPERTIES sectio, given
that you only use :tangle yes :

* headline
:PROPERTIES:
:tangle:   tmp.tmp
:END:

#+begin_src perl :tangle yes
2 + 2
#+end_src
#+begin_src perl :tangle no
3 + 3
#+end_src
 

In this case, the the first code block can be tangled into tmp.tmp and
the second one won't. So no harm done to your "clean" tangled file, only
the tmp.tmp, which you can discard afterwords.

Cheers,

Rainer

>
> Yours,
> Christian
>


-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax :       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer@krugs.de

Skype:      RMkrug

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

* Re: disable tangling for an entire section?
  2013-05-13  8:23         ` Rainer M. Krug
@ 2013-05-13 15:51           ` Bill White
  0 siblings, 0 replies; 7+ messages in thread
From: Bill White @ 2013-05-13 15:51 UTC (permalink / raw)
  To: Rainer M. Krug; +Cc: emacs-orgmode, Christian Moe

On Mon May 13 2013 at 03:23, Rainer@krugs.de (Rainer M. Krug) wrote:

> Christian Moe <mail@christianmoe.com> writes:
>
>>> I was hoping that a higher-level setting would override all tangle
>>> settings under it, no matter what they might be.  This would make it
>>> possible to change an entire section's tangling without fussing with
>>> each code block's setting.
>>
>> The status quo makes more sense, I think. It allows you to easily change
>> an entire section's tangling but make specific exceptions that
>> override the general setting.
>
> I agree with Christian here. But you could trick org into achieving
> what you want, in specifying a tangle target in the PROPERTIES sectio,
> given that you only use :tangle yes :

I wish I'd thought of that!  Many thanks -

bw

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

end of thread, other threads:[~2013-05-13 15:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-07  5:47 disable tangling for an entire section? Bill White
2013-05-07  7:14 ` Christian Moe
2013-05-07 12:23   ` Sebastien Vauban
2013-05-08 17:00     ` Bill White
2013-05-09  6:54       ` Christian Moe
2013-05-13  8:23         ` Rainer M. Krug
2013-05-13 15:51           ` Bill White

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