ignoring a node without using sentinels

57 views
Skip to first unread message

Josef

unread,
Jun 12, 2019, 11:00:33 AM6/12/19
to leo-editor
I mostly work with @clean these days, as that gives me the least grief when working with others, who do not use Leo.
I often would like to ignore or at least comment out node including the subtree underneath, ideally by marking the node headline.

So far I only found a way by commenting out the body text using @ and @c.
Unfortunately, that is not visible in the outline, and it would be much better if I could see in the outline that the node has been ignored (or commented out).

With @file I can use @ignore, but this does not work with @shadow, because the content of the node gets lost. An @ignore under @clean generates an error. So there seems to be no way to ignore a node, without using sentinels - or is there?

If commenting out (from the headline) would work, that would be an acceptable compromise.

- Josef

Edward K. Ream

unread,
Jun 12, 2019, 11:37:06 AM6/12/19
to leo-editor
On Wed, Jun 12, 2019 at 10:00 AM Josef <joe...@gmx.net> wrote:
I mostly work with @clean these days, as that gives me the least grief when working with others, who do not use Leo.
I often would like to ignore or at least comment out node including the subtree underneath, ideally by marking the node headline.

In python, you can do this:

if False:
  @others

This effectively ignores all child nodes.

Edward

Josef

unread,
Jun 13, 2019, 5:07:02 AM6/13/19
to leo-editor
Cool trick, unfortunately I mostly share latex files with others.

I naïvely thought this would work:

@
@others
@c

Unfortunately this results in the "@others" in the comment and the children nodes are still included - not at all what I expected. I was hoping this would comment out all the children. I tried this with a .txt file.

- Josef


Edward K. Ream

unread,
Jun 13, 2019, 11:36:40 AM6/13/19
to leo-editor
On Thu, Jun 13, 2019 at 4:07 AM Josef <joe...@gmx.net> wrote:

> Cool trick, unfortunately I mostly share latex files with others.

Then you'll probably have to put code somewhere else.  @clean can't ignore nodes, and never will.

Edward

Edward K. Ream

unread,
Jun 13, 2019, 3:59:49 PM6/13/19
to leo-editor
On Thursday, June 13, 2019 at 4:07:02 AM UTC-5, Josef wrote:


Cool trick, unfortunately I mostly share latex files with others.

Aren't latex/tex macros pretty much another programming language?  Isn't there some way to define \ignore{whatever} ??

A quick google didn't turn anything up, but I only looked for a few moments...

Edward

Josef

unread,
Jun 13, 2019, 5:25:32 PM6/13/19
to leo-e...@googlegroups.com


On Thursday, June 13, 2019 at 9:59:49 PM UTC+2, Edward K. Ream wrote:

Aren't latex/tex macros pretty much another programming language?  Isn't there some way to define \ignore{whatever} ??
 

Yes that is possible and there are packages to help with commenting out some pieces of text with some dedicated commands. One can also define an environment that swallows its content.

Another way to do this would be to split out the part to be excluded into a separate file, then when needed including it with \input{filename}, or "commenting it out" by commenting out the \input statement.

All of these are within the text itself though, not automatically visible on the level of a node headline. Still it will work in the cases when I work with others, I just need to mark the headlines by hand. For the parts where I work alone I can always use @file and then @ignore will work fine.

Cheers - Josef
Reply all
Reply to author
Forward
0 new messages