From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rick Frankel Subject: Re: [BUG] hline references on left side of table formula Date: Thu, 07 Nov 2013 10:01:30 -0500 Message-ID: <602c49099197cd263ad53ad5d0e97ac8@mail.rickster.com> References: <2027056056.183911380605538292.JavaMail.www@wwinf7113> <874n7pgawr.fsf@bzg.ath.cx> <39f042b047fcc17e87f5ceb8ebd3e038@mail.rickster.com> <87ob5xtiae.fsf@Rainer.invalid> <87habpthiu.fsf@Rainer.invalid> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=_a297490e878ec8a3d758bc652c73e951" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48767) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VeR5Y-00043N-5l for emacs-orgmode@gnu.org; Thu, 07 Nov 2013 10:01:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VeR5O-0008Jd-Se for emacs-orgmode@gnu.org; Thu, 07 Nov 2013 10:01:40 -0500 Received: from [204.62.15.78] (port=43008 helo=mail.rickster.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VeR5O-0008JH-PG for emacs-orgmode@gnu.org; Thu, 07 Nov 2013 10:01:30 -0500 In-Reply-To: <87habpthiu.fsf@Rainer.invalid> 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: emacs-orgmode@gnu.org --=_a297490e878ec8a3d758bc652c73e951 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=UTF-8; format=flowed On 2013-11-06 15:14, Achim Gratz wrote: > Achim Gratz writes: > [...] > with these formulas: > #+TBLFM: $=vsum(@-II..@-I) > > whoops, press C-c C-c in the wrong buffer. > > I meant these formulas: > > #+TBLFM: @$=vsum(@-II..@-I) > #+TBLFM: @II=vsum(@-II..@-I) > #+TBLFM: @III=vsum(@-II..@-I) > #+TBLFM: @IIII=vsum(@-II..@-I) > #+TBLFM: @II..$2=vsum(@-II..@-I) > #+TBLFM: @III..$2=vsum(@-II..@-I) > #+TBLFM: @IIII..$2=vsum(@-II..@-I) > #+TBLFM: @II+1..@II$2=vsum(@-II..@-I) > #+TBLFM: @II$2..@II+1$2=vsum(@-II..@-I) > > Some of the results are useful when your table has a certain, even > though in general this does the wrong thing as Carsten said. I'm not > really having an opinion on whether this should be an error (as your > previous patch does, which should then add a correction to the test > that > is now failing) or if some / all of this should stay allowed until > somebody musters the time to fix it properly (I think this would amount > to re-implementing a good part of what is org-table). Ok, i see what's happening in your examples (a testing org file attached), though i question the usefullness of most of the results ;). The updated patch attached to the previous email (fixed as pointed out by michael): --- a/lisp/org-table.el +++ b/lisp/org-table.el @@ -3016,8 +3016,9 @@ known that the table will be realigned a little later anyway." ;; Insert constants in all formulas (setq eqlist (mapcar (lambda (x) - (if (string-match "^@-?I+" (car x)) - (user-error "Can't assign to hline relative reference")) + (if (and (string-match "^@-?I+" (car x)) + (not (string-match "\\.\\.@" (car x)))) + (user-error "Can't assign to hline relative reference without a range specification.")) (when (string-match "\\`$[<>]" (car x)) (setq lhs1 (car x)) (setq x (cons (substring Both fixes the testing issue and allows what seems to me to be the most relevant use-case. I have no real position on whether the best solution is to back out the change, or modify it as above to make the test pass and allow the logical usecase. If the first, I think it would be useful for the documentation to (somehow) explain what happens if an explicit column specificaton is made without a corresponding range. Please chime in on which patch should be applied. rick --=_a297490e878ec8a3d758bc652c73e951 Content-Transfer-Encoding: base64 Content-Type: text/plain; name=tblref.org Content-Disposition: attachment; filename=tblref.org; size=3758 KiBDb2RlCjpQUk9QRVJUSUVTOgo6ZXZhbDogICAgIG5ldmVyCjpFTkQ6CiMrbmFtZTogdGFibGUK IytCRUdJTl9TUkMgZW1hY3MtbGlzcCA6cmVzdWx0cyBzaWxlbnQgOmV2YWwgeWVzCiJ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dnN1bShALUlJLi5ALUkpIgogICAgICAgICAiIytUQkxG TTogQElJJDIuLkBJSSsxJDI9dnN1bShALUlJLi5ALUkpIikgIlxuIikKIytFTkRfU1JDCgoqIEV2 YWwgbWUhICg9XEMtY1xDLXZcQy1zPSkKOlBST1BFUlRJRVM6CjpJRDogRVZBTC1NRQo6RU5EOgoj K25hbWU6IGNhbGwtZ2VuZXJhdGUKIytjYWxsOiBnZW5lcmF0ZS10YWJsZXNbOmV2YWwgeWVzXSh0 YWJsZT10YWJsZSkgOnJlc3VsdHMgd3JhcAojK2NhbGw6IGV4cGFuZC10YWJsZXNbOmV2YWwgeWVz XSgpIDpyZXN1bHRzIHNpbGVudAoKIytSRVNVTFRTOiBjYWxsLWdlbmVyYXRlCjpSRVNVTFRTOgoq KiBAJD12c3VtKEAtSUkuLkAtSSkKfCBhICAgICB8IGIgfAp8LS0tLS0tLSstLS18CnwgdyAgICAg fCAxIHwKfCB4ICAgICB8IDIgfAp8LS0tLS0tLSstLS18CnwgICAgICAgfCAgIHwKfCAgICAgICB8 ICAgfAp8LS0tLS0tLSstLS18CnwgeSAgICAgfCAzIHwKfCB6ICAgICB8IDQgfAp8LS0tLS0tLSst LS18CnwgeSArIHogfCAgIHwKIytUQkxGTTogQCQ9dnN1bShALUlJLi5ALUkpCioqIEBJST12c3Vt KEAtSUkuLkAtSSkKfCBhICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IGIgfAp8LS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSstLS18CnwgdyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgfCAxIHwKfCB4ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IDIgfAp8LS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSstLS18CnwgdyArIHggICAgICAgICAgICAgICAgICAg ICAgICAgfCAgIHwKfCB3ICsgeCAgICAgICAgICAgICAgICAgICAgICAgICB8ICAgfAp8LS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSstLS18CnwgdyArIHggKyB3ICsgeCAgICAgICAgICAg ICAgICAgfCAzIHwKfCB3ICsgeCArIHcgKyB4ICAgICAgICAgICAgICAgICB8IDQgfAp8LS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSstLS18CnwgdyArIHggKyB3ICsgeCArIHcgKyB4ICsg dyArIHggfCAgIHwKIytUQkxGTTogQElJPXZzdW0oQC1JSS4uQC1JKQoqKiBASUlJPXZzdW0oQC1J SS4uQC1JKQp8IGEgfCBiIHwKfC0tLSstLS18CnwgdyB8IDEgfAp8IHggfCAyIHwKfC0tLSstLS18 CnwgICB8ICAgfAp8ICAgfCAgIHwKfC0tLSstLS18CnwgMCB8IDMgfAp8IDAgfCA0IHwKfC0tLSst LS18CnwgMCB8ICAgfAojK1RCTEZNOiBASUlJPXZzdW0oQC1JSS4uQC1JKQoqKiBASUlJST12c3Vt KEAtSUkuLkAtSSkKfCBhICAgICB8IGIgfAp8LS0tLS0tLSstLS18CnwgdyAgICAgfCAxIHwKfCB4 ICAgICB8IDIgfAp8LS0tLS0tLSstLS18CnwgICAgICAgfCAgIHwKfCAgICAgICB8ICAgfAp8LS0t LS0tLSstLS18CnwgeSAgICAgfCAzIHwKfCB6ICAgICB8IDQgfAp8LS0tLS0tLSstLS18CnwgeSAr IHogfCAgIHwKIytUQkxGTTogQElJSUk9dnN1bShALUlJLi5ALUkpCioqIEBJSS4uJDI9dnN1bShA LUlJLi5ALUkpCnwgYSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgYiB8CnwtLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKy0tLS18CnwgdyAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgfCAgMSB8CnwgeCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfCAgMiB8CnwtLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tKy0tLS18CnwgdyArIHggICAgICAgIC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