emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Eric Schulte <schulte.eric@gmail.com>
Cc: Org Mode List <emacs-orgmode@gnu.org>
Subject: Re: About commit named "Allow multi-line properties to be specified in property blocks"
Date: Tue, 01 Nov 2011 09:24:04 +0100	[thread overview]
Message-ID: <87y5w0ckt7.fsf@gmail.com> (raw)
In-Reply-To: <87k47kkfwp.fsf@gmail.com> (Eric Schulte's message of "Mon, 31 Oct 2011 15:30:30 -0600")

Hello,

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

> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>
>> Well, what about:
>>
>> #+property: :var foo=1
>> #+property: :var bar=2
>> #+property: :var baz=3
>> #+property: :var qux=4

> Unfortunately this won't work, the final value of the "var" property
> will be "qux=4" rather than "foo=1, bar=2, baz=3, qux=4".

I know that it won't work, as "#+begin_property" didn't work before you
introduced it. The idea is to make that work instead (with or without
the colons in front of "var").

> I would say that the block is defining an keyword, but yes, I suppose
> we've never had a multi-line keyword definition structure.

I differentiate keywords and blocks from their usage. As such, blocks
are not defining a keyword. They're not even in the same league.

> Along these lines I would also like to allow TBLFM lines to be broken
> over multiple lines, as I often find myself right-scrolling in a buffer
> to find equations in large spreadsheets.  I wonder if there would be a
> general solution to allow *all* #keyword+ lines to have a block
> equivalent.

The solution I implemented in my document on Org syntax is to create two
keyword's families: cumulative and dual.

Belonging to the first one means a keyword accumulates its values on
multiple calls instead of replacing them. That's how I parse
"#+headers:" or "#+attr_latex" lines, for example. The second one allows
the keyword to have a secondary, optional, value, in square brackets.
This is useful for keywords like "#+results:", which can include an hash
value like "#+results[hash-string]: keyword-value".

Typically, what is required here is to add "#+property:" to the
cumulative family. Thus,

#+property: var foo=1
#+property: var bar=2

is exactly the same as #+property: var foo=1 var bar=2.

Also, make sure var assignations accumulate too.

> I don't know how #+text: works, but with #+header: the order of the
> blocks is not important, i.e.,
>
> #+headers: :var a=1
> #+headers: :cache a=2
>
> is equal to
>
> #+headers: :cache a=2
> #+headers: :var a=1
>
> but the same is not true for
>
> #+PROPERTY:  var foo=1,
> #+PROPERTY+:     bar=2
>
> and
>
> #+PROPERTY+: bar=2
> #+PROPERTY:  var foo=1,

Because, again, "#+property+:" isn't a great idea. Here, "#+headers:"
accumulates its values. Make the same for "#+property:" and we're all
set.

>> It is desirable to have a logic behind syntax, and to always refer to
>> it. Thus, is is desirable to separate syntax used for contents from
>> syntax used for Org control. It's very different from "things on
>> a single line vs things on multiple lines".

> Sure, but to play devils (or my own) advocate, I would say that
> simplicity is important and "blocks for multi-line content" is a simpler
> rule than "blocks for formatting of multi-line content, and for naming
> multi-line data", the second being the case with code and example
> blocks.

What? Blocks do not name anything. In the case of code and example
blocks, you specify Org how to format/understand the contents, like any
other block. You use "#+name:" to name them.

Again, the rule is simple: blocks are directly related to contents,
keywords aren't. Corollary is: no block with only options and no
contents.

> My goal here is to find the most natural solution which conforms to
> Org-modes design as well as possible, I just don't know what that
> would be...

We share the same goal.


Regards,

-- 
Nicolas Goaziou

  reply	other threads:[~2011-11-01  8: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 [this message]
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
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=87y5w0ckt7.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --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).