From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: About commit named "Allow multi-line properties to be specified in property blocks" Date: Fri, 4 Nov 2011 09:02:43 +0100 Message-ID: References: <87vcr5c76e.fsf@gmail.com> <87vcr5j5a5.fsf@gmail.com> <4EAF118C.8050806@christianmoe.com> <87hb2mo7ek.fsf@altern.org> <87obwuh19t.fsf@gmail.com> <87hb2mdmi9.fsf@gnu.org> <87obwtgip9.fsf@gmail.com> <87sjm5ez0f.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=0016e64f81da3f957504b0e4212b Return-path: Received: from eggs.gnu.org ([140.186.70.92]:44963) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RMEjf-0001dG-1V for emacs-orgmode@gnu.org; Fri, 04 Nov 2011 04:02:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RMEjd-0007GE-4U for emacs-orgmode@gnu.org; Fri, 04 Nov 2011 04:02:47 -0400 Received: from mail-qy0-f176.google.com ([209.85.216.176]:42189) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RMEjc-0007G3-VH for emacs-orgmode@gnu.org; Fri, 04 Nov 2011 04:02:45 -0400 Received: by qyk29 with SMTP id 29so2542655qyk.0 for ; Fri, 04 Nov 2011 01:02:43 -0700 (PDT) In-Reply-To: <87sjm5ez0f.fsf@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eric Schulte Cc: Bastien , Org Mode List , Nicolas Goaziou , mail@christianmoe.com --0016e64f81da3f957504b0e4212b Content-Type: text/plain; charset=ISO-8859-1 On Thu, Nov 3, 2011 at 9:23 PM, Eric Schulte wrote: > One more idea that has occurred to me, it should give all of the > functionality which we desire (i.e., the ability for a property value to > span multiple lines and to be accumulated at the subtree level), and it > should require *no* new syntax. The only problem is it puts a > limitation on possible property names -- namely that they can not end > with the + character. > > The proposal is, when a property name ends in +, the value is appended > to the corresponding property, rather than replacing it, so > > #+PROPERTY: var foo=1 > #+PROPERTY: var bar=2 > > results in '(("var" . "bar=2")) > > #+PROPERTY: var foo=1 > #+PROPERTY: var+ , bar=2 > > results in '(("var" . "foo=1, bar=2")) > > This way subtree properties could be used as well, e.g., > > #+PROPERTY: var foo=1 > > * subtree > :PROPERTIES: > :var+: bar=2 > :CUSTOM_ID: something > :END: > > Just another thought. > I like that suggestion - it is clear, easy to understand, gives other advantages (you can "unset" variables in a subtree - which would be an added bonus) and does not require any large changes in org files. This suggestion would get my vote. Cheers, Rainer > Best -- Eric > > Eric Schulte writes: > > > I don't understand why the `org-accumulated-properties-alist' solution > > seems like a hack, could someone elaborate. To me that still feels like > > the most natural solution. > > > > more below... > > > >>>> 2) "Cumulative properties"? > >>>> > >>>> Here is a suggestion: use a syntaxe like > >>>> > >>>> #+var: foo 1 > >>> > >>> There is also "#+bind:", whose purpose is close enough. > >> > >> Indeed. Eric, would it be possible to use > >> > >> #+bind foo 1 > >> > >> instead of > >> > >> #+property var foo=1 > >> > > > > No, this would not for subtree-level properties, i.e., in a property > > block under a subtree there would be no way to tell if a property is a > > #+var:. I think if this were an approach, a more elegant solution would > > be for users to customize the `org-babel-default-header-args' variable > > using Emacs' file-local-variable feature -- which is possible now and > > may end up being the best solution. > > > >> > >>>> 3) Wrapping/folding long #+xxx lines? > >>>> > >>>> This is an independant request -- see Robert McIntyre's recent > >>>> question on the list. The problem is that fill-paragraph on > >>>> long #+xxx lines breaks the line into comment lines, which is > >>>> wrong. Filling like this: > >>>> > >>>> #+TBLFM: @3$1=@1$1+@2$1::@3$2=@1$2+@2$2::...::... > >>>> : @3$2=@1$2+@2$2::... > >>>> : @3$2=@1$2+@2$2::... > >>> > >>> #+tblfm: ... > >>> #+tblfm: ... > >>> #+tblfm: ... > >> > >> Not very elegant, but perhaps more efficient/consistent. > >> > > > > I like this solution, especially as I have often struggled with long and > > unreadable tblfm lines. The problem with using this for property lines > > would be in the case of > > > > #+property: foo bar > > #+property: baz qux > > > > whether the above should be parsed as > > > > '(("foo" . "bar") ("baz" . "qux")) > > > > or > > > > '(("foo" . "bar baz qux")) > > > >>>> But maybe generalizing the #+begin_xxx syntax for *all* #+xxx > >>>> keywords. This would make the current > >>>> org-internals-oriented/content-oriented difference between #+xxx > >>>> and #+begin_xxx obsolete > >>> > >>> I suggest to avoid such a thing. Here are a few, more or less valid, > >>> reasons: > >>> > >>> - That distinction is useful for the user (clear separation between > >>> contents and Org control). > >>> - It would penalize usage of special blocks. > >>> - The need is localized to very few keywords: it isn't worth the > added > >>> complexity. > >>> - It would be ugly: no more nice stacking of keywords, but a mix of > >>> blocks and keywords, and blocks on top of blocks... Org syntax may > >>> not be the prettiest ever, it doesn't deserve that. > >>> - It would be a real pain to parse. > >> > >> Well, I agree with most of the reasons. Glad you stated them clearly. > >> > > > > Yes, I agree some of the above are very motivating. > > > >> > >>>> but this would spare us the cost of new syntax. > >>> > >>> On the contrary, creating a block for each keyword would mean a lot of > >>> new syntax. > >>> > >>> We currently have 8 types of blocks (not counting dynamic blocks, whose > >>> syntax is a bit different), all requiring to be parsed differently: > >>> > >>> 1. Center blocks, > >>> 2. Comment blocks, > >>> 3. Example blocks, > >>> 4. Export blocks, > >>> 5. Quote blocks, > >>> 6. Special blocks, > >>> 7. Src blocks, > >>> 8. Verse blocks. > >> > >> I'm not sure what do you mean by "requiring to be parsed differently". > >> Can you explain it? I understand they should be treated differently by > >> the exporters, but I don't understand why they would need to be parsed > >> differently. > >> > > > > I also wouldn't think of this as new syntax, I don't see 8 rules for the > > 8 types above but rather one rule along the lines of #+begin_SOMETHING > > where the SOMETHING can be anything. > > > > Best -- Eric > > > >> > >> My idea was to avoid parsing both #+html and #+begin_html. And that > >> #+begin_xxx syntax is already available for folding, which is a feature > >> we might want for #+text and keywords like that. > >> > >> I would suggest this rule: #+begin_ is always for _content_ > >> while #+keyword is always for internals that are removed when > >> exporting. #+text, #+html, #+LaTeX are a few exception I can > >> think of. > >> > >> Best, > > -- > Eric Schulte > http://cs.unm.edu/~eschulte/ > > -- 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 (F): +33 - (0)9 58 10 27 44 Fax (D): +49 - (0)3 21 21 25 22 44 email: Rainer@krugs.de Skype: RMkrug --0016e64f81da3f957504b0e4212b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Thu, Nov 3, 2011 at 9:23 PM, Eric Sch= ulte <schult= e.eric@gmail.com> wrote:
One more idea that has occurred to me, it should give all of the
functionality which we desire (i.e., the ability for a property value to span multiple lines and to be accumulated at the subtree level), and it
should require *no* new syntax. =A0The only problem is it puts a
limitation on possible property names -- namely that they can not end
with the + character.

The proposal is, when a property name ends in +, the value is appended
to the corresponding property, rather than replacing it, so

=A0#+PROPERTY: var =A0 foo=3D1
=A0#+PROPERTY: var =A0 bar=3D2

results in '(("var" . "bar=3D2"))

=A0#+PROPERTY: var =A0 =A0foo=3D1
=A0#+PROPERTY: var+ , bar=3D2

results in '(("var" . "foo=3D1, bar=3D2"))

This way subtree properties could be used as well, e.g.,

=A0#+PROPERTY: var foo=3D1

=A0* subtree
=A0 =A0:PROPERTIES:
=A0 =A0:var+: bar=3D2
=A0 =A0:CUSTOM_ID: something
=A0 =A0:END:

Just another thought.

I like that suggestion - it = is clear, easy to understand, gives other advantages (you can "unset&q= uot; variables in a subtree - which would be an added bonus) and does not r= equire any large changes in org files.

This suggestion would get my vote.

Cheers,

Rainer

=


Best -- Eric

Eric Schulte <schulte.eric@gma= il.com> writes:

> I don't understand why the `org-accumulated-properties-alist' = solution
> seems like a hack, could someone elaborate. =A0To me that still feels = like
> the most natural solution.
>
> more below...
>
>>>> 2) "Cumulative properties"?
>>>>
>>>> =A0 =A0Here is a suggestion: use a syntaxe like
>>>>
>>>> =A0 =A0#+var: foo 1
>>>
>>> There is also "#+bind:", whose purpose is close enou= gh.
>>
>> Indeed. =A0Eric, would it be possible to use
>>
>> #+bind foo 1
>>
>> instead of
>>
>> #+property var foo=3D1
>>
>
> No, this would not for subtree-level properties, i.e., in a property > block under a subtree there would be no way to tell if a property is a=
> #+var:. =A0I think if this were an approach, a more elegant solution w= ould
> be for users to customize the `org-babel-default-header-args' vari= able
> using Emacs' file-local-variable feature -- which is possible now = and
> may end up being the best solution.
>
>>
>>>> 3) Wrapping/folding long #+xxx lines?
>>>>
>>>> =A0 =A0This is an independant request -- see Robert McInty= re's recent
>>>> =A0 =A0question on the list. =A0The problem is that fill-p= aragraph on
>>>> =A0 =A0long #+xxx lines breaks the line into comment lines= , which is
>>>> =A0 =A0wrong. =A0Filling like this:
>>>>
>>>> =A0 =A0#+TBLFM: @3$1=3D@1$1+@2$1::@3$2=3D@1$2+@2$2::...::.= ..
>>>> =A0 =A0 =A0 =A0 =A0 : @3$2=3D@1$2+@2$2::...
>>>> =A0 =A0 =A0 =A0 =A0 : @3$2=3D@1$2+@2$2::...
>>>
>>> #+tblfm: ...
>>> #+tblfm: ...
>>> #+tblfm: ...
>>
>> Not very elegant, but perhaps more efficient/consistent.
>>
>
> I like this solution, especially as I have often struggled with long a= nd
> unreadable tblfm lines. =A0The problem with using this for property li= nes
> would be in the case of
>
> #+property: foo bar
> #+property: baz qux
>
> whether the above should be parsed as
>
> =A0 '(("foo" . "bar") ("baz" . "= ;qux"))
>
> or
>
> =A0 '(("foo" . "bar baz qux"))
>
>>>> =A0 =A0But maybe generalizing the #+begin_xxx syntax for *= all* #+xxx
>>>> =A0 =A0keywords. =A0This would make the current
>>>> =A0 =A0org-internals-oriented/content-oriented difference = between #+xxx
>>>> =A0 =A0and #+begin_xxx obsolete
>>>
>>> I suggest to avoid such a thing. Here are a few, more or less = valid,
>>> reasons:
>>>
>>> =A0 - That distinction is useful for the user (clear separatio= n between
>>> =A0 =A0 contents and Org control).
>>> =A0 - It would penalize usage of special blocks.
>>> =A0 - The need is localized to very few keywords: it isn't= worth the added
>>> =A0 =A0 complexity.
>>> =A0 - It would be ugly: no more nice stacking of keywords, but= a mix of
>>> =A0 =A0 blocks and keywords, and blocks on top of blocks... Or= g syntax may
>>> =A0 =A0 not be the prettiest ever, it doesn't deserve that= .
>>> =A0 - It would be a real pain to parse.
>>
>> Well, I agree with most of the reasons. =A0Glad you stated them cl= early.
>>
>
> Yes, I agree some of the above are very motivating.
>
>>
>>>> =A0 =A0but this would spare us the cost of new syntax.
>>>
>>> On the contrary, creating a block for each keyword would mean = a lot of
>>> new syntax.
>>>
>>> We currently have 8 types of blocks (not counting dynamic bloc= ks, whose
>>> syntax is a bit different), all requiring to be parsed differe= ntly:
>>>
>>> =A0 1. Center blocks,
>>> =A0 2. Comment blocks,
>>> =A0 3. Example blocks,
>>> =A0 4. Export blocks,
>>> =A0 5. Quote blocks,
>>> =A0 6. Special blocks,
>>> =A0 7. Src blocks,
>>> =A0 8. Verse blocks.
>>
>> I'm not sure what do you mean by "requiring to be parsed = differently".
>> Can you explain it? =A0I understand they should be treated differe= ntly by
>> the exporters, but I don't understand why they would need to b= e parsed
>> differently.
>>
>
> I also wouldn't think of this as new syntax, I don't see 8 rul= es for the
> 8 types above but rather one rule along the lines of #+begin_SOMETHING=
> where the SOMETHING can be anything.
>
> Best -- Eric
>
>>
>> My idea was to avoid parsing both #+html and #+begin_html. =A0And = that
>> #+begin_xxx syntax is already available for folding, which is a fe= ature
>> we might want for #+text and keywords like that.
>>
>> I would suggest this rule: #+begin_ is always for _content_
>> while #+keyword is always for internals that are removed when
>> exporting. =A0#+text, #+html, #+LaTeX are a few exception I can >> think of.
>>
>> Best,

--
Eric Schulte
http://cs.unm.= edu/~eschulte/




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

Centre of Excellence for Invasion Biology
Stell= enbosch University
South Africa

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

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

email: =A0 =A0 = =A0Rainer@krugs.de=

Skype: =A0 =A0 =A0RMkrug

--0016e64f81da3f957504b0e4212b--