From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id wASaD8dG/17xHwAA0tVLHw (envelope-from ) for ; Fri, 03 Jul 2020 14:55:03 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id KLt1C8dG/15POAAA1q6Kng (envelope-from ) for ; Fri, 03 Jul 2020 14:55:03 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 6EFCF94013C for ; Fri, 3 Jul 2020 14:55:02 +0000 (UTC) Received: from localhost ([::1]:50834 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jrN5g-0002BU-73 for larch@yhetil.org; Fri, 03 Jul 2020 10:55:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42244) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jrN5J-0002B1-N3 for emacs-orgmode@gnu.org; Fri, 03 Jul 2020 10:54:37 -0400 Received: from confino.investici.org ([2a00:c38:11e:ffff::a020]:20775) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jrN5F-0006JW-Qk for emacs-orgmode@gnu.org; Fri, 03 Jul 2020 10:54:37 -0400 Received: from mx1.investici.org (unknown [127.0.0.1]) by confino.investici.org (Postfix) with ESMTP id A5EDE213B1; Fri, 3 Jul 2020 14:54:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anche.no; s=stigmate; t=1593788061; bh=l+iSuA+Wek1Wpd+T9F2b9SuPDDcpX4CnVJQ75cb41O4=; h=Subject:From:To:References:Date:In-Reply-To:From; b=ULmCiFb/6JUxJqkN55eP/NwnQtomplUT6LPF9N5PsJJO++0fme1LZbmBXdqMnkQqV /LZtfdyRuzN+z+UvCV9nHpXcLFRjv1Abp2xEUeV2fuoERmULjZmKXMhuF0fwvi6f30 XbdGJDeB7KDKRSAqSd1Z/Lkk6uZVYkILEq6kXgiM= Received: from [212.103.72.250] (mx1.investici.org [212.103.72.250]) (Authenticated sender: mariotomo@inventati.org) by localhost (Postfix) with ESMTPSA id 952D02134F; Fri, 3 Jul 2020 14:54:20 +0000 (UTC) Subject: bug: Row descriptor <...> leads outside table From: Mario Frasca To: emacs-orgmode@gnu.org References: Message-ID: Date: Fri, 3 Jul 2020 09:53:36 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Received-SPF: pass client-ip=2a00:c38:11e:ffff::a020; envelope-from=mario@anche.no; helo=confino.investici.org X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=anche.no header.s=stigmate header.b=ULmCiFb/; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -1.21 X-TUID: qEoPZr70iwBd hi again, I haven't found how to solve this, short of removing the evaluation of `user-error' from the org-table.el code, or stuffing my TBLFM line with field formulas. a very simple use case: three columns: the date, a daily measurement, and a running 4-days average. |  date | measure | running avg ||-------+---------+-------------|| 01-27 |     604 | skipped     || 01-28 |     314 | skipped     || 01-29 |     636 | skipped     || 01-30 |     305 | skipped     || 01-31 |     760 | skipped     || 02-01 |     531 | skipped     || 02-02 |     331 | nil         || 02-03 |      77 | nil         || 02-04 |     621 | nil         || 02-05 |     406 | nil         || 02-06 |     621 | nil         || 02-07 |     975 | nil         || 02-08 |     252 | nil         || 02-09 |     794 | nil         || 02-10 |      36 | nil         |#+TBLFM: $3='(unless (> @# 7) "skipped") #+TBLFM: $3='(when (> @# 7) (/ (apply #'+ '(@-6$2..$2)) 7.0));N%0.2f #+TBLFM: $3='(/ (apply #'+ '(@-6$2..$2)) 7.0);N%0.2f::@2$3='(string)::@3$3='(string)::@4$3='(string)::@5$3='(string)::@6$3='(string)::@7$3='(string) the first TBLFM shows you which cells I'm skipping, that is, where I'm not applying the @-6 reference.  the status of the table results from evaluation of that TBLFM line. the second TBLFM line skips all @-6 references, but still fails with the message user-error: Row descriptor -6 leads outside table the third TBLFM line "solves" the problem, in one of the ugliestests ways. how would you people approach this? On 29/06/2020 12:03, Mario Frasca wrote: > Hi, > > I need some help understanding how to use org-mode/org-table for > references leading outside my table. > > I have a series of daily figures, and I am computing the series of > running sums.  column one is the daily data, column two is the running > sum of the preceding 14 values from column 1. > > http://ix.io/2qu7 > > problem is the @-13$1 reference in the function for the second column: > it hits a software-generated "user-error: Row descriptor -13 leads > outside table". > > this happens even if the formula says (if (> @# 13) (apply '+ > '(@-13$1..$1)) 0), that is, even if the formula is not evaluated on > the cells where the reference does indeed lead out of the table. > > this happens around line 2809 of org-table.el, inside org-table--row-type > > I've tried to catch the user-error with a `condition-case', but even > there, the error seems to happen before evaluation. > > I've replaced the `(user-error)' function with a `nil', and it works > for me, but that's a very rough measure I'm afraid. >