From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id WGCwAEFH/14KHgAA0tVLHw (envelope-from ) for ; Fri, 03 Jul 2020 14:57:05 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id oKjPN0BH/15QQAAAbx9fmQ (envelope-from ) for ; Fri, 03 Jul 2020 14:57:04 +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 5328E94030A for ; Fri, 3 Jul 2020 14:57:04 +0000 (UTC) Received: from localhost ([::1]:53706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jrN7e-0003Y0-NJ for larch@yhetil.org; Fri, 03 Jul 2020 10:57:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42532) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jrN6u-0003WL-QS for emacs-orgmode@gnu.org; Fri, 03 Jul 2020 10:56:16 -0400 Received: from confino.investici.org ([212.103.72.250]:24731) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jrN6s-0006i1-Et for emacs-orgmode@gnu.org; Fri, 03 Jul 2020 10:56:16 -0400 Received: from mx1.investici.org (unknown [127.0.0.1]) by confino.investici.org (Postfix) with ESMTP id AC390213B4; Fri, 3 Jul 2020 14:56:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anche.no; s=stigmate; t=1593788172; bh=hoePZqXoT8fxMHLNuxsQGQc93X4np8RDe3TFtkKMywI=; h=Subject:From:To:References:Date:In-Reply-To:From; b=bPvCdD94qaCqcSMOeGNaz+m4yEAheO+FMr2CCMBBm0qT+E9wNUroeV9ckNwMvzuLW +RK+HDzAQpVpw/LoFS9l+EOdT0qfskEMvNG3NeK3gZGQsXBCSaWsXjS1EQt6b5yC3C B+EuZiJSv+VcTDqKATS0H5kidqiOxUUE/KMokjbo= Received: from [212.103.72.250] (mx1.investici.org [212.103.72.250]) (Authenticated sender: mariotomo@inventati.org) by localhost (Postfix) with ESMTPSA id 9EC2D213B8; Fri, 3 Jul 2020 14:56:11 +0000 (UTC) Subject: Re: bug: Row descriptor <...> leads outside table From: Mario Frasca To: emacs-orgmode@gnu.org References: Message-ID: <7bc05b46-56da-6684-ee99-6541eb96e062@anche.no> Date: Fri, 3 Jul 2020 09:55:27 -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: multipart/alternative; boundary="------------5E33CE59B175D87DC02A37DF" Content-Language: en-US Received-SPF: pass client-ip=212.103.72.250; envelope-from=mario@anche.no; helo=confino.investici.org X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/03 10:56:12 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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=bPvCdD94; 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: FwYHbHVDNB8k This is a multi-part message in MIME format. --------------5E33CE59B175D87DC02A37DF Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit sorry for the messed up setting of the table, trying again, and adding a web-paste http://ix.io/2qMC | date | measure | running avg | |-------+---------+-------------| | 01-27 | 604 | | | 01-28 | 314 | | | 01-29 | 636 | | | 01-30 | 305 | | | 01-31 | 760 | | | 02-01 | 531 | | | 02-02 | 331 | 497.29 | | 02-03 | 77 | 422.00 | | 02-04 | 621 | 465.86 | | 02-05 | 406 | 433.00 | | 02-06 | 621 | 478.14 | | 02-07 | 975 | 508.86 | | 02-08 | 252 | 469.00 | | 02-09 | 794 | 535.14 | | 02-10 | 36 | 529.29 | #+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) On 03/07/2020 09:53, Mario Frasca wrote: > 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. >> --------------5E33CE59B175D87DC02A37DF Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

sorry for the messed up setting of the table, trying again, and adding a web-paste

http://ix.io/2qMC

|  date | measure | running avg |
|-------+---------+-------------|
| 01-27 |     604 |             |
| 01-28 |     314 |             |
| 01-29 |     636 |             |
| 01-30 |     305 |             |
| 01-31 |     760 |             |
| 02-01 |     531 |             |
| 02-02 |     331 |      497.29 |
| 02-03 |      77 |      422.00 |
| 02-04 |     621 |      465.86 |
| 02-05 |     406 |      433.00 |
| 02-06 |     621 |      478.14 |
| 02-07 |     975 |      508.86 |
| 02-08 |     252 |      469.00 |
| 02-09 |     794 |      535.14 |
| 02-10 |      36 |      529.29 |
#+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)

On 03/07/2020 09:53, Mario Frasca wrote:
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.

--------------5E33CE59B175D87DC02A37DF--