all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* reference to same row in spreadsheet
@ 2008-12-18 15:01 Stephan Schmitt
  2008-12-18 16:25 ` Carsten Dominik
  0 siblings, 1 reply; 6+ messages in thread
From: Stephan Schmitt @ 2008-12-18 15:01 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

the reference to the last row @0 led to incompatible changes:

* spreadsheet: relative reference to same row
  (using Org mode version 6.15d)

  The Org mode version 6.15 introduced @0 as a reference to the last
  row for spreadsheet (org-table) formulas.  This leads to problems if
  you used it as reference to the same row before.

  - description from [[http://orgmode.org/Changes.html][Org-mode list of
user-visible changes]]:

    Spreadsheet references to the last table line.

    You may now use @0 to reference the last dataline in a table in a
    stable way.

  - according to  [[info:org:References]]:

    `0' refers to the current row and column.  Also, if you omit
    either the column or the row part of the reference, the current
    row/column is implied.

  However this doesn't work since @0 refers to the last line.

  If you press `C-c *' with the cursor inside the tables below, the
  second column should contain the doubled value of the first.

** @0 refers to last line

|---+---|
| 1 | 4 |
| 2 | 4 |
|---+---|
#+TBLFM: $2=2*@0$-1

   this has worked before as reference to the same row, now it refers
   to the last row

** bug: omitting explicit reference

|---+--------|
| 1 | #ERROR |
| 2 | #ERROR |
|---+--------|
#+TBLFM: $2=2*$-1

   this seems to be a bug, should refer to the same row

** @+0 refers to same row

|---+---|
| 1 | 2 |
| 2 | 4 |
|---+---|
#+TBLFM: $2=2*@+0$-1

   works as expected


Greetings,
	Stephan

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

* Re: reference to same row in spreadsheet
  2008-12-18 15:01 reference to same row in spreadsheet Stephan Schmitt
@ 2008-12-18 16:25 ` Carsten Dominik
  2008-12-18 16:50   ` Stephan Schmitt
  2008-12-18 16:55   ` reference " Ben Alexander
  0 siblings, 2 replies; 6+ messages in thread
From: Carsten Dominik @ 2008-12-18 16:25 UTC (permalink / raw)
  To: Stephan Schmitt; +Cc: emacs-orgmode

You are right, this is an incompatible change.  Dammit.

What should  do?  Opinions?

The problem is that this change may lead to older tables
evaluated incorrectly.  I do like the new convention and
think that @+0 or leaving out the row  specifications are
good alternatives - but maybe we are obliged to keep
the old convention....

- Carsten

On Dec 18, 2008, at 4:01 PM, Stephan Schmitt wrote:

> Hello,
>
> the reference to the last row @0 led to incompatible changes:
>
> * spreadsheet: relative reference to same row
>  (using Org mode version 6.15d)
>
>  The Org mode version 6.15 introduced @0 as a reference to the last
>  row for spreadsheet (org-table) formulas.  This leads to problems if
>  you used it as reference to the same row before.
>
>  - description from [[http://orgmode.org/Changes.html][Org-mode list  
> of
> user-visible changes]]:
>
>    Spreadsheet references to the last table line.
>
>    You may now use @0 to reference the last dataline in a table in a
>    stable way.
>
>  - according to  [[info:org:References]]:
>
>    `0' refers to the current row and column.  Also, if you omit
>    either the column or the row part of the reference, the current
>    row/column is implied.
>
>  However this doesn't work since @0 refers to the last line.
>
>  If you press `C-c *' with the cursor inside the tables below, the
>  second column should contain the doubled value of the first.
>
> ** @0 refers to last line
>
> |---+---|
> | 1 | 4 |
> | 2 | 4 |
> |---+---|
> #+TBLFM: $2=2*@0$-1
>
>   this has worked before as reference to the same row, now it refers
>   to the last row
>
> ** bug: omitting explicit reference
>
> |---+--------|
> | 1 | #ERROR |
> | 2 | #ERROR |
> |---+--------|
> #+TBLFM: $2=2*$-1
>
>   this seems to be a bug, should refer to the same row
>
> ** @+0 refers to same row
>
> |---+---|
> | 1 | 2 |
> | 2 | 4 |
> |---+---|
> #+TBLFM: $2=2*@+0$-1
>
>   works as expected
>
>
> Greetings,
> 	Stephan
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: reference to same row in spreadsheet
  2008-12-18 16:25 ` Carsten Dominik
@ 2008-12-18 16:50   ` Stephan Schmitt
  2008-12-18 22:14     ` Carsten Dominik
  2008-12-18 16:55   ` reference " Ben Alexander
  1 sibling, 1 reply; 6+ messages in thread
From: Stephan Schmitt @ 2008-12-18 16:50 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode

For me the new behaviour is fine, if leaving out the row specification works.

The distinction between @0 and @+0 would work, too, but is rather confusing and
hard to remember.  I think both should represent either the last or the current row.

Greetings,
	Stephan

Carsten Dominik wrote:
> You are right, this is an incompatible change.  Dammit.
> 
> What should  do?  Opinions?
> 
> The problem is that this change may lead to older tables
> evaluated incorrectly.  I do like the new convention and
> think that @+0 or leaving out the row  specifications are
> good alternatives - but maybe we are obliged to keep
> the old convention....
> 
> - Carsten
> 
> On Dec 18, 2008, at 4:01 PM, Stephan Schmitt wrote:
> 
>> Hello,
>>
>> the reference to the last row @0 led to incompatible changes:
>>
>> * spreadsheet: relative reference to same row
>>  (using Org mode version 6.15d)
>>
>>  The Org mode version 6.15 introduced @0 as a reference to the last
>>  row for spreadsheet (org-table) formulas.  This leads to problems if
>>  you used it as reference to the same row before.
>>
>>  - description from [[http://orgmode.org/Changes.html][Org-mode list of
>> user-visible changes]]:
>>
>>    Spreadsheet references to the last table line.
>>
>>    You may now use @0 to reference the last dataline in a table in a
>>    stable way.
>>
>>  - according to  [[info:org:References]]:
>>
>>    `0' refers to the current row and column.  Also, if you omit
>>    either the column or the row part of the reference, the current
>>    row/column is implied.
>>
>>  However this doesn't work since @0 refers to the last line.
>>
>>  If you press `C-c *' with the cursor inside the tables below, the
>>  second column should contain the doubled value of the first.
>>
>> ** @0 refers to last line
>>
>> |---+---|
>> | 1 | 4 |
>> | 2 | 4 |
>> |---+---|
>> #+TBLFM: $2=2*@0$-1
>>
>>   this has worked before as reference to the same row, now it refers
>>   to the last row
>>
>> ** bug: omitting explicit reference
>>
>> |---+--------|
>> | 1 | #ERROR |
>> | 2 | #ERROR |
>> |---+--------|
>> #+TBLFM: $2=2*$-1
>>
>>   this seems to be a bug, should refer to the same row
>>
>> ** @+0 refers to same row
>>
>> |---+---|
>> | 1 | 2 |
>> | 2 | 4 |
>> |---+---|
>> #+TBLFM: $2=2*@+0$-1
>>
>>   works as expected
>>
>>
>> Greetings,
>>     Stephan
>>
>>
>>
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Remember: use `Reply All' to send replies to the list.
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
> 

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

* Re: reference to same row in spreadsheet
  2008-12-18 16:25 ` Carsten Dominik
  2008-12-18 16:50   ` Stephan Schmitt
@ 2008-12-18 16:55   ` Ben Alexander
  1 sibling, 0 replies; 6+ messages in thread
From: Ben Alexander @ 2008-12-18 16:55 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Stephan Schmitt, emacs-orgmode

How about adding a customizable variable which defaults to nil.  (Call  
it org-use-new-spreadsheet-semantics). If it is nil, whenever the new  
syntax is used, raise a warning.
The warning could be:
1. just a message to the echo area
2. inserted into the top of the updated table
3. an error which aborts spreadsheet calculations

This pushes the responsibility onto users to check their tables before  
they set the option.

So I'm thinking it's unfair to make that an org-wide setting...

More thinking...

Another option is to include a file only variable like this
#+ORG_VERSION: [6.2]--
or
#+ORG_VERSION: --[6.2]

The first option would cause old versions of org-mode to abort  
processing, and the second would cause new versions to abort.  This  
might help with any and all future changes to syntax, and perhaps  
allow users to mark the files they don't want to change yet.  Perhaps,  
if they are careful, they'll be able to load a different version of  
org-mode to process an individual file.

I'm reminded of something I had learned about perl, long ago.  If  
Carsten and community like this, perhaps someone could suggest the  
most elisp like way of doing version comparisons.  Failing that, I'd  
suggest looking at the perl way of doing it, which allowed for  
multiple dots in the version string
1.0 < 2.0 < 3.0 < 10.0 < 20.0 < 100.0
and
1.0< 1.1 < 1.2 < 1.100 < 2.0

I think (but can't remember) that version numbers had to have pairs of  
digits (1.1.1 was illegal you had to use 1.1.1.0).  There must have  
been a reason OR I'm wrong about the requirement.

Just my musings

On 2008-Dec-18, at 16:25, Carsten Dominik wrote:

> You are right, this is an incompatible change.  Dammit.
>
> What should  do?  Opinions?
>
> The problem is that this change may lead to older tables
> evaluated incorrectly.  I do like the new convention and
> think that @+0 or leaving out the row  specifications are
> good alternatives - but maybe we are obliged to keep
> the old convention....
>
> - Carsten
>
> On Dec 18, 2008, at 4:01 PM, Stephan Schmitt wrote:
>
>> Hello,
>>
>> the reference to the last row @0 led to incompatible changes:
>>
>> * spreadsheet: relative reference to same row
>> (using Org mode version 6.15d)
>>
>> The Org mode version 6.15 introduced @0 as a reference to the last
>> row for spreadsheet (org-table) formulas.  This leads to problems if
>> you used it as reference to the same row before.
>>
>> - description from [[http://orgmode.org/Changes.html][Org-mode list  
>> of
>> user-visible changes]]:
>>
>>   Spreadsheet references to the last table line.
>>
>>   You may now use @0 to reference the last dataline in a table in a
>>   stable way.
>>
>> - according to  [[info:org:References]]:
>>
>>   `0' refers to the current row and column.  Also, if you omit
>>   either the column or the row part of the reference, the current
>>   row/column is implied.
>>
>> However this doesn't work since @0 refers to the last line.
>>
>> If you press `C-c *' with the cursor inside the tables below, the
>> second column should contain the doubled value of the first.
>>
>> ** @0 refers to last line
>>
>> |---+---|
>> | 1 | 4 |
>> | 2 | 4 |
>> |---+---|
>> #+TBLFM: $2=2*@0$-1
>>
>>  this has worked before as reference to the same row, now it refers
>>  to the last row
>>
>> ** bug: omitting explicit reference
>>
>> |---+--------|
>> | 1 | #ERROR |
>> | 2 | #ERROR |
>> |---+--------|
>> #+TBLFM: $2=2*$-1
>>
>>  this seems to be a bug, should refer to the same row
>>
>> ** @+0 refers to same row
>>
>> |---+---|
>> | 1 | 2 |
>> | 2 | 4 |
>> |---+---|
>> #+TBLFM: $2=2*@+0$-1
>>
>>  works as expected
>>
>>
>> Greetings,
>> 	Stephan
>>
>>
>>
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Remember: use `Reply All' to send replies to the list.
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Remember: use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: reference to same row in spreadsheet
  2008-12-18 16:50   ` Stephan Schmitt
@ 2008-12-18 22:14     ` Carsten Dominik
  2008-12-19 17:49       ` Reference " Carsten Dominik
  0 siblings, 1 reply; 6+ messages in thread
From: Carsten Dominik @ 2008-12-18 22:14 UTC (permalink / raw)
  To: Stephan Schmitt; +Cc: emacs-orgmode

Hi all,

thanks for your constructive contributions to the thread.

However, I will still reverse the change that introduced @0 as a  
reference to the last line.  The risk that someone will be bitten by  
this is too high, and @0 is really too similar to @+0, so I think the  
distinction is not large enough.

I will try to find a different solution, like @last$2 or so, but this  
is harder to implement and will take a little while.  Sorry Matt.

The reason why I am in a hurry to revert this change is, among others,  
because Emacs 23 might go into pretest very soon, and I really want a  
clean, good version to ship with it.

- Carsten

On Dec 18, 2008, at 5:50 PM, Stephan Schmitt wrote:

> For me the new behaviour is fine, if leaving out the row  
> specification works.
>
> The distinction between @0 and @+0 would work, too, but is rather  
> confusing and
> hard to remember.  I think both should represent either the last or  
> the current row.
>
> Greetings,
> 	Stephan
>
> Carsten Dominik wrote:
>> You are right, this is an incompatible change.  Dammit.
>>
>> What should  do?  Opinions?
>>
>> The problem is that this change may lead to older tables
>> evaluated incorrectly.  I do like the new convention and
>> think that @+0 or leaving out the row  specifications are
>> good alternatives - but maybe we are obliged to keep
>> the old convention....
>>
>> - Carsten
>>
>> On Dec 18, 2008, at 4:01 PM, Stephan Schmitt wrote:
>>
>>> Hello,
>>>
>>> the reference to the last row @0 led to incompatible changes:
>>>
>>> * spreadsheet: relative reference to same row
>>> (using Org mode version 6.15d)
>>>
>>> The Org mode version 6.15 introduced @0 as a reference to the last
>>> row for spreadsheet (org-table) formulas.  This leads to problems if
>>> you used it as reference to the same row before.
>>>
>>> - description from [[http://orgmode.org/Changes.html][Org-mode  
>>> list of
>>> user-visible changes]]:
>>>
>>>  Spreadsheet references to the last table line.
>>>
>>>  You may now use @0 to reference the last dataline in a table in a
>>>  stable way.
>>>
>>> - according to  [[info:org:References]]:
>>>
>>>  `0' refers to the current row and column.  Also, if you omit
>>>  either the column or the row part of the reference, the current
>>>  row/column is implied.
>>>
>>> However this doesn't work since @0 refers to the last line.
>>>
>>> If you press `C-c *' with the cursor inside the tables below, the
>>> second column should contain the doubled value of the first.
>>>
>>> ** @0 refers to last line
>>>
>>> |---+---|
>>> | 1 | 4 |
>>> | 2 | 4 |
>>> |---+---|
>>> #+TBLFM: $2=2*@0$-1
>>>
>>> this has worked before as reference to the same row, now it refers
>>> to the last row
>>>
>>> ** bug: omitting explicit reference
>>>
>>> |---+--------|
>>> | 1 | #ERROR |
>>> | 2 | #ERROR |
>>> |---+--------|
>>> #+TBLFM: $2=2*$-1
>>>
>>> this seems to be a bug, should refer to the same row
>>>
>>> ** @+0 refers to same row
>>>
>>> |---+---|
>>> | 1 | 2 |
>>> | 2 | 4 |
>>> |---+---|
>>> #+TBLFM: $2=2*@+0$-1
>>>
>>> works as expected
>>>
>>>
>>> Greetings,
>>>   Stephan
>>>
>>>
>>>
>>> _______________________________________________
>>> Emacs-orgmode mailing list
>>> Remember: use `Reply All' to send replies to the list.
>>> Emacs-orgmode@gnu.org
>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>

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

* Reference to same row in spreadsheet
  2008-12-18 22:14     ` Carsten Dominik
@ 2008-12-19 17:49       ` Carsten Dominik
  0 siblings, 0 replies; 6+ messages in thread
From: Carsten Dominik @ 2008-12-19 17:49 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Stephan Schmitt, Emacs-orgmode mailing list

With the latest push to the git repo,

you can use $LR1, $LR2, ... to reference fields in the last row.

HTH

- Carsten


On Dec 18, 2008, at 11:14 PM, Carsten Dominik wrote:

> Hi all,
>
> thanks for your constructive contributions to the thread.
>
> However, I will still reverse the change that introduced @0 as a  
> reference to the last line.  The risk that someone will be bitten by  
> this is too high, and @0 is really too similar to @+0, so I think  
> the distinction is not large enough.
>
> I will try to find a different solution, like @last$2 or so, but  
> this is harder to implement and will take a little while.  Sorry Matt.
>
> The reason why I am in a hurry to revert this change is, among  
> others, because Emacs 23 might go into pretest very soon, and I  
> really want a clean, good version to ship with it.
>
> - Carsten
>
> On Dec 18, 2008, at 5:50 PM, Stephan Schmitt wrote:
>
>> For me the new behaviour is fine, if leaving out the row  
>> specification works.
>>
>> The distinction between @0 and @+0 would work, too, but is rather  
>> confusing and
>> hard to remember.  I think both should represent either the last or  
>> the current row.
>>
>> Greetings,
>> 	Stephan
>>
>> Carsten Dominik wrote:
>>> You are right, this is an incompatible change.  Dammit.
>>>
>>> What should  do?  Opinions?
>>>
>>> The problem is that this change may lead to older tables
>>> evaluated incorrectly.  I do like the new convention and
>>> think that @+0 or leaving out the row  specifications are
>>> good alternatives - but maybe we are obliged to keep
>>> the old convention....
>>>
>>> - Carsten
>>>
>>> On Dec 18, 2008, at 4:01 PM, Stephan Schmitt wrote:
>>>
>>>> Hello,
>>>>
>>>> the reference to the last row @0 led to incompatible changes:
>>>>
>>>> * spreadsheet: relative reference to same row
>>>> (using Org mode version 6.15d)
>>>>
>>>> The Org mode version 6.15 introduced @0 as a reference to the last
>>>> row for spreadsheet (org-table) formulas.  This leads to problems  
>>>> if
>>>> you used it as reference to the same row before.
>>>>
>>>> - description from [[http://orgmode.org/Changes.html][Org-mode  
>>>> list of
>>>> user-visible changes]]:
>>>>
>>>> Spreadsheet references to the last table line.
>>>>
>>>> You may now use @0 to reference the last dataline in a table in a
>>>> stable way.
>>>>
>>>> - according to  [[info:org:References]]:
>>>>
>>>> `0' refers to the current row and column.  Also, if you omit
>>>> either the column or the row part of the reference, the current
>>>> row/column is implied.
>>>>
>>>> However this doesn't work since @0 refers to the last line.
>>>>
>>>> If you press `C-c *' with the cursor inside the tables below, the
>>>> second column should contain the doubled value of the first.
>>>>
>>>> ** @0 refers to last line
>>>>
>>>> |---+---|
>>>> | 1 | 4 |
>>>> | 2 | 4 |
>>>> |---+---|
>>>> #+TBLFM: $2=2*@0$-1
>>>>
>>>> this has worked before as reference to the same row, now it refers
>>>> to the last row
>>>>
>>>> ** bug: omitting explicit reference
>>>>
>>>> |---+--------|
>>>> | 1 | #ERROR |
>>>> | 2 | #ERROR |
>>>> |---+--------|
>>>> #+TBLFM: $2=2*$-1
>>>>
>>>> this seems to be a bug, should refer to the same row
>>>>
>>>> ** @+0 refers to same row
>>>>
>>>> |---+---|
>>>> | 1 | 2 |
>>>> | 2 | 4 |
>>>> |---+---|
>>>> #+TBLFM: $2=2*@+0$-1
>>>>
>>>> works as expected
>>>>
>>>>
>>>> Greetings,
>>>>  Stephan
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Emacs-orgmode mailing list
>>>> Remember: use `Reply All' to send replies to the list.
>>>> Emacs-orgmode@gnu.org
>>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>>
>

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

end of thread, other threads:[~2008-12-19 17:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-18 15:01 reference to same row in spreadsheet Stephan Schmitt
2008-12-18 16:25 ` Carsten Dominik
2008-12-18 16:50   ` Stephan Schmitt
2008-12-18 22:14     ` Carsten Dominik
2008-12-19 17:49       ` Reference " Carsten Dominik
2008-12-18 16:55   ` reference " Ben Alexander

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.