emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* recalculate tables
@ 2016-08-25 11:23 Michael Welle
  2016-08-25 12:12 ` Russell Adams
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Welle @ 2016-08-25 11:23 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

in a table like the following C-u M-x org-table-recalculate fills the
third column as expected:

|---+---+----|
| 3 | 4 |    |
#+TBLFM: $3=$2-$1


But if the table finishes with a line, that doesn't work anymore:

|---+---+----|
| 3 | 4 |    |
|---+---+----|
#+TBLFM: $3=$2-$1


Then if I change the table to the following, recalculation works again:

|   |   |    |
|---+---+----|
| 3 | 4 |    |
|---+---+----|
#+TBLFM: $3=$2-$1

Is that intended behaviour?

Regards
hmw

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

* Re: recalculate tables
  2016-08-25 11:23 recalculate tables Michael Welle
@ 2016-08-25 12:12 ` Russell Adams
  2016-08-25 14:46   ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: Russell Adams @ 2016-08-25 12:12 UTC (permalink / raw)
  To: emacs-orgmode

This doesn't update either (C-u C-c *):

|---+-------+---+---|
| 1 | derp  | 3 | 3 |
| 2 | derp2 | 5 |   |
|---+-------+---+---|
|   |       |   | 0 |
#+TBLFM: $4=$1*$3

I'd been working with these recently and discovered sometimes it
wasn't updating... I hadn't gotten an MWE though so based on yours I
composed a few.

I'm on an ancient Org 7.8.10, so its been around a while.

On Thu, Aug 25, 2016 at 01:23:12PM +0200, Michael Welle wrote:
> Hello,
>
> in a table like the following C-u M-x org-table-recalculate fills the
> third column as expected:
>
> |---+---+----|
> | 3 | 4 |    |
> #+TBLFM: $3=$2-$1
>
>
> But if the table finishes with a line, that doesn't work anymore:
>
> |---+---+----|
> | 3 | 4 |    |
> |---+---+----|
> #+TBLFM: $3=$2-$1
>
>
> Then if I change the table to the following, recalculation works again:
>
> |   |   |    |
> |---+---+----|
> | 3 | 4 |    |
> |---+---+----|
> #+TBLFM: $3=$2-$1
>
> Is that intended behaviour?
>
> Regards
> hmw
>


------------------------------------------------------------------
Russell Adams                            RLAdams@AdamsInfoServ.com

PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/

Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3

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

* Re: recalculate tables
  2016-08-25 12:12 ` Russell Adams
@ 2016-08-25 14:46   ` Nicolas Goaziou
  2016-08-25 16:19     ` Russell Adams
  2016-08-25 18:57     ` Michael Welle
  0 siblings, 2 replies; 9+ messages in thread
From: Nicolas Goaziou @ 2016-08-25 14:46 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

Russell Adams <RLAdams@AdamsInfoServ.Com> writes:

> This doesn't update either (C-u C-c *):
>
> |---+-------+---+---|
> | 1 | derp  | 3 | 3 |
> | 2 | derp2 | 5 |   |
> |---+-------+---+---|
> |   |       |   | 0 |
> #+TBLFM: $4=$1*$3
>
> I'd been working with these recently and discovered sometimes it
> wasn't updating... I hadn't gotten an MWE though so based on yours I
> composed a few.

It may be related to the fact that the first row group is considered as
a table header. Column formulas do not apply on these headers. See first
paragraph in (info "(org) Column formulas").

Regards,

-- 
Nicolas Goaziou

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

* Re: recalculate tables
  2016-08-25 14:46   ` Nicolas Goaziou
@ 2016-08-25 16:19     ` Russell Adams
  2016-08-25 18:57     ` Michael Welle
  1 sibling, 0 replies; 9+ messages in thread
From: Russell Adams @ 2016-08-25 16:19 UTC (permalink / raw)
  To: emacs-orgmode

> > This doesn't update either (C-u C-c *):
> >
> > |---+-------+---+---|
> > | 1 | derp  | 3 | 3 |
> > | 2 | derp2 | 5 |   |
> > |---+-------+---+---|
> > |   |       |   | 0 |
> > #+TBLFM: $4=$1*$3
> >
> > I'd been working with these recently and discovered sometimes it
> > wasn't updating... I hadn't gotten an MWE though so based on yours I
> > composed a few.
>
> It may be related to the fact that the first row group is considered as
> a table header. Column formulas do not apply on these headers. See first
> paragraph in (info "(org) Column formulas").

Excellent point! That fits the other examples as well.

I thought the header required an extra character in another column to
trigger.

I frequently use horizontal lines to trigger calculation using the
relative range for lines above the current cell, like so:

|   |       |   |       |
|---+-------+---+-------|
| 1 | derp  | 3 |     3 |
| 2 | derp2 | 5 |    10 |
|---+-------+---+-------|
|   |       |   | 13.00 |
#+TBLFM: $4=$1*$3::@4$4=vsum(@-I..@-II);%0.2f

Perhaps someone knows a better way?


------------------------------------------------------------------
Russell Adams                            RLAdams@AdamsInfoServ.com

PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/

Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3

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

* Re: recalculate tables
  2016-08-25 14:46   ` Nicolas Goaziou
  2016-08-25 16:19     ` Russell Adams
@ 2016-08-25 18:57     ` Michael Welle
  2016-08-26 14:34       ` Nicolas Goaziou
  1 sibling, 1 reply; 9+ messages in thread
From: Michael Welle @ 2016-08-25 18:57 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Hello,
>
> Russell Adams <RLAdams@AdamsInfoServ.Com> writes:
>
>> This doesn't update either (C-u C-c *):
>>
>> |---+-------+---+---|
>> | 1 | derp  | 3 | 3 |
>> | 2 | derp2 | 5 |   |
>> |---+-------+---+---|
>> |   |       |   | 0 |
>> #+TBLFM: $4=$1*$3
>>
>> I'd been working with these recently and discovered sometimes it
>> wasn't updating... I hadn't gotten an MWE though so based on yours I
>> composed a few.
>
> It may be related to the fact that the first row group is considered as
> a table header. Column formulas do not apply on these headers. See first
> paragraph in (info "(org) Column formulas").
I have a few of those, that worked in the past. So I think the behaviour
had changed some time in the past year or so.

I liked the old behaviour (but it's not super important for me), because
it's a bit of a burden to think out table headers if one don't want/need
them. Sometimes the headers are wider than the content of the column and
makes the whole table wider then 80 characters and empty table headers
are aesthetically questionable ;).

Regards
hmw

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

* Re: recalculate tables
  2016-08-25 18:57     ` Michael Welle
@ 2016-08-26 14:34       ` Nicolas Goaziou
  2016-08-26 15:01         ` Michael Welle
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2016-08-26 14:34 UTC (permalink / raw)
  To: Michael Welle; +Cc: emacs-orgmode

Hello,

Michael Welle <mwe012008@gmx.net> writes:

> I have a few of those, that worked in the past. So I think the behaviour
> had changed some time in the past year or so.

Quite possible. I made some invasive changes in "org-table.el" a while
ago.

> I liked the old behaviour (but it's not super important for me)

The problem is that I don't know what is "the old behaviour".  The fact
that column formulas do not apply in table headers has been there for
ages.

What is that behaviour?

Regards,

-- 
Nicolas Goaziou

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

* Re: recalculate tables
  2016-08-26 14:34       ` Nicolas Goaziou
@ 2016-08-26 15:01         ` Michael Welle
  2016-08-28 23:14           ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Welle @ 2016-08-26 15:01 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Hello,
>
> Michael Welle <mwe012008@gmx.net> writes:
>
>> I have a few of those, that worked in the past. So I think the behaviour
>> had changed some time in the past year or so.
>
> Quite possible. I made some invasive changes in "org-table.el" a while
> ago.
SCM revealed that I 'fixed' one table with an empty header around
Christmas last year. But I can't remember if I found the problem a few
weeks earlier or a few months.


>> I liked the old behaviour (but it's not super important for me)
>
> The problem is that I don't know what is "the old behaviour".  The fact
> that column formulas do not apply in table headers has been there for
> ages.
Yes, Russell suggested something like that. That puzzles me a bit. The
table, that I mentioned above is updated every three months. Even if the
formulas would not have been applied three or four times before I found
out about it, I wouldn't have used Org version 7.8 (the one that
Russell uses) or earlier back at that time, I think.

If the change is somewhere in, let's say, org-table.el, one thing I can
vaguely imagine is that an older org-table.el was lying around and got
loaded. I experienced something like that with ob-sh.el and ob-shell.el.
But on the other hand, I have trouble to understand how that could
happen (other than with ob-sh the file name stayed the same).


> What is that behaviour?
I have a handful of tables like the following:

|---+---+----|
| 3 | 4 |    |
|---+---+----|
#+TBLFM: $3=$2-$1

I don't add data to them very frequently. But since they all have the
third column filled, I think recalculating had worked in tables formated
like that before.

If you give me a week or so I will try to find the change set that
introduced the current behaviour.

Regards
hmw

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

* Re: recalculate tables
  2016-08-26 15:01         ` Michael Welle
@ 2016-08-28 23:14           ` Nicolas Goaziou
  2016-08-29  4:58             ` Michael Welle
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2016-08-28 23:14 UTC (permalink / raw)
  To: Michael Welle; +Cc: emacs-orgmode

Hello,

Michael Welle <mwe012008@gmx.net> writes:

> I have a handful of tables like the following:
>
> |---+---+----|
> | 3 | 4 |    |
> |---+---+----|
> #+TBLFM: $3=$2-$1
>
> I don't add data to them very frequently. But since they all have the
> third column filled, I think recalculating had worked in tables formated
> like that before.
>
> If you give me a week or so I will try to find the change set that
> introduced the current behaviour.

I think I found the culprit. Org is hopefully back to its initial
behaviour. Thank you.

Regards,

-- 
Nicolas Goaziou

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

* Re: recalculate tables
  2016-08-28 23:14           ` Nicolas Goaziou
@ 2016-08-29  4:58             ` Michael Welle
  0 siblings, 0 replies; 9+ messages in thread
From: Michael Welle @ 2016-08-29  4:58 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Hello,
>
> Michael Welle <mwe012008@gmx.net> writes:
>
>> I have a handful of tables like the following:
>>
>> |---+---+----|
>> | 3 | 4 |    |
>> |---+---+----|
>> #+TBLFM: $3=$2-$1
>>
>> I don't add data to them very frequently. But since they all have the
>> third column filled, I think recalculating had worked in tables formated
>> like that before.
>>
>> If you give me a week or so I will try to find the change set that
>> introduced the current behaviour.
>
> I think I found the culprit. Org is hopefully back to its initial
> behaviour. Thank you.
wow, that was fast. Thank you very much, Nicolas.

Regards
hmw

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

end of thread, other threads:[~2016-08-29  4:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-25 11:23 recalculate tables Michael Welle
2016-08-25 12:12 ` Russell Adams
2016-08-25 14:46   ` Nicolas Goaziou
2016-08-25 16:19     ` Russell Adams
2016-08-25 18:57     ` Michael Welle
2016-08-26 14:34       ` Nicolas Goaziou
2016-08-26 15:01         ` Michael Welle
2016-08-28 23:14           ` Nicolas Goaziou
2016-08-29  4:58             ` Michael Welle

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).