From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dima Kogan Subject: Re: Adding new table rows/cols in a formula update Date: Tue, 30 Sep 2014 12:27:52 -0700 Message-ID: <87fvf8hpqw.fsf@secretsauce.net> References: <87k34mgvup.fsf@secretsauce.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59480) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XZ36Q-0006EZ-Av for emacs-orgmode@gnu.org; Tue, 30 Sep 2014 15:28:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XZ36K-0001qX-Ld for emacs-orgmode@gnu.org; Tue, 30 Sep 2014 15:28:50 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:39618) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XZ36K-0001qI-HR for emacs-orgmode@gnu.org; Tue, 30 Sep 2014 15:28:44 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by gateway2.nyi.internal (Postfix) with ESMTP id 0D1F020A52 for ; Tue, 30 Sep 2014 15:28:41 -0400 (EDT) Received: from shorty.local (unknown [23.243.192.221]) by mail.messagingengine.com (Postfix) with ESMTPA id CA3D7C00006 for ; Tue, 30 Sep 2014 15:28:40 -0400 (EDT) Received: from dima by shorty.local with local (Exim 4.82_1-5b7a7c0-XX) (envelope-from ) id 1XZ36F-00049d-BJ for emacs-orgmode@gnu.org; Tue, 30 Sep 2014 12:28:39 -0700 In-reply-to: <87k34mgvup.fsf@secretsauce.net> 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 --=-=-= Content-Type: text/plain Dima Kogan writes: > Suppose I have this .org file: > > | | > #+TBLFM: @1$2=5 > > It's a 1x1 table with a formula. The formula sets a cell that's out of > bounds in the table, so evaluating this formula results in an error. How > set-in-stone is this behavior? I haven't dug too deeply into the code, > but are there fundamental assumptions here? Would a patch that extends > the table before applying such a formula be too naive in some way? Here's a tiny patch that adds the columns (not rows) as needed. Is this reasonable? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-org-table-field-formulas-can-now-create-new-columns-.patch >From 93e9927dd49d100036853963e899c8b6af5325de Mon Sep 17 00:00:00 2001 From: Dima Kogan Date: Tue, 30 Sep 2014 12:27:26 -0700 Subject: [PATCH] org-table: field formulas can now create new columns as needed --- lisp/org-table.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/org-table.el b/lisp/org-table.el index 7607ead..31365ad 100644 --- a/lisp/org-table.el +++ b/lisp/org-table.el @@ -3125,7 +3125,7 @@ known that the table will be realigned a little later anyway." (while (setq eq (pop eqlname1)) (message "Re-applying formula to field: %s" (car eq)) (org-goto-line (nth 1 eq)) - (org-table-goto-column (nth 2 eq)) + (org-table-goto-column (nth 2 eq) nil 'force) (org-table-eval-formula nil (nth 3 eq) 'noalign 'nocst 'nostore 'noanalysis)) -- 2.0.0 --=-=-=--