emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-table: Reference *one* cell below a hline?
@ 2014-05-29  9:22 James Harkins
  2014-05-30 11:50 ` Bastien
  0 siblings, 1 reply; 5+ messages in thread
From: James Harkins @ 2014-05-29  9:22 UTC (permalink / raw)
  To: orgmode

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: org-table: Reference *one* cell below a hline?
  2014-05-29  9:22 org-table: Reference *one* cell below a hline? James Harkins
@ 2014-05-30 11:50 ` Bastien
  2014-06-05  3:18   ` James Harkins
  0 siblings, 1 reply; 5+ messages in thread
From: Bastien @ 2014-05-30 11:50 UTC (permalink / raw)
  To: James Harkins; +Cc: orgmode

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: org-table: Reference *one* cell below a hline?
  2014-05-30 11:50 ` Bastien
@ 2014-06-05  3:18   ` James Harkins
  2014-06-05 15:49     ` Nick Dokos
  0 siblings, 1 reply; 5+ messages in thread
From: James Harkins @ 2014-06-05  3:18 UTC (permalink / raw)
  To: Bastien; +Cc: orgmode

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: org-table: Reference *one* cell below a hline?
  2014-06-05  3:18   ` James Harkins
@ 2014-06-05 15:49     ` Nick Dokos
  2014-07-28  8:49       ` Bastien
  0 siblings, 1 reply; 5+ messages in thread
From: Nick Dokos @ 2014-06-05 15:49 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: org-table: Reference *one* cell below a hline?
  2014-06-05 15:49     ` Nick Dokos
@ 2014-07-28  8:49       ` Bastien
  0 siblings, 0 replies; 5+ messages in thread
From: Bastien @ 2014-07-28  8:49 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-07-28 17:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-29  9:22 org-table: Reference *one* cell below a hline? James Harkins
2014-05-30 11:50 ` Bastien
2014-06-05  3:18   ` James Harkins
2014-06-05 15:49     ` Nick Dokos
2014-07-28  8:49       ` Bastien

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).