From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id SC1YDzOVB19ldQAA0tVLHw (envelope-from ) for ; Thu, 09 Jul 2020 22:07:47 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id iJEmCzOVB18mCgAAB5/wlQ (envelope-from ) for ; Thu, 09 Jul 2020 22:07:47 +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 34E87940DC7 for ; Thu, 9 Jul 2020 22:07:46 +0000 (UTC) Received: from localhost ([::1]:33232 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jtehj-0003YD-QL for larch@yhetil.org; Thu, 09 Jul 2020 18:07:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37656) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jtehL-0003Y4-FN for emacs-orgmode@gnu.org; Thu, 09 Jul 2020 18:07:19 -0400 Received: from latitanza.investici.org ([2001:888:2000:56::19]:21223) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jtehI-00034z-9O for emacs-orgmode@gnu.org; Thu, 09 Jul 2020 18:07:19 -0400 Received: from mx3.investici.org (unknown [127.0.0.1]) by latitanza.investici.org (Postfix) with ESMTP id E1A0A1201C4; Thu, 9 Jul 2020 22:07:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anche.no; s=stigmate; t=1594332432; bh=fX50JQyEmHJOX+H/qOGDCri0mexxUENMFbx4fJ8SNsw=; h=Subject:References:To:From:Date:In-Reply-To:From; b=OOMXVt5Fyuqt9fXgQN9RCV3t5Z45vk20zt+8UmAY0J6oWdK9plil8jDiDmh1/aWOy e/2hT6BvK5W0t2pNziW+Rh0uc+H7OBZxuMjHuWtqv7zvIW50hqoPmlyKjMv/CMPZH9 wUIqloXhvaGZ0tQNVmkwsSFgALOR/EhyqJBNm9IM= Received: from [82.94.249.234] (mx3.investici.org [82.94.249.234]) (Authenticated sender: mariotomo@inventati.org) by localhost (Postfix) with ESMTPSA id 7F63512018C; Thu, 9 Jul 2020 22:07:10 +0000 (UTC) Subject: Re: empty/nil in table cells References: <87a7084afo.fsf@nicolasgoaziou.fr> To: emacs-orgmode@gnu.org From: Mario Frasca Message-ID: Date: Thu, 9 Jul 2020 17:06:16 -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: <87a7084afo.fsf@nicolasgoaziou.fr> Content-Type: multipart/mixed; boundary="------------5745D39ED7A08D2FAD4C269D" Content-Language: en-US Received-SPF: pass client-ip=2001:888:2000:56::19; envelope-from=mario@anche.no; helo=latitanza.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, HTML_MESSAGE=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no 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=OOMXVt5F; 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: 8QxZsa63gS9r This is a multi-part message in MIME format. --------------5745D39ED7A08D2FAD4C269D Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit I think we really need a bug-tracking mechanism, you know? see attachment On 09/07/2020 16:59, Nicolas Goaziou wrote: > Hello, > > Mario Frasca writes: > >> I've been experimenting with associating the empty cell with the value >> nil, > Where? > >> both ways, > What do you mean? > >> and it simplifies a lot writing functions. > How so? > >> also, I've removed the error generation when reading from outside the >> table (instead of giving up with a user-error, I now get a nil). > Would you mind explaining? > >> it works for me, and I don't see counterindications.  is it >> worthwhile, offering you the patch? > Thank you. It may be so, but I may be missing some context. > > Regards, --------------5745D39ED7A08D2FAD4C269D Content-Type: message/rfc822; name="bug: Row descriptor <...> leads outside table.eml" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="bug: Row descriptor <...> leads outside table.eml" X-Mozilla-Keys: Return-Path: Delivered-To: mariotomo@inventati.org Received: from 3.mail-backend.investici.org by 3.mail-backend.investici.org with LMTP id uDzJLRBH/14BFQAA89+1pA (envelope-from ) for ; Fri, 03 Jul 2020 14:56:16 +0000 Received: from confino.investici.org (unknown [10.0.0.2]) by 3.mail-backend.investici.org (Postfix) with ESMTP id BCBAB8010B for ; Fri, 3 Jul 2020 14:56:12 +0000 (UTC) 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 X-Spam-Status: No, score=-1.0 required=3.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on spamassassin.investici.org 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-- --------------5745D39ED7A08D2FAD4C269D--