From mboxrd@z Thu Jan 1 00:00:00 1970 From: lompik@voila.fr Subject: Re: [BUG] hline references on left side of table formula Date: Tue, 1 Oct 2013 07:32:18 +0200 (CEST) Message-ID: <2027056056.183911380605538292.JavaMail.www@wwinf7113> Reply-To: lompik@voila.fr Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48597) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQsZO-0002JA-Fi for emacs-orgmode@gnu.org; Tue, 01 Oct 2013 01:32:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VQsZI-0004LX-P8 for emacs-orgmode@gnu.org; Tue, 01 Oct 2013 01:32:26 -0400 Received: from smtpout1.voila.fr ([193.252.22.125]:51677 helo=smtpout.voila.fr) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VQsZI-0004LK-FS for emacs-orgmode@gnu.org; Tue, 01 Oct 2013 01:32:20 -0400 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 Hi, I was interested to use hline references on the left side. However I found = out that it is not completely unsupported. When the left side consist of: * single cells references, it does not work * ranged cells, it works for me (org 8.0.3) The patch below tranforms the single cell references to ranged cells . However it still does not work for references like @+ or @- I$1.. , which c= an be solve=20 using references like @I+1#1. Thanks, *** a/org-table.el Sat Jun 29 16:20:30 2013 --- b/org-table.el Tue Oct 1 00:23:35 2013 *************** *** 3227,3232 **** --- 3227,3236 ---- (put-text-property 0 (length (caar res)) :orig-eqn e (caar res)))) (t + ;; if contains hline-reference and refers to fixed cell..make it range + (if (string-match "^@[+-]?I*[^.]*$" lhs ) + (setq lhs (format "%s..%s" lhs lhs ))) +=20 (setq range (org-table-get-range lhs org-table-current-begin-pos 1 nil 'corners)) (setq r1 (nth 0 range) c1 (nth 1 range) However, fields like @-I or @+II=20 >=20 > Hi Rick, >=20 > hline-relative references on the left side of a table are currently not= =20 > supported. The fact that this is expanded is a bug. A patch catching this= =20 > case would be very welcome. >=20 > Regards >=20 > - Carsten >=20 > On May 1, 2013, at 7:27 PM, Rick Frankel wrote: >=20 > > Hi- > >=20 > > I don't know if this is a bug or feature :), but if an hline reference > > (@I, etc) is used on the left side of a calculation, it applies to ALL > > columns in the row even if the column is specfied. > >=20 > > Here are some examples to show the results. I would expect all three > > versions to generate the same results as the first example. > >=20 > > #+BEGIN_ORG > > * Absolute reference (expected results) > > | a | b | > > |---+---| > > | x | 1 | > > | y | 2 | > > |---+---| > > | | 3 | > > #+TBLFM: @4$2=3Dvsum(@address@hidden) > >=20 > > * hline reference > > | a | b | > > |-------+---| > > | x | 1 | > > | y | 2 | > > |-------+---| > > | x + y | 3 | > > #+TBLFM: @II$2=3Dvsum(@address@hidden) > >=20 > > * hline reference with full cell specification in sum > > | a | b | > > |---+---| > > | x | 1 | > > | y | 2 | > > |---+---| > > | 3 | 3 | > > #+TBLFM: @II$2=3Dvsum(@address@hidden) > > #+END_ORG > >=20 > > FWIW, I believe the problem is that `org-table-recalculate' is > > matching lhs cell references explicitly against pure numeric > > references ("@[0-9]+$[0-9]+") and therefore expands the lhs via > > `org-expand-lhs-ranges' instead of expanding it with > > `org-table-get-descriptor-line' > >=20 > > rick > >=20 > >=20 ___________________________________________________________ Qu'y a-t-il ce soir =C3=A0 la t=C3=A9l=C3=A9 ? D'un coup d'=C5=93il, visual= isez le programme sur Voila.fr http://tv.voila.fr/programmes/chaines-tnt/ce= -soir.html