From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Banel Subject: Re: very long table calc expressions ? Date: Fri, 22 Jun 2018 19:22:33 +0200 Message-ID: <8ea720dd-5e20-cd5b-a2d6-8f69c174202a@free.fr> References: <87k1qu1yl5.fsf@mat.ucm.es> <87d0wknelv.fsf@norang.ca> <87a7rnglnq.fsf@mat.ucm.es> <874lhvnepj.fsf@norang.ca> <877emqgb4g.fsf@mat.ucm.es> <87sh5eetbv.fsf@mat.ucm.es> <87602aydhb.fsf@alphaville.usersys.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53295) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fWPm8-0004qp-TK for emacs-orgmode@gnu.org; Fri, 22 Jun 2018 13:23:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fWPm5-0005jv-O8 for emacs-orgmode@gnu.org; Fri, 22 Jun 2018 13:23:08 -0400 Received: from smtp1-g21.free.fr ([212.27.42.1]:37843) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fWPm5-0005jr-I5 for emacs-orgmode@gnu.org; Fri, 22 Jun 2018 13:23:05 -0400 Received: from [IPv6:2a01:e35:2e21:def0:61ac:ee16:ceba:ad6c] (unknown [IPv6:2a01:e35:2e21:def0:61ac:ee16:ceba:ad6c]) by smtp1-g21.free.fr (Postfix) with ESMTP id 27FEEB0054E for ; Fri, 22 Jun 2018 19:23:04 +0200 (CEST) In-Reply-To: <87602aydhb.fsf@alphaville.usersys.redhat.com> Content-Language: en-US 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" To: emacs-orgmode@gnu.org On 22/06/2018 18:48, Nick Dokos wrote: > Uwe Brauer writes: > >> Hi Jonathan >> >> > Hi Uwe, >> > On Fri, Jun 22, 2018 at 10:16 AM, Uwe Brauer wro= te: >> >> > (::) >> > not just a single. Brent's example has it with double while your= s only >> > shows >> > it with a single one. >> >> Right, thanks for clarifying that. My original example had various :: = and >> indeed there Bernt's advice helped.=20 >> >> Meanwhile Thierry posted a more sophisticated example containing only >> simple : >> (which does not work with ::) and that example cannot be dealt with = via=20 >> C-c '. >> >> @Thierry: that is correct? >> > The double colons separate different formulas. The single colons in Thi= erry's > formula are part of the syntax of a conditional expression, i.e. they = are part > of a *single* (long) formula. So yes, that cannot be dealt with via C-c= '. > A utility lisp function can enhance readability: #+begin_src elisp =C2=A0 (defun test-to-interval (x) =C2=A0=C2=A0=C2=A0 (let ((n (string-to-number x))) =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (cond =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((equal x "")=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 "NP") =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((and (<=3D 0 n) (<=3D n 4.9)) "SS") =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((and (<=3D 5 n) (<=3D n 6.9)) "AP") =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((and (<=3D 7 n) (<=3D n 8.9)) "NT") =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((and (<=3D 9 n) (<=3D n 10 )) "SB") =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (t=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0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