emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [babel] Commenting out src blocks for tangling
@ 2013-02-27 17:53 Eric S Fraga
  2013-02-27 18:10 ` Aaron Ecay
  2013-02-27 19:18 ` Alan L Tyree
  0 siblings, 2 replies; 27+ messages in thread
From: Eric S Fraga @ 2013-02-27 17:53 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

I finally bit the bullet and converted by rather convoluted and long
emacs startup code to an org file with emacs-lisp code blocks.  I then
tangle these into the actual code which is loaded by emacs at
startup.  So far, so good, and it does make it easier for me to navigate
around my customisations.

However, it has highlighted a feature which is missing (I think) but
which would be great.  I tangle all the code blocks to the same
file.  It would be great if I could have the =org-babel-tangle= command
skip sections that are COMMENTed out (i.e. headline with COMMENT, as
produced by =org-toggle-comment=).

Alternatively, a :nobabel: or :notangle: tag to mark subtrees that
should be excluded would be fine.

If I have missed a way of doing this, please do let me know (politely
;-).  If not, any suggestions on how to achieve this would be great.

Thanks,
eric

-- 
: Eric S Fraga, GnuPG: 0xC89193D8FFFCF67D
: in Emacs 24.3.50.1 and Org release_7.9.3f-1285-g6cc600

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

* Re: [babel] Commenting out src blocks for tangling
  2013-02-27 17:53 [babel] Commenting out src blocks for tangling Eric S Fraga
@ 2013-02-27 18:10 ` Aaron Ecay
  2013-02-27 18:22   ` Eric S Fraga
  2013-02-27 19:18 ` Alan L Tyree
  1 sibling, 1 reply; 27+ messages in thread
From: Aaron Ecay @ 2013-02-27 18:10 UTC (permalink / raw)
  To: Eric S Fraga, emacs-orgmode

You should be able to set the “tangle” property of the headline to “no”
to achieve this effect: see the following section of the manual:
(org) Header arguments in Org mode properties

It isn’t as easy to manipulate as a tag, perhaps.

-- 
Aaron Ecay

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

* Re: [babel] Commenting out src blocks for tangling
  2013-02-27 18:10 ` Aaron Ecay
@ 2013-02-27 18:22   ` Eric S Fraga
  0 siblings, 0 replies; 27+ messages in thread
From: Eric S Fraga @ 2013-02-27 18:22 UTC (permalink / raw)
  To: emacs-orgmode

Aaron Ecay <aaronecay@gmail.com> writes:

> You should be able to set the “tangle” property of the headline to “no”
> to achieve this effect: see the following section of the manual:
> (org) Header arguments in Org mode properties
>
> It isn’t as easy to manipulate as a tag, perhaps.

Thanks.  This does work and is relatively straightforward.  However, it
provides no visual indication of excluded sections from my customisation
file which is rather unfortunate.  That's why I would prefer to be able
to COMMENT or tag excluded sub-trees.  I guess I can use column view to
see what is excluded...

In any case, I can manage what I want for the moment.

Thanks again,
eric

-- 
: Eric S Fraga, GnuPG: 0xC89193D8FFFCF67D
: in Emacs 24.3.50.1 and Org release_7.9.3f-1285-g6cc600

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

* Re: [babel] Commenting out src blocks for tangling
  2013-02-27 17:53 [babel] Commenting out src blocks for tangling Eric S Fraga
  2013-02-27 18:10 ` Aaron Ecay
@ 2013-02-27 19:18 ` Alan L Tyree
  2013-02-27 19:32   ` Eric S Fraga
  1 sibling, 1 reply; 27+ messages in thread
From: Alan L Tyree @ 2013-02-27 19:18 UTC (permalink / raw)
  To: Eric S Fraga; +Cc: emacs-orgmode


Eric S Fraga writes:

> Hello,
>
> I finally bit the bullet and converted by rather convoluted and long
> emacs startup code to an org file with emacs-lisp code blocks.  I then
> tangle these into the actual code which is loaded by emacs at
> startup.  So far, so good, and it does make it easier for me to navigate
> around my customisations.
>
> However, it has highlighted a feature which is missing (I think) but
> which would be great.  I tangle all the code blocks to the same
> file.  It would be great if I could have the =org-babel-tangle= command
> skip sections that are COMMENTed out (i.e. headline with COMMENT, as
> produced by =org-toggle-comment=).
>
> Alternatively, a :nobabel: or :notangle: tag to mark subtrees that
> should be excluded would be fine.
>
> If I have missed a way of doing this, please do let me know (politely
> ;-).  If not, any suggestions on how to achieve this would be great.
G'day Eric,

If I understand your problem correctly, doesn't the property :tangle: do
what you want?

Cheers,
Alan

>
> Thanks,
> eric


-- 
Alan L Tyree           http://www2.austlii.edu.au/~alan
Tel:  04 2748 6206     sip:172385@iptel.org

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

* Re: [babel] Commenting out src blocks for tangling
  2013-02-27 19:18 ` Alan L Tyree
@ 2013-02-27 19:32   ` Eric S Fraga
  2013-02-27 23:33     ` Darlan Cavalcante Moreira
  0 siblings, 1 reply; 27+ messages in thread
From: Eric S Fraga @ 2013-02-27 19:32 UTC (permalink / raw)
  To: Alan L Tyree; +Cc: emacs-orgmode

Alan L Tyree <alantyree@gmail.com> writes:

[...]

> G'day Eric,
>
> If I understand your problem correctly, doesn't the property :tangle: do
> what you want?

Yes, thanks; Aaron Ecay has also pointed out to me.  It works and does
exactly what I said I needed.  And you have both been very polite :-)

-- 
: Eric S Fraga, GnuPG: 0xC89193D8FFFCF67D
: in Emacs 24.3.50.1 and Org release_7.9.3f-1285-g6cc600

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

* Re: [babel] Commenting out src blocks for tangling
  2013-02-27 19:32   ` Eric S Fraga
@ 2013-02-27 23:33     ` Darlan Cavalcante Moreira
  2013-02-28  9:01       ` Rainer M Krug
  0 siblings, 1 reply; 27+ messages in thread
From: Darlan Cavalcante Moreira @ 2013-02-27 23:33 UTC (permalink / raw)
  To: Alan L Tyree, emacs-orgmode


I also converted my Emacs configuration to an org-mode file a long time ago
and I hit the same spot you did. As you, I initially assumed (wished) that
the COMMENT marker would disable tangling of blocks in that subtree. After
that I found out the tangle property, which solves the problem but has no
visual indication as you mentioned.

Nowadays I use both approaches. Whenever I set the tangle property to "no"
I also set the COMMENT mark and vice-verse. It is just a very minor
annoyance to do both things and I'm used to it now.

--
Darlan


At Wed, 27 Feb 2013 19:32:41 +0000,
Eric S Fraga wrote:
> 
> Alan L Tyree <alantyree@gmail.com> writes:
> 
> [...]
> 
> > G'day Eric,
> >
> > If I understand your problem correctly, doesn't the property :tangle: do
> > what you want?
> 
> Yes, thanks; Aaron Ecay has also pointed out to me.  It works and does
> exactly what I said I needed.  And you have both been very polite :-)
> 
> -- 
> : Eric S Fraga, GnuPG: 0xC89193D8FFFCF67D
> : in Emacs 24.3.50.1 and Org release_7.9.3f-1285-g6cc600
> 
> 

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

* Re: [babel] Commenting out src blocks for tangling
  2013-02-27 23:33     ` Darlan Cavalcante Moreira
@ 2013-02-28  9:01       ` Rainer M Krug
  2013-02-28  9:25         ` Bastien
  0 siblings, 1 reply; 27+ messages in thread
From: Rainer M Krug @ 2013-02-28  9:01 UTC (permalink / raw)
  To: Darlan Cavalcante Moreira, Alan L Tyree, emacs-orgmode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 28/02/13 00:33, Darlan Cavalcante Moreira wrote:
> 
> I also converted my Emacs configuration to an org-mode file a long time ago and I hit the same
> spot you did. As you, I initially assumed (wished) that the COMMENT marker would disable
> tangling of blocks in that subtree. After that I found out the tangle property, which solves
> the problem but has no visual indication as you mentioned.
> 
> Nowadays I use both approaches. Whenever I set the tangle property to "no" I also set the
> COMMENT mark and vice-verse. It is just a very minor annoyance to do both things and I'm used
> to it now.

I agree - COMMENTing a subtree should automatically disable tangling of code blocks in the
subtree. Would this something which could be introduced easily, as it seems there are quite a few
who assumed that it would be doing it?

Rainer


> 
> -- Darlan
> 
> 
> At Wed, 27 Feb 2013 19:32:41 +0000, Eric S Fraga wrote:
>> 
>> Alan L Tyree <alantyree@gmail.com> writes:
>> 
>> [...]
>> 
>>> G'day Eric,
>>> 
>>> If I understand your problem correctly, doesn't the property :tangle: do what you want?
>> 
>> Yes, thanks; Aaron Ecay has also pointed out to me.  It works and does exactly what I said I
>> needed.  And you have both been very polite :-)
>> 
>> -- : Eric S Fraga, GnuPG: 0xC89193D8FFFCF67D : in Emacs 24.3.50.1 and Org
>> release_7.9.3f-1285-g6cc600
>> 
>> 
> 
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJRLxzfAAoJENvXNx4PUvmCuaAIAOITFnoNMB5EIyaPib6JC/wU
WcD5e0J8+kQMcowYEoLrJmPOupw3sXj2tQoyq0gHhdcCVgBx0ZJh+WNkbC7QUlWh
ruSJYuPQhbkFr+FjUpas3iyNmuxPIghpmmhMPKK/NhLGaE3tVgvEtMXeY9IEp2ai
a0P+7g32yAv80kmJE2FXy8UdWGo/Cya8MFueRH2YxRv7cYRA63qFj8Wl4+hCM7sD
comvN6wZue8ZTi32O203PQueafEA37+AZgUdcdLU13TQDRj4PytFjjsHGr64LRK8
zYTQr3+YiUDq9Nr0j+B4uxPZWXJgAcTMzW6+0FqbPdnSPoTpGnwLblQbZ/MnG1E=
=sgpY
-----END PGP SIGNATURE-----

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

* Re: [babel] Commenting out src blocks for tangling
  2013-02-28  9:01       ` Rainer M Krug
@ 2013-02-28  9:25         ` Bastien
  2013-02-28  9:27           ` Rainer M Krug
                             ` (4 more replies)
  0 siblings, 5 replies; 27+ messages in thread
From: Bastien @ 2013-02-28  9:25 UTC (permalink / raw)
  To: Rainer M Krug; +Cc: emacs-orgmode, Alan L Tyree

Rainer M Krug <r.m.krug@gmail.com> writes:

> I agree - COMMENTing a subtree should automatically disable tangling of code blocks in the
> subtree. Would this something which could be introduced easily, as it seems there are quite a few
> who assumed that it would be doing it?

This is now the case in master:
http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=8e0b45

Thanks!

-- 
 Bastien

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

* Re: [babel] Commenting out src blocks for tangling
  2013-02-28  9:25         ` Bastien
@ 2013-02-28  9:27           ` Rainer M Krug
  2013-02-28  9:30           ` Sebastien Vauban
                             ` (3 subsequent siblings)
  4 siblings, 0 replies; 27+ messages in thread
From: Rainer M Krug @ 2013-02-28  9:27 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode, Alan L Tyree

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 28/02/13 10:25, Bastien wrote:
> Rainer M Krug <r.m.krug@gmail.com> writes:
> 
>> I agree - COMMENTing a subtree should automatically disable tangling of code blocks in the 
>> subtree. Would this something which could be introduced easily, as it seems there are quite a
>> few who assumed that it would be doing it?
> 
> This is now the case in master: http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=8e0b45

Brilliant - makes life so much easier and consistent. I'll update immediately.

Cheers,

Rainer

> 
> Thanks!
> 


- -- 
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
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJRLyMWAAoJENvXNx4PUvmCUZoIAMl3G6yoXTUlSKV3jwzAKwtl
ppwDRmgmy7Hqsk3KAl/yZdRdypXg4Ziom9zsiOSzHYz5agiPDplePbZ/fKbeOJKU
kNr4Rsy+or9h1UHyzMCJnKg3yuy1hv7htFXcMpFeLe+ohQcM0xd0ehLPvcutj5nx
W/d3bbIVL5GXTPdVYT8UO2CuPLfVJURnv7RvAFlaiVhkXiwKfSrE78bsm96ZkZK1
kWvAhESSwgWDSa+/2w/PESpt80iz7OZufsfKCEga8ZrJkkFFpzHgpA7uaqGYSzYA
eIJ9vrGkUsi12UC2USwT7mxF0Wic7Yj+4Nvq+t0yH7f92VnqQCeHp8ztt/fxics=
=HQRW
-----END PGP SIGNATURE-----

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

* Re: [babel] Commenting out src blocks for tangling
  2013-02-28  9:25         ` Bastien
  2013-02-28  9:27           ` Rainer M Krug
@ 2013-02-28  9:30           ` Sebastien Vauban
  2013-02-28  9:42             ` Rainer M Krug
  2013-02-28  9:44             ` Bastien
  2013-02-28  9:51           ` Rasmus
                             ` (2 subsequent siblings)
  4 siblings, 2 replies; 27+ messages in thread
From: Sebastien Vauban @ 2013-02-28  9:30 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Bastien,

Bastien wrote:
> Rainer M Krug <r.m.krug-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>
>> I agree - COMMENTing a subtree should automatically disable tangling of
>> code blocks in the subtree. Would this something which could be introduced
>> easily, as it seems there are quite a few who assumed that it would be
>> doing it?
>
> This is now the case in master:
> http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=8e0b45

Does it work as well for the `:noexport:' tag?

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: [babel] Commenting out src blocks for tangling
  2013-02-28  9:30           ` Sebastien Vauban
@ 2013-02-28  9:42             ` Rainer M Krug
  2013-02-28  9:47               ` Sebastien Vauban
  2013-02-28  9:44             ` Bastien
  1 sibling, 1 reply; 27+ messages in thread
From: Rainer M Krug @ 2013-02-28  9:42 UTC (permalink / raw)
  To: Sebastien Vauban, Bastien; +Cc: emacs-orgmode

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 28/02/13 10:30, Sebastien Vauban wrote:
> Bastien,
> 
> Bastien wrote:
>> Rainer M Krug <r.m.krug-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>> 
>>> I agree - COMMENTing a subtree should automatically disable tangling of code blocks in the 
>>> subtree. Would this something which could be introduced easily, as it seems there are
>>> quite a few who assumed that it would be doing it?
>> 
>> This is now the case in master: http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=8e0b45
> 
> Does it work as well for the `:noexport:' tag?

I don't think it should. Tangling is something different to export, so there should not be ay
interactions between the two in this respect. On the other hand, COMMENT is generic - it is a
COMMENT and does not concern anything. So it is applicable for tangling as well.

I would actually say it would be counterintuitive if :noexport: would influence tangling as it is
governed by a completely different approach in org as well as in what I am doing with the org file.

Cheers,

Rainer

> 
> Best regards, Seb
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJRLyahAAoJENvXNx4PUvmCy7UIAMEFBm2FV3MaCaJuurMdh9g4
3JyoLMmgvAEhDHjIfyLHviN+RC7jr/77Xcc+2WwSlMY2RAPE6isRVIFkFR+roSHy
TTyYzQu8DOCsZjWHqQM+FLl5sxPvqU0KvUlXXVzND1m48uehJkU07E77eH43AM/Q
ThSanN0cIwC25u5PyPe7xi9SRoWXUYGTmsu9Ymg3J2zzmYOn8l9rSb7l68Y3fQTA
9i3SFzgyyXAJy453zNkZsoyOhCgP4kNtwZ9iLVW934sNJE1pVhMsr8wNfYfY+S+s
FjNqePE+izC4uHIrSaGaw3COlar6qgPSTKQmF+ueNw/FjPL+TJsPVgSH2pig3+k=
=b7/g
-----END PGP SIGNATURE-----

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

* Re: [babel] Commenting out src blocks for tangling
  2013-02-28  9:30           ` Sebastien Vauban
  2013-02-28  9:42             ` Rainer M Krug
@ 2013-02-28  9:44             ` Bastien
  1 sibling, 0 replies; 27+ messages in thread
From: Bastien @ 2013-02-28  9:44 UTC (permalink / raw)
  To: Sebastien Vauban; +Cc: public-emacs-orgmode-mXXj517/zsQ



"Sebastien Vauban"
<wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:

> Bastien wrote:
>> Rainer M Krug <r.m.krug-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>>
>>> I agree - COMMENTing a subtree should automatically disable tangling of
>>> code blocks in the subtree. Would this something which could be introduced
>>> easily, as it seems there are quite a few who assumed that it would be
>>> doing it?
>>
>> This is now the case in master:
>> http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=8e0b45
>
> Does it work as well for the `:noexport:' tag?

No.

:noexport: is meaningful in the context of exporting, 
not in the context of tangling.

-- 
 Bastien

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

* Re: [babel] Commenting out src blocks for tangling
  2013-02-28  9:42             ` Rainer M Krug
@ 2013-02-28  9:47               ` Sebastien Vauban
  2013-02-28 12:30                 ` Rainer M Krug
  0 siblings, 1 reply; 27+ messages in thread
From: Sebastien Vauban @ 2013-02-28  9:47 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi Rainer,

Rainer M Krug wrote:
> On 28/02/13 10:30, Sebastien Vauban wrote:
>> Bastien wrote:
>>> Rainer M Krug <r.m.krug-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>>> 
>>>> I agree - COMMENTing a subtree should automatically disable tangling of
>>>> code blocks in the subtree. Would this something which could be
>>>> introduced easily, as it seems there are quite a few who assumed that it
>>>> would be doing it?
>>> 
>>> This is now the case in master:
>>> http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=8e0b45
>> 
>> Does it work as well for the `:noexport:' tag?
>
> I don't think it should. Tangling is something different to export, so there
> should not be ay interactions between the two in this respect. On the other
> hand, COMMENT is generic - it is a COMMENT and does not concern anything. So
> it is applicable for tangling as well.
>
> I would actually say it would be counterintuitive if :noexport: would
> influence tangling as it is governed by a completely different approach in
> org as well as in what I am doing with the org file.

I've always used :noexport: instead of COMMENT (as I hate the visual clutter
of that wide keyword). So, for me, they were equivalent.

You must be right, though, that they aren't: COMMENT seems more generic than
just export. So, dismiss my request.

Best regards,
  Seb

-- 
Sebastien Vauban

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

* Re: [babel] Commenting out src blocks for tangling
  2013-02-28  9:25         ` Bastien
  2013-02-28  9:27           ` Rainer M Krug
  2013-02-28  9:30           ` Sebastien Vauban
@ 2013-02-28  9:51           ` Rasmus
  2013-02-28 10:05             ` Bastien
  2013-02-28 19:45           ` Eric S Fraga
  2013-10-18 14:37           ` Alan Schmitt
  4 siblings, 1 reply; 27+ messages in thread
From: Rasmus @ 2013-02-28  9:51 UTC (permalink / raw)
  To: emacs-orgmode

Bastien <bzg@altern.org> writes:> Rainer M Krug <r.m.krug@gmail.com> writes:
>
>> I agree - COMMENTing a subtree should automatically disable tangling of code blocks in the
>> subtree. Would this something which could be introduced easily, as it seems there are quite a few
>> who assumed that it would be doing it?
>
> This is now the case in master:
> http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=8e0b45

Does this ONLY affect tangling or also other code?  For instance I
often keep LATEX_HEADER, Emacs lisp and the like in a COMMENTed
headline. 

This should still be processed.

–Rasmus
-- 
Need more coffee. . .

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

* Re: [babel] Commenting out src blocks for tangling
  2013-02-28  9:51           ` Rasmus
@ 2013-02-28 10:05             ` Bastien
  0 siblings, 0 replies; 27+ messages in thread
From: Bastien @ 2013-02-28 10:05 UTC (permalink / raw)
  To: Rasmus; +Cc: emacs-orgmode

Hi Rasmus,

Rasmus <rasmus@gmx.us> writes:

> Does this ONLY affect tangling or also other code?

Only tangling.

HTH,

-- 
 Bastien

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

* Re: [babel] Commenting out src blocks for tangling
  2013-02-28  9:47               ` Sebastien Vauban
@ 2013-02-28 12:30                 ` Rainer M Krug
  2013-03-02 10:31                   ` Bastien
  0 siblings, 1 reply; 27+ messages in thread
From: Rainer M Krug @ 2013-02-28 12:30 UTC (permalink / raw)
  To: Sebastien Vauban, emacs-orgmode, Bastien

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 28/02/13 10:47, Sebastien Vauban wrote:
> Hi Rainer,
> 
> Rainer M Krug wrote:
>> On 28/02/13 10:30, Sebastien Vauban wrote:
>>> Bastien wrote:
>>>> Rainer M Krug <r.m.krug-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
>>>> 
>>>>> I agree - COMMENTing a subtree should automatically disable tangling of code blocks in
>>>>> the subtree. Would this something which could be introduced easily, as it seems there
>>>>> are quite a few who assumed that it would be doing it?
>>>> 
>>>> This is now the case in master: 
>>>> http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=8e0b45
>>> 
>>> Does it work as well for the `:noexport:' tag?
>> 
>> I don't think it should. Tangling is something different to export, so there should not be ay
>> interactions between the two in this respect. On the other hand, COMMENT is generic - it is a
>> COMMENT and does not concern anything. So it is applicable for tangling as well.
>> 
>> I would actually say it would be counterintuitive if :noexport: would influence tangling as
>> it is governed by a completely different approach in org as well as in what I am doing with
>> the org file.
> 
> I've always used :noexport: instead of COMMENT (as I hate the visual clutter of that wide
> keyword). So, for me, they were equivalent.

Follow up: would it be possible to have the same mechanism for tangling, i.e. a tag :notangle:?
functioning would be equivalent to property tangle: no but more visible and consistent with the
:noexport:? One could also define properties to be tangled and not tangled for different scenarios?


Rainer


> 
> You must be right, though, that they aren't: COMMENT seems more generic than just export. So,
> dismiss my request.
> 
> Best regards, Seb
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJRL03rAAoJENvXNx4PUvmCsGQIAKlPTGJzSlRSvPamZCs2XZqp
kR6YIU20QdSLs3Eei7p1VAFTdb4i9Ci6GaX8LfmForM4jrmkUYPqGNFHOl6Q6rwq
tCSCxAhIvEWZirs1tmhvj+jIZ2so61LTudMfzToEXPcowoCJXOzjS4GVb/QAysmX
qYrY/5OlEw7Qj8YlkmDoeTep4HtSKM941po1VWxm4AJPiyFkipgiQJ3bpVTq5g4p
/QIoG7QhNug1kstDx/2LfTXMZMU1zamBS1T5i0rzYHSkpoZwHCAjozXHtpNeW5VB
UOJTTctGNERb7sk70SM5ACoQxNne3Ojd5iQdjj+lJf0gKGbz20kT6rHrXUS7d9g=
=ryTy
-----END PGP SIGNATURE-----

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

* Re: [babel] Commenting out src blocks for tangling
  2013-02-28  9:25         ` Bastien
                             ` (2 preceding siblings ...)
  2013-02-28  9:51           ` Rasmus
@ 2013-02-28 19:45           ` Eric S Fraga
  2013-10-18 14:37           ` Alan Schmitt
  4 siblings, 0 replies; 27+ messages in thread
From: Eric S Fraga @ 2013-02-28 19:45 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode

Bastien <bzg@altern.org> writes:

> Rainer M Krug <r.m.krug@gmail.com> writes:
>
>> I agree - COMMENTing a subtree should automatically disable tangling of code blocks in the
>> subtree. Would this something which could be introduced easily, as it seems there are quite a few
>> who assumed that it would be doing it?
>
> This is now the case in master:
> http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=8e0b45
>
> Thanks!

Brilliant!  Many thanks.  Works like a charm.

-- 
: Eric S Fraga, GnuPG: 0xC89193D8FFFCF67D
: in Emacs 24.3.50.1 and Org release_7.9.3f-1313-g7d4812

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

* Re: [babel] Commenting out src blocks for tangling
  2013-02-28 12:30                 ` Rainer M Krug
@ 2013-03-02 10:31                   ` Bastien
  2013-03-03  3:44                     ` Charles Berry
  0 siblings, 1 reply; 27+ messages in thread
From: Bastien @ 2013-03-02 10:31 UTC (permalink / raw)
  To: Rainer M Krug; +Cc: emacs-orgmode, Sebastien Vauban

Hi Rainer,

Rainer M Krug <r.m.krug@gmail.com> writes:

> Follow up: would it be possible to have the same mechanism for tangling, i.e. a tag :notangle:?
> functioning would be equivalent to property tangle: no but more visible and consistent with the
> :noexport:? One could also define properties to be tangled and not tangled for different scenarios?

One approach could be to use export filters here.

I'd rather let (or someone else) find out if this approach is
easy enough before considering adding a new keyword like :notangle:.
But if you (or someone else) come up with a patch implementing the
:notangle: approach, of course we might consider it too.

Thanks,

-- 
 Bastien

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

* Re: [babel] Commenting out src blocks for tangling
  2013-03-02 10:31                   ` Bastien
@ 2013-03-03  3:44                     ` Charles Berry
  2013-03-03  6:18                       ` Bastien
  0 siblings, 1 reply; 27+ messages in thread
From: Charles Berry @ 2013-03-03  3:44 UTC (permalink / raw)
  To: emacs-orgmode

Bastien <bzg <at> altern.org> writes:

> 
> Hi Rainer,
> 
> Rainer M Krug <r.m.krug <at> gmail.com> writes:
> 
> > Follow up: would it be possible to have the same mechanism for tangling,
i.e. a tag :notangle:?
> > functioning would be equivalent to property tangle: no but more visible and
consistent with the
> > :noexport:? One could also define properties to be tangled and not tangled
for different scenarios?
> 
> One approach could be to use export filters here.

Why not use the new exporter, rather than org-babel-tangle?

Below, there is a minimal backend called R-src-blocks that only exports
src-blocks for language "R" and the headline titles as comments. 

R-src-blocks backend is just an illustration - I don't intend that anyone
actually use it.

I guess I am suggesting that tangling is just exporting code; with full access
to all the export machinery (like exclude_tags and backend specific options), it
might be better to head toward backends that yield code than to elaborate
org-babel-tangle.

Chuck


#+BEGIN_SRC emacs-lisp
  (require 'ox-ascii)
  (defun comment-headline (headline contents info)
    (concat "### * " (org-element-property :raw-value headline) "\n\n" contents))
  
  (org-export-define-backend R-src-blocks
   ((src-block . (lambda (src-block contents info)
                   (and (string= (org-element-property :language src-block) "R") 
                        (car (org-export-unravel-code src-block)))))
    (section . org-ascii-section)
    (headline . comment-headline)))
  
#+END_SRC



> 
> I'd rather let (or someone else) find out if this approach is
> easy enough before considering adding a new keyword like :notangle:.
> But if you (or someone else) come up with a patch implementing the
> :notangle: approach, of course we might consider it too.
> 
> Thanks,
> 

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

* Re: [babel] Commenting out src blocks for tangling
  2013-03-03  3:44                     ` Charles Berry
@ 2013-03-03  6:18                       ` Bastien
  0 siblings, 0 replies; 27+ messages in thread
From: Bastien @ 2013-03-03  6:18 UTC (permalink / raw)
  To: Charles Berry; +Cc: emacs-orgmode

Hi Charles,

Charles Berry <ccberry@ucsd.edu> writes:

> Why not use the new exporter, rather than org-babel-tangle?

A very nice example on how the new exporter can be useful!

Thanks for sharing this,

-- 
 Bastien

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

* Re: [babel] Commenting out src blocks for tangling
  2013-02-28  9:25         ` Bastien
                             ` (3 preceding siblings ...)
  2013-02-28 19:45           ` Eric S Fraga
@ 2013-10-18 14:37           ` Alan Schmitt
  2013-10-18 16:43             ` Eric Schulte
  4 siblings, 1 reply; 27+ messages in thread
From: Alan Schmitt @ 2013-10-18 14:37 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode, Alan L Tyree, Rainer M Krug

Hello,

Sorry to resurrect this old thread, but I cannot make this work.

bzg@altern.org writes:

> Rainer M Krug <r.m.krug@gmail.com> writes:
>
>> I agree - COMMENTing a subtree should automatically disable tangling of code blocks in the
>> subtree. Would this something which could be introduced easily, as it seems there are quite a few
>> who assumed that it would be doing it?
>
> This is now the case in master:
> http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=8e0b45

I just tried it with my init file and it did not work. Here is a
minimal example. Save this as "test.org":

--8<---------------cut here---------------start------------->8---
* Testing

#+BEGIN_SRC emacs-lisp
(message "hello world")
#+END_SRC

* COMMENT Commenting

#+BEGIN_SRC emacs-lisp
(message "Salut le monde 2")
#+END_SRC
--8<---------------cut here---------------end--------------->8---

Then do a "M-x org-babel-load-file" giving "test.org" as file name.

If you look at *Messages*, or at the generated test.el, you will see the
second block has been tangled.

Am I missing something with this feature, or is this a bug? (I tried
with "emacs -Q" and loading a current org, and the same happens.)

Thanks,

Alan

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

* Re: [babel] Commenting out src blocks for tangling
  2013-10-18 14:37           ` Alan Schmitt
@ 2013-10-18 16:43             ` Eric Schulte
  2013-10-19  6:06               ` Alan Schmitt
  0 siblings, 1 reply; 27+ messages in thread
From: Eric Schulte @ 2013-10-18 16:43 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: Bastien, emacs-orgmode, Alan L Tyree, Rainer M Krug

Alan Schmitt <alan.schmitt@polytechnique.org> writes:

> Hello,
>
> Sorry to resurrect this old thread, but I cannot make this work.
>
> bzg@altern.org writes:
>
>> Rainer M Krug <r.m.krug@gmail.com> writes:
>>
>>> I agree - COMMENTing a subtree should automatically disable tangling of code blocks in the
>>> subtree. Would this something which could be introduced easily, as it seems there are quite a few
>>> who assumed that it would be doing it?
>>
>> This is now the case in master:
>> http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=8e0b45
>
> I just tried it with my init file and it did not work. Here is a
> minimal example. Save this as "test.org":
>
> --8<---------------cut here---------------start------------->8---
> * Testing
>
> #+BEGIN_SRC emacs-lisp
> (message "hello world")
> #+END_SRC
>
> * COMMENT Commenting
>
> #+BEGIN_SRC emacs-lisp
> (message "Salut le monde 2")
> #+END_SRC
> --8<---------------cut here---------------end--------------->8---
>
> Then do a "M-x org-babel-load-file" giving "test.org" as file name.
>
> If you look at *Messages*, or at the generated test.el, you will see the
> second block has been tangled.
>
> Am I missing something with this feature, or is this a bug? (I tried
> with "emacs -Q" and loading a current org, and the same happens.)
>

I can't reproduce, both manual tangling and tangling through
org-babel-load-file only tangle the first block for me.  Maybe you
aren't using a current version of Org-mode.

I'm on.

Org-mode version 8.2.1 (release_8.2.1-99-g2eef1b @ /home/eschulte/src/org-mode/lisp/)

Cheers,

>
> Thanks,
>
> Alan
>

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D

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

* Re: [babel] Commenting out src blocks for tangling
  2013-10-18 16:43             ` Eric Schulte
@ 2013-10-19  6:06               ` Alan Schmitt
  2013-10-19 21:56                 ` Eric Schulte
  0 siblings, 1 reply; 27+ messages in thread
From: Alan Schmitt @ 2013-10-19  6:06 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Bastien, emacs-orgmode, Alan L Tyree, Rainer M Krug

schulte.eric@gmail.com writes:

>> I just tried it with my init file and it did not work. Here is a
>> minimal example. Save this as "test.org":
>>
>> --8<---------------cut here---------------start------------->8---
>> * Testing
>>
>> #+BEGIN_SRC emacs-lisp
>> (message "hello world")
>> #+END_SRC
>>
>> * COMMENT Commenting
>>
>> #+BEGIN_SRC emacs-lisp
>> (message "Salut le monde 2")
>> #+END_SRC
>> --8<---------------cut here---------------end--------------->8---
>>
>> Then do a "M-x org-babel-load-file" giving "test.org" as file name.
>>
>> If you look at *Messages*, or at the generated test.el, you will see the
>> second block has been tangled.
>>
>> Am I missing something with this feature, or is this a bug? (I tried
>> with "emacs -Q" and loading a current org, and the same happens.)
>>
>
> I can't reproduce, both manual tangling and tangling through
> org-babel-load-file only tangle the first block for me.  Maybe you
> aren't using a current version of Org-mode.
>
> I'm on.
>
> Org-mode version 8.2.1 (release_8.2.1-99-g2eef1b @ /home/eschulte/src/org-mode/lisp/)

Thanks, my version was a couple weeks old and the current version does
work with this example. However I could not make it work with this
slightly bigger example:

--8<---------------cut here---------------start------------->8---
* Testing

#+BEGIN_SRC emacs-lisp
(message "hello world")
#+END_SRC

* COMMENT Commenting

#+BEGIN_SRC emacs-lisp
(message "Salut le monde 2")
#+END_SRC

** Testing sub tree

#+BEGIN_SRC emacs-lisp
(message "hello subtree")
#+END_SRC
--8<---------------cut here---------------end--------------->8---

I see that "hello subtree" is tangled. Does it mean that to comment a
whole tree I need to comment every subtree (recursively)?

Thanks,

Alan

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

* Re: [babel] Commenting out src blocks for tangling
  2013-10-19  6:06               ` Alan Schmitt
@ 2013-10-19 21:56                 ` Eric Schulte
  2013-10-20 17:05                   ` Alan Schmitt
  0 siblings, 1 reply; 27+ messages in thread
From: Eric Schulte @ 2013-10-19 21:56 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: Bastien, emacs-orgmode, Alan L Tyree, Rainer M Krug

Alan Schmitt <alan.schmitt@polytechnique.org> writes:

> schulte.eric@gmail.com writes:
>
>>> I just tried it with my init file and it did not work. Here is a
>>> minimal example. Save this as "test.org":
>>>
>>> --8<---------------cut here---------------start------------->8---
>>> * Testing
>>>
>>> #+BEGIN_SRC emacs-lisp
>>> (message "hello world")
>>> #+END_SRC
>>>
>>> * COMMENT Commenting
>>>
>>> #+BEGIN_SRC emacs-lisp
>>> (message "Salut le monde 2")
>>> #+END_SRC
>>> --8<---------------cut here---------------end--------------->8---
>>>
>>> Then do a "M-x org-babel-load-file" giving "test.org" as file name.
>>>
>>> If you look at *Messages*, or at the generated test.el, you will see the
>>> second block has been tangled.
>>>
>>> Am I missing something with this feature, or is this a bug? (I tried
>>> with "emacs -Q" and loading a current org, and the same happens.)
>>>
>>
>> I can't reproduce, both manual tangling and tangling through
>> org-babel-load-file only tangle the first block for me.  Maybe you
>> aren't using a current version of Org-mode.
>>
>> I'm on.
>>
>> Org-mode version 8.2.1 (release_8.2.1-99-g2eef1b @ /home/eschulte/src/org-mode/lisp/)
>
> Thanks, my version was a couple weeks old and the current version does
> work with this example. However I could not make it work with this
> slightly bigger example:
>
> --8<---------------cut here---------------start------------->8---
> * Testing
>
> #+BEGIN_SRC emacs-lisp
> (message "hello world")
> #+END_SRC
>
> * COMMENT Commenting
>
> #+BEGIN_SRC emacs-lisp
> (message "Salut le monde 2")
> #+END_SRC
>
> ** Testing sub tree
>
> #+BEGIN_SRC emacs-lisp
> (message "hello subtree")
> #+END_SRC
> --8<---------------cut here---------------end--------------->8---
>
> I see that "hello subtree" is tangled. Does it mean that to comment a
> whole tree I need to comment every subtree (recursively)?
>
> Thanks,
>
> Alan

I just pushed up a fix, thanks for catching this bug.

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D

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

* Re: [babel] Commenting out src blocks for tangling
  2013-10-19 21:56                 ` Eric Schulte
@ 2013-10-20 17:05                   ` Alan Schmitt
  2013-10-20 21:58                     ` Eric Schulte
  0 siblings, 1 reply; 27+ messages in thread
From: Alan Schmitt @ 2013-10-20 17:05 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Bastien, emacs-orgmode, Alan L Tyree, Rainer M Krug

Hi Eric,

schulte.eric@gmail.com writes:

>> I see that "hello subtree" is tangled. Does it mean that to comment a
>> whole tree I need to comment every subtree (recursively)?
>>
>> Thanks,
>>
>> Alan
>
> I just pushed up a fix, thanks for catching this bug.

I'm sorry, but I think there is a bug with the fix. When I tangle a
file, I get an error:

org-babel-under-commented-heading-p: Symbol's function definition is void: org-babel-under-commented-headline-p

I also see a failure with the tests:

1 unexpected results:
   FAILED  ob-tangle/continued-code-blocks-w-noweb-ref

I just did a git pull before trying this.

Alan

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

* Re: [babel] Commenting out src blocks for tangling
  2013-10-20 17:05                   ` Alan Schmitt
@ 2013-10-20 21:58                     ` Eric Schulte
  2013-10-21  6:49                       ` Alan Schmitt
  0 siblings, 1 reply; 27+ messages in thread
From: Eric Schulte @ 2013-10-20 21:58 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: Bastien, emacs-orgmode, Alan L Tyree, Rainer M Krug

Alan Schmitt <alan.schmitt@polytechnique.org> writes:

> Hi Eric,
>
> schulte.eric@gmail.com writes:
>
>>> I see that "hello subtree" is tangled. Does it mean that to comment a
>>> whole tree I need to comment every subtree (recursively)?
>>>
>>> Thanks,
>>>
>>> Alan
>>
>> I just pushed up a fix, thanks for catching this bug.
>
> I'm sorry, but I think there is a bug with the fix. When I tangle a
> file, I get an error:
>
> org-babel-under-commented-heading-p: Symbol's function definition is void: org-babel-under-commented-headline-p
>
> I also see a failure with the tests:
>
> 1 unexpected results:
>    FAILED  ob-tangle/continued-code-blocks-w-noweb-ref
>
> I just did a git pull before trying this.
>

This should be fixed now, thanks for pointing it out.

Best,

>
> Alan

-- 
Eric Schulte
https://cs.unm.edu/~eschulte
PGP: 0x614CA05D

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

* Re: [babel] Commenting out src blocks for tangling
  2013-10-20 21:58                     ` Eric Schulte
@ 2013-10-21  6:49                       ` Alan Schmitt
  0 siblings, 0 replies; 27+ messages in thread
From: Alan Schmitt @ 2013-10-21  6:49 UTC (permalink / raw)
  To: Eric Schulte; +Cc: Bastien, emacs-orgmode, Alan L Tyree, Rainer M Krug

schulte.eric@gmail.com writes:

> Alan Schmitt <alan.schmitt@polytechnique.org> writes:
>
>> Hi Eric,
>>
>> schulte.eric@gmail.com writes:
>>
>>>> I see that "hello subtree" is tangled. Does it mean that to comment a
>>>> whole tree I need to comment every subtree (recursively)?
>>>>
>>>> Thanks,
>>>>
>>>> Alan
>>>
>>> I just pushed up a fix, thanks for catching this bug.
>>
>> I'm sorry, but I think there is a bug with the fix. When I tangle a
>> file, I get an error:
>>
>> org-babel-under-commented-heading-p: Symbol's function definition is void: org-babel-under-commented-headline-p
>>
>> I also see a failure with the tests:
>>
>> 1 unexpected results:
>>    FAILED  ob-tangle/continued-code-blocks-w-noweb-ref
>>
>> I just did a git pull before trying this.
>>
>
> This should be fixed now, thanks for pointing it out.

It's working, thanks a lot!

Alan

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

end of thread, other threads:[~2013-10-21  6:49 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-27 17:53 [babel] Commenting out src blocks for tangling Eric S Fraga
2013-02-27 18:10 ` Aaron Ecay
2013-02-27 18:22   ` Eric S Fraga
2013-02-27 19:18 ` Alan L Tyree
2013-02-27 19:32   ` Eric S Fraga
2013-02-27 23:33     ` Darlan Cavalcante Moreira
2013-02-28  9:01       ` Rainer M Krug
2013-02-28  9:25         ` Bastien
2013-02-28  9:27           ` Rainer M Krug
2013-02-28  9:30           ` Sebastien Vauban
2013-02-28  9:42             ` Rainer M Krug
2013-02-28  9:47               ` Sebastien Vauban
2013-02-28 12:30                 ` Rainer M Krug
2013-03-02 10:31                   ` Bastien
2013-03-03  3:44                     ` Charles Berry
2013-03-03  6:18                       ` Bastien
2013-02-28  9:44             ` Bastien
2013-02-28  9:51           ` Rasmus
2013-02-28 10:05             ` Bastien
2013-02-28 19:45           ` Eric S Fraga
2013-10-18 14:37           ` Alan Schmitt
2013-10-18 16:43             ` Eric Schulte
2013-10-19  6:06               ` Alan Schmitt
2013-10-19 21:56                 ` Eric Schulte
2013-10-20 17:05                   ` Alan Schmitt
2013-10-20 21:58                     ` Eric Schulte
2013-10-21  6:49                       ` Alan Schmitt

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