From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: About commit named "Allow multi-line properties to be specified in property blocks" Date: Tue, 01 Nov 2011 16:39:35 +0100 Message-ID: <871utrj1hk.fsf@gmail.com> References: <87vcr5c76e.fsf@gmail.com> <87vcr5j5a5.fsf@gmail.com> <8762j4evjl.fsf@gmail.com> <87k47kkfwp.fsf@gmail.com> <87y5w0ckt7.fsf@gmail.com> <87ty6ock7z.fsf@gmail.com> <87pqhbj4f3.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:40092) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLGSR-0001aD-Dz for emacs-orgmode@gnu.org; Tue, 01 Nov 2011 11:41:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RLGSP-0006Qh-Ta for emacs-orgmode@gnu.org; Tue, 01 Nov 2011 11:40:59 -0400 Received: from mail-ey0-f169.google.com ([209.85.215.169]:61827) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RLGSP-0006QZ-PC for emacs-orgmode@gnu.org; Tue, 01 Nov 2011 11:40:57 -0400 Received: by eye4 with SMTP id 4so6932162eye.0 for ; Tue, 01 Nov 2011 08:40:56 -0700 (PDT) In-Reply-To: <87pqhbj4f3.fsf@gmail.com> (Eric Schulte's message of "Tue, 01 Nov 2011 08:36:16 -0600") 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: Org Mode List Eric Schulte writes: > This was one of the proposed options to solve this problem, namely > introduce a list of properties whose value accumulates rather than is > replaced. Since the property list data structure only allows each key > to appear once, the accumulation would necessarily occur on the value > side, so assuming "var" is an accumulating property, then > > #+property: var foo=1 > #+property: var bar=2 > > would result in `org-file-properties' having the following value > > (("var" . "foo=1 bar=1")) > > Which with some changes in the code-block side code could be used by > code blocks to assign multiple variables. > > I went with changing property syntax rather than internal behavior > because I am not overly familiar with properties or the code with which > they were implemented and I felt (probably incorrectly) that this would > be a less dramatic change to Org-mode. I'm happy to work up a solution > along the lines suggested above, which would introduce a variable like > `org-accumulating-properties' or some-such which would default to only > holding the "var" property name That sounds way better to me. It's just a matter of modifying the following part in `org-set-regexps-and-options'. #+begin_src emacs-lisp ((equal key "PROPERTY") (when (string-match "\\(\\S-+\\)\\s-+\\(.*\\)" value) (push (cons (match-string 1 value) (match-string 2 value)) props))) #+end_src If we want to be a bit more future-proof on that side, we may even refine the `org-accumulating-properties' idea by making it an `org-accumulated-properties-alist' where key is property's name and value a symbol describing how they are accumulated. That symbol could be, for example `space', `comma', `newline', `consed'. Regards, -- Nicolas Goaziou