I have this: | Section | Seconds | |----------+---------| | Theme | 54 | | 12/8 | 80 | | 6/8 | 66 | | Clarinet | 116 | | Oboe | 89 | | Bassoon | 60 | |----------+---------| | | | #+TBLFM: @II+1$2=vsum(@I$2..@II$2) After calculation (C-u C-u C-c *), I expected: | Section | Seconds | |----------+---------| | Theme | 54 | | 12/8 | 80 | | 6/8 | 66 | | Clarinet | 116 | | Oboe | 89 | | Bassoon | 60 | |----------+---------| | | 465 | #+TBLFM: @II+1$2=vsum(@I$2..@II$2) I got: | Section | Seconds | |----------+---------| | Theme | 54 | | 12/8 | 80 | | 6/8 | 66 | | Clarinet | 116 | | Oboe | 89 | | Bassoon | 60 | |----------+---------| | 465 | 465 | #+TBLFM: @II+1$2=vsum(@I$2..@II$2) That is, "@II+1$2" refers to the *entire row* beneath the second hline, rather than only the second column in that row. In other words, org-table discards the $2. That can't be right, can it? I'm going to add rows below "465," so I can't just use "@>$2." This table won't be public, so no big deal *in this case*. But I can imagine cases where this would be absolutely wrong behavior. hjh
Hi James,
James Harkins <jamshark70@gmail.com> writes:
> I have this:
>
> | Section | Seconds |
> |----------+---------|
> | Theme | 54 |
> | 12/8 | 80 |
> | 6/8 | 66 |
> | Clarinet | 116 |
> | Oboe | 89 |
> | Bassoon | 60 |
> |----------+---------|
> | | |
>
> #+TBLFM: @II+1$2=vsum(@I$2..@II$2)
>
> After calculation (C-u C-u C-c *), I expected:
When I run this from master, I get this user-error:
"Can't assign to hline relative reference"
which implies that hline relative references are not supported here.
Don't you get this error? What version of Org and Emacs are you running?
--
Bastien
On Friday, May 30, 2014 7:50:39 PM HKT, Bastien wrote:
> James Harkins <jamshark70@gmail.com> writes:
>> I have this:
>>
>> | Section | Seconds |
>> |----------+---------|
>> | Theme | 54 |
>> | 12/8 | 80 |
>> | 6/8 | 66 |
>> | Clarinet | 116 |
>> | Oboe | 89 |
>> | Bassoon | 60 |
>> |----------+---------|
>> | | |
>>
>> #+TBLFM: @II+1$2=vsum(@I$2..@II$2)
>
> When I run this from master, I get this user-error:
>
> "Can't assign to hline relative reference"
>
> which implies that hline relative references are not supported here.
> Don't you get this error? What version of Org and Emacs are you running?
Org-version says "Org-mode version 8.2.5f (release_8.2.5f-518-gd74205 @
/home/dlm/share/org-mode.git/lisp/)" -- the latest commit in my working
environment is af6f14d9. And, "This is GNU Emacs 23.3.1
(x86_64-pc-linux-gnu, GTK+ Version 2.24.10)."
If assigning to an hline-relative reference is not supported, would it be a
valid feature request?
hjh
James Harkins <jamshark70@gmail.com> writes:
> On Friday, May 30, 2014 7:50:39 PM HKT, Bastien wrote:
>> James Harkins <jamshark70@gmail.com> writes:
>>> I have this:
>>>
>>> | Section | Seconds |
>>> |----------+---------|
>>> | Theme | 54 |
>>> | 12/8 | 80 |
>>> | 6/8 | 66 |
>>> | Clarinet | 116 |
>>> | Oboe | 89 |
>>> | Bassoon | 60 |
>>> |----------+---------|
>>> | | |
>>>
>>> #+TBLFM: @II+1$2=vsum(@I$2..@II$2)
>>
>> When I run this from master, I get this user-error:
>>
>> "Can't assign to hline relative reference"
>>
>> which implies that hline relative references are not supported here.
>> Don't you get this error? What version of Org and Emacs are you
>> running?
>
> Org-version says "Org-mode version 8.2.5f (release_8.2.5f-518-gd74205
> @ /home/dlm/share/org-mode.git/lisp/)" -- the latest commit in my
> working environment is af6f14d9. And, "This is GNU Emacs 23.3.1
> (x86_64-pc-linux-gnu, GTK+ Version 2.24.10)."
>
> If assigning to an hline-relative reference is not supported, would it
> be a valid feature request?
>
Not sure how hard it would be to implement, but at least in this
particular case (getting to the last row or the last few rows of the
table), I'd recommend against using hlines as a reference: use @>, @>>,
etc. instead.
Do you have a need for an hline-relative reference somewhere in the
middle of a table?
Nick
Hi Nick and James,
Nick Dokos <ndokos@gmail.com> writes:
>> If assigning to an hline-relative reference is not supported, would it
>> be a valid feature request?
>
> Not sure how hard it would be to implement, but at least in this
> particular case (getting to the last row or the last few rows of the
> table), I'd recommend against using hlines as a reference: use @>, @>>,
> etc. instead.
Agreed,
--
Bastien