From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: [ANN] BREAKING CHANGE -- removing #+BABEL file-wide property lines Date: Mon, 24 Oct 2011 11:50:04 +0200 Message-ID: References: <87pqhrih3s.fsf@gmail.com> <30891.1319141196@alphaville.dokosmarshall.org> <87fwinifqu.fsf@gmail.com> <32184.1319143892@alphaville.dokosmarshall.org> <87zkgvgxe7.fsf@gmail.com> <1405.1319147324@alphaville.dokosmarshall.org> <87zkgvfhra.fsf@gmail.com> <2127.1319148505@alphaville.dokosmarshall.org> <87vcrjfgt1.fsf@gmail.com> <80sjmmvm60.fsf@somewhere.org> <4EA129DB.4070006@christianmoe.com> <8762ji5jr6.fsf@gmail.com> <87fwil10o2.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=0016369fa10ae3d1ef04b0085855 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:57319) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIHAW-0008Mn-2n for emacs-orgmode@gnu.org; Mon, 24 Oct 2011 05:50:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RIHAT-0003w8-Vx for emacs-orgmode@gnu.org; Mon, 24 Oct 2011 05:50:07 -0400 Received: from mail-qy0-f169.google.com ([209.85.216.169]:61471) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIHAT-0003vz-Sh for emacs-orgmode@gnu.org; Mon, 24 Oct 2011 05:50:05 -0400 Received: by qyk29 with SMTP id 29so1990234qyk.0 for ; Mon, 24 Oct 2011 02:50:05 -0700 (PDT) In-Reply-To: <87fwil10o2.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: Sebastien Vauban , emacs-orgmode@gnu.org, mail@christianmoe.com --0016369fa10ae3d1ef04b0085855 Content-Type: text/plain; charset=ISO-8859-1 On Sat, Oct 22, 2011 at 5:52 PM, Eric Schulte wrote: > > > > Just to add to it: at the moment I have e.g: > > > > #+BABEL: :var MAINVERSION=0 > > #+BABEL: :var SVNVERSION=(vc-working-revision (buffer-file-name)) > > #+BABEL: :var SVNSTATE=( symbol-name (vc-state (or (buffer-file-name) > org-current-export-file))) > > #+BABEL: :var SVNSTATENUM=(if (eq (vc-state (or (buffer-file-name) > org-current-export-file)) 'up-to-date) 0 13) > > #+BABEL: :var DISP_PACKAGE="seedDisp_0.4-13.tar.gz" > > > > which would look horrible in one line and a nightmare to edit. > > > > Any suggestions how this cold be changed? > > > > Hmm, I don't see any easy solution for the above. I'm sorry to have > removed this functionality. > > I can think of three options for how to handle this situation. > > 1. If it turns out to be possible/desirable my preferred solution here > would be to add general property support for appending values to > properties when properties are over specified rather than simply > replacing the value. Perhaps this could be done with a variable like > org-accumulating-properties which could hold a list of those > properties which should accumulate values rather than overwriting > them. > Should work, but will add an additional level of complexity which I think is avoidable. > > 2. Adding a "#+PROPERTY:" line authoring helper similar to the table > formula helper making it more natural to edit such long property > lines. > I think this might be to complicated > > 3. It may be possible to add syntax for extending #+PROPERTY: > specifications across multiple lines, something like > > #+PROPERTY: var MAINVERSION=0, > #+PROPERTY+: SVNVERSION=(vc-working-revision (buffer-file-name)), > #+PROPERTY+: SVNSTATE=( symbol-name (vc-state (or (buffer-file-name) > org-current-export-file))), > #+PROPERTY+: SVNSTATENUM=(if (eq (vc-state (or (buffer-file-name) > org-current-export-file)) 'up-to-date) 0 13), > #+PROPERTY+: DISP_PACKAGE="seedDisp_0.4-13.tar.gz" > > FWIW I would like to have a similar extender for #+TBLFM: lines. > Actually this choice may be my preferred solution. > I like that suggestion - This would add an option, if inheritance for subtrees is incorporated for #+PROPERTY to unset all variables - something I was looking for some time ago. So I really like that solution: logical, clear, does not break anything, and easy to read - I would say go for it. > > What do you think? > > > > > In addition: I would like to have a warning if #+BABEL is present in the > org > > file, so that one remembers that it has to be changed. > > > > #+begin_src emacs-lisp > (add-hook 'org-mode-hook > (lambda () > (save-excursion > (goto-char (point-min)) > (when (re-search-forward (org-make-options-regexp > '("BABEL"))) > (message "This file contains a \"#+BABEL:\" line."))))) > #+end_src > Could this be included in the next few versions of org, as I can imnagine that especially infrequent org-babel users will be confused. Also: in a year, when I open an old org-file and it des not work, this would warn me about the necessary modifications. Cheers, Rainer > > Cheers -- Eric > > -- > 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 --0016369fa10ae3d1ef04b0085855 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Sat, Oct 22, 2011 at 5:52 PM, Eric Sc= hulte <schul= te.eric@gmail.com> wrote:
>
> Just to add to it: at the moment I have e.g:
>
> #+BABEL: :var MAINVERSION=3D0
> #+BABEL: :var SVNVERSION=3D(vc-working-revision (buffer-file-name)) > #+BABEL: :var SVNSTATE=3D( symbol-name (vc-state (or (buffer-file-name= ) org-current-export-file)))
> #+BABEL: :var SVNSTATENUM=3D(if (eq (vc-state (or (buffer-file-name) o= rg-current-export-file)) 'up-to-date) 0 13)
> #+BABEL: :var DISP_PACKAGE=3D"seedDisp_0.4-13.tar.gz"
>
> which would look horrible in one line and a nightmare to edit.
>
> Any suggestions how this cold be changed?
>

Hmm, I don't see any easy solution for the above. =A0I'm sorr= y to have
removed this functionality.

I can think of three options for how to handle this situation.

1. If it turns out to be possible/desirable my preferred solution here
=A0 would be to add general property support for appending values to
=A0 properties when properties are over specified rather than simply
=A0 replacing the value. =A0Perhaps this could be done with a variable lik= e
=A0 org-accumulating-properties which could hold a list of those
=A0 properties which should accumulate values rather than overwriting
=A0 them.

Should work, but will add an additional= level of complexity which I think is avoidable.
=A0

2. Adding a "#+PROPERTY:" line authoring helper similar to the ta= ble
=A0 formula helper making it more natural to edit such long property
=A0 lines.

I think this might be to complicated=A0

3. It may be possible to add syntax for extending #+PROPERTY:
=A0 specifications across multiple lines, something like

=A0 #+PROPERTY: =A0var MAINVERSION=3D0,
=A0 #+PROPERTY+: SVNVERSION=3D(vc-working-revision (buffer-file-name)), =A0 #+PROPERTY+: SVNSTATE=3D( symbol-name (vc-state (or (buffer-file-name)= org-current-export-file))),
=A0 #+PROPERTY+: SVNSTATENUM=3D(if (eq (vc-state (or (buffer-file-name) or= g-current-export-file)) 'up-to-date) 0 13),
=A0 #+PROPERTY+: DISP_PACKAGE=3D"seedDisp_0.4-13.tar.gz"

=A0 FWIW I would like to have a similar extender for #+TBLFM: lines.
=A0 Actually this choice may be my preferred solution.

I like that suggestion - This would add an option, if inheritance for= subtrees is incorporated for #+PROPERTY to unset all variables - something= I was looking for some time ago.

So I really like that solution: logical, clear, does not break anything= , and easy to read - I would say go for it.

What do you think?

>
> In addition: I would like to have a warning if #+BABEL is present in t= he org
> file, so that one remembers that it has to be changed.
>

#+begin_src emacs-lisp
=A0(add-hook 'org-mode-hook
=A0 =A0 =A0 =A0 =A0 =A0(lambda ()
=A0 =A0 =A0 =A0 =A0 =A0 =A0(save-excursion
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(goto-char (point-min))
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(when (re-search-forward (org-make-options-= regexp '("BABEL")))
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(message "This file contains a \&q= uot;#+BABEL:\" line.")))))
#+end_src

Could this be included in the next few v= ersions of org, as I can imnagine that especially infrequent org-babel user= s will be confused. Also: in a year, when I open an old org-file and it des= not work, this would warn me about the necessary modifications.


Cheers,

Rainer
=A0

Cheers -- Eric

--
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

--0016369fa10ae3d1ef04b0085855--