From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi Subject: org table with auto-incrementing numbers in a column Date: Mon, 15 Feb 2016 23:36:41 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11494d0e648f77052bdbb022 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59694) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVXO7-0003JJ-7J for emacs-orgmode@gnu.org; Mon, 15 Feb 2016 23:37:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aVXO6-00033T-0d for emacs-orgmode@gnu.org; Mon, 15 Feb 2016 23:37:23 -0500 Received: from mail-ob0-x22f.google.com ([2607:f8b0:4003:c01::22f]:34443) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVXO5-00033P-RH for emacs-orgmode@gnu.org; Mon, 15 Feb 2016 23:37:21 -0500 Received: by mail-ob0-x22f.google.com with SMTP id wb13so242094840obb.1 for ; Mon, 15 Feb 2016 20:37:21 -0800 (PST) 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-org list --001a11494d0e648f77052bdbb022 Content-Type: text/plain; charset=UTF-8 Hi, I am trying to get auto-incrementing numbers in the first column in an org table. The goal is to recalculate the numbers after adding/removing rows. I checked out the org FAQ: http://orgmode.org/worg/org-faq.html#fill-table-column-with-incremental-numbers But I am still not getting it to work as I need to. Below is the minimum working example. Paste the below in an org buffer. | N | | |---+---| | | | | | | | | | | | | #+TBLFM: $1=@-1+1::@2$1=1 Now with the point anywhere in the table, when I hit "C-c *" or M-x org-table-recalculate, I expect the first column to be auto-populated with numbers 1,2,3,4 (or that's how I understood from the tutorial in the FAQ link above). But it does not work that way. Instead I need to go to each row and hit C-c *. So I am definitely missing out on something that's preventing the whole table to be recalculated in one go. Any help? Thanks! Org-mode version 8.3.3 (release_8.3.3-597-gcaf66e @ /home/kmodi/usr_local/apps/6/emacs/emacs-25/share/emacs/site-lisp/org/) -- Kaushal Modi --001a11494d0e648f77052bdbb022 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,

I am trying to get auto-incrementin= g numbers in the first column in an org table. The goal is to recalculate t= he numbers after adding/removing rows.


But= I am still not getting it to work as I need to.

B= elow is the minimum working example. Paste the below in an org buffer.


<= div>
| N | =C2=A0 |
|---+---|
| =C2=A0 | =C2=A0 |
| =C2=A0 | =C2=A0 |
| =C2=A0 | =C2=A0 |
| =C2=A0 | =C2=A0 |
#+TBLFM: $1=3D@-1+1::@2$1=3D1

Now with the point anywhere in the table, when = I hit "C-c *" or M-x org-table-recalculate, I expect the first co= lumn to be auto-populated with numbers 1,2,3,4 (or that's how I underst= ood from the tutorial in the FAQ link above).

But = it does not work that way. Instead I need to go to each row and hit C-c *.<= /div>

So I am definitely missing out on something that&#= 39;s preventing the whole table to be recalculated in one go. Any help?

Thanks!

Org-mode version 8.3= .3 (release_8.3.3-597-gcaf66e @ /home/kmodi/usr_local/apps/6/emacs/emacs-25= /share/emacs/site-lisp/org/)


--
Kaushal Modi
--001a11494d0e648f77052bdbb022-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Derek Feichtinger Subject: Re: org table with auto-incrementing numbers in a column Date: Tue, 16 Feb 2016 06:22:43 +0000 (UTC) Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46795) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVZ2K-0001ux-IE for emacs-orgmode@gnu.org; Tue, 16 Feb 2016 01:23:01 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aVZ2F-0004nI-JJ for emacs-orgmode@gnu.org; Tue, 16 Feb 2016 01:23:00 -0500 Received: from plane.gmane.org ([80.91.229.3]:57647) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVZ2F-0004mr-Az for emacs-orgmode@gnu.org; Tue, 16 Feb 2016 01:22:55 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1aVZ2D-00071N-4J for emacs-orgmode@gnu.org; Tue, 16 Feb 2016 07:22:53 +0100 Received: from 18.20.60.188.dynamic.wline.res.cust.swisscom.ch ([188.60.20.18]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 16 Feb 2016 07:22:53 +0100 Received: from dfeich by 18.20.60.188.dynamic.wline.res.cust.swisscom.ch with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 16 Feb 2016 07:22:53 +0100 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 SGkKCkthdXNoYWwgTW9kaSA8a2F1c2hhbC5tb2RpIDxhdD4gZ21haWwuY29tPiB3cml0ZXM6Cgo+IAo+IEhpLAo+IEkgYW0gdHJ5aW5nIHRvIGdldCBhdXRvLWluY3JlbWVudGluZyBudW1iZXJzIGluIHRoZSBmaXJzdCBjb2x1bW4gaW4gYW4gb3JnCnRhYmxlLiBUaGUgZ29hbCBpcyB0byByZWNhbGN1bGF0ZSB0aGUgbnVtYmVycyBhZnRlciBhZGRpbmcvcmVtb3Zpbmcgcm93cy4KPiAKPiBJIGNoZWNrZWQgb3V0IHRoZSBvcmcKRkFROsKgaHR0cDovL29yZ21vZGUub3JnL3dvcmcvb3JnLWZhcS5odG1sI2ZpbGwtdGFibGUtY29sdW1uLXdpdGgtaW5jcmVtZW50YWwtbnVtYmVycwo+IAo+IAo+IEJ1dCBJIGFtIHN0aWxsIG5vdCBnZXR0aW5nIGl0IHRvIHdvcmsgYXMgSSBuZWVkIHRvLgo+IAo+IEJlbG93IGlzIHRoZSBtaW5pbXVtIHdvcmtpbmcgZXhhbXBsZS4gUGFzdGUgdGhlIGJlbG93IGluIGFuIG9yZyBidWZmZXIuCj4gCj4gCj4gCj4gfCBOIHwgwqAgfAo+IHwtLS0rLS0tfAo+IHwgwqAgfCDCoCB8Cj4gfCDCoCB8IMKgIHwKPiB8IMKgIHwgwqAgfAo+IHwgwqAgfCDCoCB8Cj4gIytUQkxGTTogJDE9IDxhdD4gLTErMTo6IDxhdD4gMiQxPTEKPiAKPiAK ClRyeSB0aGlzCgogIHwgTiB8ICAgfAogIHwtLS0rLS0tfAogIHwgICB8ICAgfAogIHwgICB8ICAgfAogIHwgICB8ICAgfAogIHwgICB8ICAgfAogICMrVEJMRk06IDxhdD4kMS4uPGF0Pj4kMT0gPGF0Pi0xICsgMTo6IDxhdD4yJDE9MQoKCk9uZSBwcm9ibGVtIGlzIHRoYXQgJDEgYWxzbyBpbmNsdWRlcyB0aGUgZmlyc3Qgcm93IHdpdGggdGhlICJOIiBoZWFkaW5nLgp0aGF0IGlzIHdoeSBpbiB5b3VyIGV4YW1wbGUgdGhlIHNlY29uZCBhbmQgdGhpcmQgbGluZXMgYm90aCB3aWxsIGF0IGZpcnN0CmNvbnRhaW4gMSAoYXQgbGVhc3Qgd2l0aCBteSBvcmcgdmVyc2lvbiA4LjMuMyksIGFuZCBpbiB0aGUgc2Vjb25kIGl0ZXJhdGlvbgpvbmx5IHNob3cgdGhlIGNvcnJlY3Qgc2VyaWVzLgoKPiBOb3cgd2l0aCB0aGUgcG9pbnQgYW55d2hlcmUgaW4gdGhlIHRhYmxlLCB3aGVuIEkgaGl0ICJDLWMgKiIgb3IgTS14Cm9yZy10YWJsZS1yZWNhbGN1bGF0ZSwgSSBleHBlY3QgdGhlIGZpcnN0IGNvbHVtbiB0byBiZSBhdXRvLXBvcHVsYXRlZCB3aXRoCm51bWJlcnMgMSwyLDMsNCAob3IgdGhhdCdzIGhvdyBJIHVuZGVyc3Rvb2QgZnJvbSB0aGUgdHV0b3JpYWwgaW 4gdGhlIEZBUQpsaW5rIGFib3ZlKS4KPiAKPiBCdXQgaXQgZG9lcyBub3Qgd29yayB0aGF0IHdheS4gSW5zdGVhZCBJIG5lZWQgdG8gZ28gdG8gZWFjaCByb3cgYW5kIGhpdCBDLWMgKi4KClBsYWNpbmcgcG9pbnQgb24gdGhlIFRCTEZNIGxpbmUgYW5kIGRvaW5nIEMtYyBDLWMgc2hvdWxkIHJlY2FsY3VsYXRlIHRoZQp3aG9sZSB0YWJsZS4KCgpDaGVlcnMsCkRlcmVrCgoK From mboxrd@z Thu Jan 1 00:00:00 1970 From: dieter@duenenhof-wilhelm.de (H. Dieter Wilhelm) Subject: Re: org table with auto-incrementing numbers in a column Date: Tue, 16 Feb 2016 08:24:17 +0100 Message-ID: <87a8n1yv6m.fsf@duenenhof-wilhelm.de> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41983) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVa73-0005w1-Pv for emacs-orgmode@gnu.org; Tue, 16 Feb 2016 02:31:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aVa6y-0005O3-Ow for emacs-orgmode@gnu.org; Tue, 16 Feb 2016 02:31:57 -0500 Received: from plane.gmane.org ([80.91.229.3]:40790) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVa6y-0005Nr-HV for emacs-orgmode@gnu.org; Tue, 16 Feb 2016 02:31:52 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1aVa6w-0005Cv-Nj for emacs-orgmode@gnu.org; Tue, 16 Feb 2016 08:31:50 +0100 Received: from p57acd2d9.dip0.t-ipconnect.de ([87.172.210.217]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 16 Feb 2016 08:31:50 +0100 Received: from dieter by p57acd2d9.dip0.t-ipconnect.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 16 Feb 2016 08:31:50 +0100 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 > > Try this > > | N | | > |---+---| > | | | > | | | > | | | > | | | > #+TBLFM: $1..>$1= -1 + 1:: 2$1=1 > I don't know exactly why "N" is *not* erased but the following is working for me (org 8.2.10). | N | |-------| | 1 | | 2 | | 3 | | 4 | | 5 | #+TBLFM: $1=@#-1 > Placing point on the TBLFM line and doing C-c C-c should recalculate the > whole table. and C-u C-c C-* does it anywhere in the table. Dieter -- Best wishes H. Dieter Wilhelm Kelkheim, Germany From mboxrd@z Thu Jan 1 00:00:00 1970 From: Derek Feichtinger Subject: Re: org table with auto-incrementing numbers in a column Date: Tue, 16 Feb 2016 09:16:38 +0000 (UTC) Message-ID: References: <87a8n1yv6m.fsf@duenenhof-wilhelm.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40617) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVbkZ-0002S0-I7 for emacs-orgmode@gnu.org; Tue, 16 Feb 2016 04:16:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aVbkW-0005sN-7K for emacs-orgmode@gnu.org; Tue, 16 Feb 2016 04:16:51 -0500 Received: from plane.gmane.org ([80.91.229.3]:51184) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVbkV-0005sI-VN for emacs-orgmode@gnu.org; Tue, 16 Feb 2016 04:16:48 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1aVbkS-0007pz-RB for emacs-orgmode@gnu.org; Tue, 16 Feb 2016 10:16:45 +0100 Received: from dflt1w.psi.ch ([129.129.194.23]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 16 Feb 2016 10:16:44 +0100 Received: from dfeich by dflt1w.psi.ch with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 16 Feb 2016 10:16:44 +0100 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 > > > > Try this > > > > | N | | > > |---+---| > > | | | > > | | | > > | | | > > | | | > > #+TBLFM: $1..>$1= -1 + 1:: 2$1=1 > > Sorry, I had a typo from copying and replacing in my formula should be | N | | |---+---| | 1 | | | 2 | | | 3 | | | 4 | | #+TBLFM: 3$1..>$1= -1 + 1:: 2$1=1 > > I don't know exactly why "N" is *not* erased but the following is > working for me (org 8.2.10). Hmmm... I just tested. Seems that org is treating the cells before the first horizontal separator line as special... nice. But I seem to remember that this was not always like this. This made me now investigate more closely, using the formula debugger (C-c {) for investigating the original formula. When I use this formula #+TBLFM: $1= @-1 + 1:: @2$1=1 Then org will first fill this part of the table (starting at cell 2$1) | N | | |---+---| | | | | 1 | | | 2 | | | 3 | | #+TBLFM: $1= -1 + 1:: 2$1=1 Then it will execute the second formula, which sets the value in row 2: | N | | |---+---| | 1 | | | 1 | | | 2 | | | 3 | | Only upon a second evaluation of the whole table, it will arrive at | N | | |---+---| | 1 | | | 2 | | | 3 | | | 4 | | So, this is one of the cases where one needs to carry our iterations until the table stays constant (can use org-table-iterate). I also tried the same with changing the order of the two formulas. Seems that the row formula always is executed first. So, at least this is consistent. Why it starts at row 3 one would need to look up in the source... > > | N | > |-------| > | 1 | > | 2 | > | 3 | > | 4 | > | 5 | > #+TBLFM: $1= #-1 > > > Placing point on the TBLFM line and doing C-c C-c should recalculate the > > whole table. That formula works fine. It's just a difference in functionality.. the above formula calculates a value based on the numeric position of the current row, while the other formula looks up the value above the current row. Cheers, Derek From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric S Fraga Subject: Re: org table with auto-incrementing numbers in a column Date: Tue, 16 Feb 2016 09:58:53 +0000 Message-ID: <87ziv1rn6q.fsf@ucl.ac.uk> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48660) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVcPw-0006xE-2Q for emacs-orgmode@gnu.org; Tue, 16 Feb 2016 04:59:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aVcPs-00076D-RC for emacs-orgmode@gnu.org; Tue, 16 Feb 2016 04:59:35 -0500 Received: from mail-db3on0102.outbound.protection.outlook.com ([157.55.234.102]:11837 helo=emea01-db3-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVcPs-00075B-Ik for emacs-orgmode@gnu.org; Tue, 16 Feb 2016 04:59:32 -0500 In-Reply-To: (Derek Feichtinger's message of "Tue, 16 Feb 2016 06:22:43 +0000") 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: Derek Feichtinger Cc: emacs-orgmode@gnu.org On Tuesday, 16 Feb 2016 at 06:22, Derek Feichtinger wrote: [...] > Placing point on the TBLFM line and doing C-c C-c should recalculate > the whole table. as should C-u C-c C-c anywhere in the table. -- : Eric S Fraga (0xFFFCF67D), Emacs 24.5.1, Org release_8.3.2-164-g50a182 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi Subject: Re: org table with auto-incrementing numbers in a column Date: Tue, 16 Feb 2016 11:28:08 -0500 Message-ID: References: <87ziv1rn6q.fsf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c30c2cc5e255052be5a054 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40658) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aViUs-0001Zx-BR for emacs-orgmode@gnu.org; Tue, 16 Feb 2016 11:29:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aViUq-0005aL-W8 for emacs-orgmode@gnu.org; Tue, 16 Feb 2016 11:29:06 -0500 Received: from mail-ob0-x231.google.com ([2607:f8b0:4003:c01::231]:35060) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aViUq-0005aE-PL for emacs-orgmode@gnu.org; Tue, 16 Feb 2016 11:29:04 -0500 Received: by mail-ob0-x231.google.com with SMTP id xk3so265143920obc.2 for ; Tue, 16 Feb 2016 08:29:04 -0800 (PST) In-Reply-To: <87ziv1rn6q.fsf@ucl.ac.uk> 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: Derek Feichtinger , emacs-org list --001a11c30c2cc5e255052be5a054 Content-Type: text/plain; charset=UTF-8 Thanks everyone for replying! I made one mistake before posting that question: I should have looked up C-h f org-table-recalculate. And now I did :) I should have done "C-u C-c * " when the point was in the table (I was doing just C-c *, which evaluates only the current row). >> Derek > | N | | > |---+---| > | | | > | | | > | | | > | | | > #+TBLFM: @3$1..@>$1=@-1 + 1::@2$1=1 Thanks Derek! That worked! btw I was a bit perplexed looking at your solution because it showed "" instead of "@" :) > One problem is that $1 also includes the first row with the "N" heading. > that is why in your example the second and third lines both will at first > contain 1 (at least with my org version 8.3.3), and in the second iteration > only show the correct series. I just learned that doing "C-u C-u C-c C-c" or "C-u C-u C-c *" with the point anywhere on the table, keeps re-evaluating the whole table till the values are stable. (NOTE that these do not work when point is on the #+TBLFM line; the point HAS to be inside the table). So the original example also works just fine if I use C-u C-u C-c C-c | N | | |---+---| | | | | | | | | | | | | #+TBLFM: $1=@-1+1::@2$1=1 >> Dieter Thanks! Your solution works too, with C-u C-c C-c anywhere in the table. | N | |---| | | | | | | | | #+TBLFM: $1=@#-1 That said, can someone please update that FAQ at http://orgmode.org/worg/org-faq.html#fill-table-column-with-incremental-numbers It would be great to mention C-u C-c C-c and C-u C-u C-c C-c in that solution too. --001a11c30c2cc5e255052be5a054 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks everyone for replying!

I made = one mistake before posting that question: I should have looked up C-h f org= -table-recalculate. And now I did :)
I shou= ld have done "C-u C-c * " when the point was in the table (I was = doing just C-c *, which evaluates only the current row).

>> Derek
> | N | =C2=A0 |
=
> |---+---|
&= gt; | =C2=A0 | =C2=A0 |
> | =C2=A0 | =C2= =A0 |
> | =C2=A0 | =C2=A0 |
> | =C2=A0 | =C2=A0 |
> #+TBLFM: @3$1..@>$1=3D@-1 + 1::@2$1=3D1

= Thanks Derek! That worked! btw I was a bit perplexed looking at your soluti= on because it showed "<at>" instead of "@" :)

> One problem is = that $1 also includes the first row with the "N" heading.<= br style=3D"font-size:12.8px">> that is= why in your example the second and third lines both will at first> contain = 1 (at least with my org version 8.3.3), and in the second iteration<= br style=3D"font-size:12.8px">> only sh= ow the correct series.

I just learned tha= t doing "C-u C-u C-c C-c" or "C-u C-u C-c *" with the p= oint anywhere on the table, keeps re-evaluating the whole table till the va= lues are stable. (NOTE that these do not work when point is on the #+TBLFM = line; the point HAS to be inside the table).

So the original example also works just fine if I use C-u C-u C-c C-c

| N | =C2=A0 |
|---+---|
| =C2=A0 | =C2=A0 |
| =C2=A0 | =C2=A0 |
| =C2=A0 | =C2=A0 |
| =C2=A0 | =C2=A0= |
#+TBLFM: $1= =3D@-1+1::@2$1=3D1

>> Dieter

Thanks! Your soluti= on works too, with C-u C-c C-c anywhere in the table.

| N |
|---|
| =C2=A0 |
|= =C2=A0 |
| =C2=A0 |
| =C2=A0 |
#+TBL= FM: $1=3D@#-1

That said, can someone please update that FAQ= at=C2=A0http://orgmode.org/worg/org-faq.html#fill-table-c= olumn-with-incremental-numbers
It would be great to me= ntion C-u C-c C-c and C-u C-u C-c C-c in that solution too.
--001a11c30c2cc5e255052be5a054-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: org table with auto-incrementing numbers in a column Date: Tue, 16 Feb 2016 17:51:19 +0100 Message-ID: <87io1oppiw.fsf@nicolasgoaziou.fr> References: <87a8n1yv6m.fsf@duenenhof-wilhelm.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47748) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVioR-0003E3-8z for emacs-orgmode@gnu.org; Tue, 16 Feb 2016 11:49:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aVioO-0002a5-2R for emacs-orgmode@gnu.org; Tue, 16 Feb 2016 11:49:19 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:55553) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aVioN-0002a1-Sd for emacs-orgmode@gnu.org; Tue, 16 Feb 2016 11:49:16 -0500 In-Reply-To: (Derek Feichtinger's message of "Tue, 16 Feb 2016 09:16:38 +0000 (UTC)") 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: Derek Feichtinger Cc: emacs-orgmode@gnu.org Hello, Derek Feichtinger writes: > When I use this formula > > #+TBLFM: $1= @-1 + 1:: @2$1=1 > > Then org will first fill this part of the table (starting at cell 2$1) > > | N | | > |---+---| > | | | > | 1 | | > | 2 | | > | 3 | | > #+TBLFM: $1= -1 + 1:: 2$1=1 > > Then it will execute the second formula, which sets the value in row 2: > > | N | | > |---+---| > | 1 | | > | 1 | | > | 2 | | > | 3 | | > > Only upon a second evaluation of the whole table, it will arrive at > > | N | | > |---+---| > | 1 | | > | 2 | | > | 3 | | > | 4 | | > > So, this is one of the cases where one needs to carry our iterations until > the table stays constant (can use org-table-iterate). > > I also tried the same with changing the order of the two formulas. Seems > that the row formula always is executed first. So, at least this is > consistent. Why it starts at row 3 one would need to look up in the > source... Field formulas bind stronger than column formulas. First, all cells with an associated field formula are marked as read-only. Then column formulas are evaluated. Eventually, fields formulas are evaluated. This was introduced in Org 5.01, AFAICT. Before, the "read-only" part would not happens, i.e, fields formulas would overwrite column formulas. I think the idea behind this is that formulas are applied to the current state of the table, not some intermediate one, with some formulas applied and others not. Regards, -- Nicolas Goaziou