emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Dan Davison <dandavison7@gmail.com>
To: Eric Schulte <schulte.eric@gmail.com>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>,
	Rainer M Krug <r.m.krug@gmail.com>
Subject: Re: [BABEL] "unset" :var definitions for subtree
Date: Sun, 13 Feb 2011 01:38:01 +0000	[thread overview]
Message-ID: <m1vd0osohy.fsf@94.197.159.103.threembb.co.uk> (raw)
In-Reply-To: <87zkq03ky3.fsf@gmail.com> (Eric Schulte's message of "Sat, 12 Feb 2011 16:13:11 -0700")

"Eric Schulte" <schulte.eric@gmail.com> writes:

> [...]
>>
>> I agree, the things I was talking about don't end up being simpler in
>> terms of usage for this case. My thinking was that variable unsetting
>> might be something that would be required fairly rarely, and so it might
>> be worth appropriate to support it as part of a more general/powerful
>> mechanism tied into Org properties, or even that hook.
>>
>
> It does sound like if there were a way to disable inheritance for
> certain properties for certain sub-trees of a document, then that would
> be ideal -- although I can't imagine how such functionality would be
> implemented.  Can we think of an Org-wide syntax for disinheriting
> specific properties?

I'm not sure whether or how this fits it, but it's worth noting that Org
currently documents the following

,----
| org-entry-get-with-inheritance is a Lisp function in `org.el'.
| 
| (org-entry-get-with-inheritance PROPERTY &optional LITERAL-NIL)
| 
| Get entry property, and search higher levels if not present.
| The search will stop at the first ancestor which has the property defined.
| If the value found is "nil", return nil to show that the property
| should be considered as undefined (this is the meaning of nil here).
| However, if LITERAL-NIL is set, return the string value "nil" instead.
`----

so that seems to suggest ":var nil" as a way of knocking out all :var
assignments, but doesn't immediately suggest how to knock out on a
per-variable basis. :var a=nil ? (Which otherwise would look for a src
block named "nil")

>> Before we proceed with the variable unsetting, could someone provide a
>> motivating example, just to convince ourselves that the extra features
>> are justified? (The conclusion of another message was that the torque
>> script example was more a motivating example for shebang/preamble
>> processing than for variable unsetting.)
>>
>
> Certainly.
>
> 1. taking Rainer's first example, lets say that you want a variable
>    specified for all but one code block in a file (maybe that one code
>    block is the source of the value of the variable).  In this case it
>    would be much simpler to specify the variable file-wide, and then
>    unset the variable for that one code block.

Agreed. It's not clean, but currently in this situation one could just
set the offending variable to some other value.

> 2. say you want the same session for /nearly/ every code block in a
>    file.
> 3. same for :dir, :file, or :shebang...

I'd just note that some of these already have natural values that can be
used to "unset"

:session none
:dir .
:shebang ""

:file <not sure about this one, but maybe "none" should be used...>

Dan

>
>
> So, in summary, I am all for a general org-mode wide solution for
> disinheriting specific properties, however, if we are unable to find
> such a solution then I would lean towards implementing this for Babel
> specifically.
>
> Best -- Eric
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  reply	other threads:[~2011-02-13  1:38 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-07 15:12 [BABEL] "unset" :var definitions for subtree Rainer M Krug
2011-02-10  1:27 ` Eric Schulte
2011-02-10  8:33   ` Rainer M Krug
2011-02-10 16:48     ` Eric Schulte
2011-02-11  9:00       ` Rainer M Krug
2011-02-11  9:32         ` Dan Davison
2011-02-11 10:22           ` Rainer M Krug
2011-02-11 11:55             ` Dan Davison
2011-02-11 12:29               ` Rainer M Krug
2011-02-11 13:49                 ` Dan Davison
2011-02-11 13:56                   ` Rainer M Krug
2011-02-12 22:54                   ` Eric Schulte
2011-02-11 12:19       ` Dan Davison
2011-02-11 12:58         ` Rainer M Krug
2011-02-11 13:41           ` Dan Davison
2011-02-11 14:05             ` Rainer M Krug
2011-02-12 23:12               ` Eric Schulte
2011-02-13  1:21                 ` Dan Davison
2011-02-13 18:28                   ` Eric Schulte
2011-02-13 21:38                     ` Dan Davison
2011-02-14 19:22                       ` Eric Schulte
2011-02-11 14:16         ` Eric Schulte
2011-02-11 14:45           ` Dan Davison
2011-02-12 23:13             ` Eric Schulte
2011-02-13  1:38               ` Dan Davison [this message]
2011-02-13 18:33                 ` Eric Schulte

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1vd0osohy.fsf@94.197.159.103.threembb.co.uk \
    --to=dandavison7@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=r.m.krug@gmail.com \
    --cc=schulte.eric@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).