emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <schulte.eric@gmail.com>
To: Darlan Cavalcante Moreira <darcamo@gmail.com>
Cc: mail@christianmoe.com, Nicolas Goaziou <n.goaziou@gmail.com>,
	Org Mode List <emacs-orgmode@gnu.org>, Bastien <bzg@altern.org>
Subject: Re: About commit named "Allow multi-line properties to be specified in property blocks"
Date: Fri, 04 Nov 2011 13:25:09 -0600	[thread overview]
Message-ID: <877h3felm2.fsf@gmail.com> (raw)
In-Reply-To: <4eb42564.059dec0a.5ffc.7ff5@mx.google.com> (Darlan Cavalcante Moreira's message of "Fri, 04 Nov 2011 14:48:09 -0300")

Darlan Cavalcante Moreira <darcamo@gmail.com> writes:

> I liked this suggestion. In a sense, it is similar to the "inherit" keyword
> I had suggested before, but now the "keyword" (the plus sign) is part of
> the variable name. 
>

Oh yes, I didn't realize that when I first posted this suggestion but it
is very similar to your suggested "inherit" keyword,

>
> But the reason I really liked it is because it is clear to
> understand. One can compare it to the "+=" operator some languages
> have. That is, we can understand `:var: bar=2` as var="bar=2" and
> `:var+: bar=2` as var+="bar=2".`
>

Agreed, it was the limitation of possible values which I didn't like
about your "inherit" suggestion, but this approach switches the
limitation to the property name rather than the property value which is
somehow more appealing.

Cheers -- Eric

>
> --
> Darlan
>
> At Fri, 4 Nov 2011 09:02:43 +0100, Rainer M Krug <r.m.krug@gmail.com>
> wrote:
>> 
>> On Thu, Nov 3, 2011 at 9:23 PM, Eric Schulte <schulte.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.  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 <schulte.eric@gmail.com> 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

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

  reply	other threads:[~2011-11-04 19:25 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-31 19:06 About commit named "Allow multi-line properties to be specified in property blocks" Nicolas Goaziou
2011-10-31 20:05 ` Eric Schulte
2011-10-31 20:49   ` Nicolas Goaziou
2011-10-31 21:30     ` Eric Schulte
2011-11-01  8:24       ` Nicolas Goaziou
2011-11-01  8:36         ` Nicolas Goaziou
2011-11-01 14:36           ` Eric Schulte
2011-11-01 15:39             ` Nicolas Goaziou
2011-11-01 16:58               ` Eric Schulte
2011-11-01 17:48                 ` Christian Moe
2011-11-01 19:02                   ` Eric Schulte
2011-11-01 19:45                     ` Christian Moe
2011-11-01 20:22                       ` Eric Schulte
2011-10-31 21:33     ` Christian Moe
2011-10-31 21:22   ` Christian Moe
2011-10-31 21:36     ` Eric Schulte
2011-11-01  7:33       ` Christian Moe
2011-11-02 15:35     ` Bastien
2011-11-02 17:39       ` Nicolas Goaziou
2011-11-03  1:26         ` Bastien
2011-11-03  8:08           ` Christian Moe
2011-11-03 15:10             ` Nick Dokos
2011-11-03 18:32           ` Eric Schulte
2011-11-03 20:01             ` Nicolas Goaziou
2011-11-03 20:18               ` Eric Schulte
2011-11-03 20:23             ` Eric Schulte
2011-11-04  8:02               ` Rainer M Krug
2011-11-04 17:48                 ` Darlan Cavalcante Moreira
2011-11-04 19:25                   ` Eric Schulte [this message]
2011-11-07 22:09                     ` Eric Schulte
2011-11-08  8:42                       ` Rainer M Krug
2011-11-08  9:31                       ` Sebastien Vauban
2011-11-08  9:41                         ` Rainer M Krug
2011-11-08  9:58                           ` Sebastien Vauban
2011-11-08 10:06                             ` Rainer M Krug
2011-11-08 14:42                               ` Darlan Cavalcante Moreira
2011-11-08 15:06                                 ` Sebastien Vauban
2011-11-08 16:03                               ` Eric Schulte
2011-11-08 22:53                                 ` Eric Schulte
2011-11-09  8:25                                   ` Rainer M Krug
2011-11-09 16:12                                     ` Eric Schulte
2011-11-09 17:18                                       ` Rainer M Krug
2011-11-09 22:31                                       ` Sebastien Vauban
2011-11-15 12:33                                         ` Rainer M Krug
2011-11-15 16:00                                           ` Eric Schulte
2011-11-15 16:37                                             ` Torsten Wagner
2011-11-15 16:56                                               ` Eric Schulte
2011-11-15 17:13                                                 ` Thomas S. Dye
2011-11-15 18:22                                                   ` Eric Schulte
2011-11-15 17:24                                             ` Rainer M Krug
2011-11-08  9:41                 ` Sebastien Vauban
2011-11-08  9:44                   ` Rainer M Krug
2011-11-08 16:01                     ` Eric Schulte
2011-11-02 21:05 ` Samuel Wales
2011-11-02 21:21   ` Samuel Wales
2011-11-03  1:42   ` Bastien
2011-11-03  8:19     ` Christian Moe
2011-11-03 18:34     ` Eric Schulte
2011-11-03 18:59       ` Eric Schulte
2011-11-09 17:40       ` Samuel Wales

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=877h3felm2.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=bzg@altern.org \
    --cc=darcamo@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mail@christianmoe.com \
    --cc=n.goaziou@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).