From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ciaran Mulloy Subject: Worg Tutorial error: using Emacs lisp as formulas Date: Tue, 26 Aug 2014 20:18:27 +0100 Message-ID: <53FCDD83.40206@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------010101080007030006090008" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55146) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMMGM-0006cs-Kr for emacs-orgmode@gnu.org; Tue, 26 Aug 2014 15:18:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMMGG-0002bU-QB for emacs-orgmode@gnu.org; Tue, 26 Aug 2014 15:18:38 -0400 Received: from mail-we0-x230.google.com ([2a00:1450:400c:c03::230]:57490) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMMGG-0002bO-KJ for emacs-orgmode@gnu.org; Tue, 26 Aug 2014 15:18:32 -0400 Received: by mail-we0-f176.google.com with SMTP id q58so15131322wes.21 for ; Tue, 26 Aug 2014 12:18:31 -0700 (PDT) Received: from [192.168.15.101] ([89.124.44.33]) by mx.google.com with ESMTPSA id w20sm15173981wie.7.2014.08.26.12.18.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 26 Aug 2014 12:18:30 -0700 (PDT) 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: org-mode This is a multi-part message in MIME format. --------------010101080007030006090008 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi! I was fascinated to work through the examples provided in the org-tutorials sections under Worg and really see the power of using eLisp as spreadsheet formula: http://orgmode.org/worg/org-tutorials/org-spreadsheet-lisp-formulas.html However the use of the mapconcat function always generated an error: Invalid regex "Regular expression too big", even with only a few terms in the formula. The offending formula was: #+TBLFM: @2$3='(mapconcat 'identity (delete-dups (list @2$1..@>$1 @2$2..@>$2)) " ") I experimented with variations of the formula getting the same error every time. I did a search of the org-mode forum without finding any solution. Any thoughts? Regard --------------010101080007030006090008 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi!
I was fascinated to work through the examples provided in the org-tutorials sections under Worg and really see the power of using eLisp as spreadsheet formula: http://orgmode.org/worg/org-tutorials/org-spreadsheet-lisp-formulas.html

However the use of the mapconcat function always generated an error: Invalid regex "Regular expression too big", even with only a few terms in the formula.

The offending formula was:
#+TBLFM: @2$3='(mapconcat 'identity (delete-dups (list @2$1..@>$1 @2$2..@>$2)) " ")

I experimented with variations of the formula getting the same error every time.

I did a search of the org-mode forum without finding any solution.

Any thoughts?

Regard --------------010101080007030006090008-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Worg Tutorial error: using Emacs lisp as formulas Date: Tue, 26 Aug 2014 22:52:08 -0400 Message-ID: <87a96qhcfb.fsf@alphaville.dokosmarshall.org> References: <53FCDD83.40206@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46506) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMTLa-00030i-Px for emacs-orgmode@gnu.org; Tue, 26 Aug 2014 22:52:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMTLT-0006eM-Ja for emacs-orgmode@gnu.org; Tue, 26 Aug 2014 22:52:30 -0400 Received: from plane.gmane.org ([80.91.229.3]:35936) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMTLT-0006e7-Cs for emacs-orgmode@gnu.org; Tue, 26 Aug 2014 22:52:23 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XMTLR-0004oK-JC for emacs-orgmode@gnu.org; Wed, 27 Aug 2014 04:52:21 +0200 Received: from pool-108-20-41-17.bstnma.fios.verizon.net ([108.20.41.17]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 27 Aug 2014 04:52:21 +0200 Received: from ndokos by pool-108-20-41-17.bstnma.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 27 Aug 2014 04:52:21 +0200 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 Ciaran Mulloy writes: > Hi! > I was fascinated to work through the examples provided in the org-tutorials sections under Worg and really see the power of using eLisp as spreadsheet formula: http://orgmode.org/worg/ > org-tutorials/org-spreadsheet-lisp-formulas.html > > However the use of the mapconcat function always generated an error: Invalid regex "Regular expression too big", even with only a few terms in the formula. > > The offending formula was: > > #+TBLFM: @2$3='(mapconcat 'identity (delete-dups (list @2$1..@>$1 @2$2..@>$2)) " ") > > I experimented with variations of the formula getting the same error every time. > > I did a search of the org-mode forum without finding any solution. > > Any thoughts? > I can't reproduce it - e.g. this --8<---------------cut here---------------start------------->8--- | one | two | three | four | five | |-----+-----+---------------+------+------| | a | a | a b c e f d g | | | | a | b | | | | | b | a | | | | | c | d | | | | | e | f | | | | | f | g | | | | | a | f | | | | #+TBLFM: @2$3='(mapconcat 'identity (delete-dups (list @2$1..@>$1 @2$2..@>$2)) " ") --8<---------------cut here---------------end--------------->8--- works fine for me. This is with more-or-less latest org. Moreover, none of the functions used (mapconcat, identity, delete-dups or list) use regexps at all. There is a chance that regexps are used by the evaluator when building the ranges, but it's unlikely IMO, so the regexp error seems like a red herring to me. How big a table did you try? Did you try restarting emacs and redoing the evaluation? How about starting emacs without any of your customizations and redoing the evaluation? Something like this emacs -q -l /path/to/minimal/init /path/to/file/with/the/table where the minimal init file just sets load-path if necessary and initializes org. -- Nick From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ciaran Mulloy Subject: Re: Worg Tutorial error: using Emacs lisp as formulas Date: Wed, 27 Aug 2014 08:21:37 +0100 Message-ID: <53FD8701.4060707@gmail.com> References: <53FCDD83.40206@gmail.com> <87a96qhcfb.fsf@alphaville.dokosmarshall.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56871) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMXYB-0000S6-Ey for emacs-orgmode@gnu.org; Wed, 27 Aug 2014 03:21:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMXY5-0007Be-L9 for emacs-orgmode@gnu.org; Wed, 27 Aug 2014 03:21:47 -0400 Received: from mail-wi0-x232.google.com ([2a00:1450:400c:c05::232]:54742) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMXY5-0007BR-Db for emacs-orgmode@gnu.org; Wed, 27 Aug 2014 03:21:41 -0400 Received: by mail-wi0-f178.google.com with SMTP id hi2so5263053wib.5 for ; Wed, 27 Aug 2014 00:21:40 -0700 (PDT) Received: from [192.168.15.102] ([89.124.44.33]) by mx.google.com with ESMTPSA id ua8sm14700975wjc.7.2014.08.27.00.21.39 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 27 Aug 2014 00:21:39 -0700 (PDT) In-Reply-To: <87a96qhcfb.fsf@alphaville.dokosmarshall.org> 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 On 27/08/14 03:52, Nick Dokos wrote: > Ciaran Mulloy writes: > >> Hi! >> I was fascinated to work through the examples provided in the org-tutorials sections under Worg and really see the power of using eLisp as spreadsheet formula: http://orgmode.org/worg/ >> org-tutorials/org-spreadsheet-lisp-formulas.html >> >> However the use of the mapconcat function always generated an error: Invalid regex "Regular expression too big", even with only a few terms in the formula. >> >> The offending formula was: >> >> #+TBLFM: @2$3='(mapconcat 'identity (delete-dups (list @2$1..@>$1 @2$2..@>$2)) " ") >> >> I experimented with variations of the formula getting the same error every time. >> >> I did a search of the org-mode forum without finding any solution. >> >> Any thoughts? >> > I can't reproduce it - e.g. this > > --8<---------------cut here---------------start------------->8--- > | one | two | three | four | five | > |-----+-----+---------------+------+------| > | a | a | a b c e f d g | | | > | a | b | | | | > | b | a | | | | > | c | d | | | | > | e | f | | | | > | f | g | | | | > | a | f | | | | > #+TBLFM: @2$3='(mapconcat 'identity (delete-dups (list @2$1..@>$1 @2$2..@>$2)) " ") > --8<---------------cut here---------------end--------------->8--- > > works fine for me. This is with more-or-less latest org. > > Moreover, none of the functions used (mapconcat, identity, delete-dups > or list) use regexps at all. There is a chance that regexps are used by > the evaluator when building the ranges, but it's unlikely IMO, so the > regexp error seems like a red herring to me. How big a table did you > try? Did you try restarting emacs and redoing the evaluation? How about > starting emacs without any of your customizations and redoing the > evaluation? Something like this > > emacs -q -l /path/to/minimal/init /path/to/file/with/the/table > > where the minimal init file just sets load-path if necessary and > initializes org. > Hi Nick, Many thanks for your input. The table I was trying was the example in the tutorial shown as follows (not big) and no hint of a regex!: | Col1 | Col2 | Col3 | Col4 | Col5 | |------+------+------+------+------| | a | a | :='(mapconcat 'identity (delete-dups (list @2$1..@>$1 @2$2..@>$2)) " ") | b | | | b | a | | | | | c | d | | | | #+TBLFM: @2$3='(mapconcat 'identity (delete-dups (list @2$1..@>$1 @2$2..@>$2)) " ") I did as you suggested and ran emacs -q -l ~/.emacs ~/path_to_file and got the same result as above: org-table-eval-formula: Invalid regexp: "Regular expression too big" The .emacs file is blank. The version of emacs is GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, ) of 2013-07-27 on roseapple, modified by Debian Org-mode version 7.9.3f (release_7.9.3f-17-g7524ef @ /usr/share/emacs/24.3/lisp/org/) Using Mint 17 Xfce. I don't think I'm doing something silly here but am at a loss to figure out the problem. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Worg Tutorial error: using Emacs lisp as formulas Date: Wed, 27 Aug 2014 07:52:20 -0400 Message-ID: <8761hegnez.fsf@alphaville.dokosmarshall.org> References: <53FCDD83.40206@gmail.com> <87a96qhcfb.fsf@alphaville.dokosmarshall.org> <53FD8701.4060707@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42165) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMbmT-0002lH-EN for emacs-orgmode@gnu.org; Wed, 27 Aug 2014 07:52:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMbmL-0001bT-U9 for emacs-orgmode@gnu.org; Wed, 27 Aug 2014 07:52:49 -0400 Received: from plane.gmane.org ([80.91.229.3]:33751) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMbmL-0001bE-Ns for emacs-orgmode@gnu.org; Wed, 27 Aug 2014 07:52:41 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XMbmE-0002Ww-90 for emacs-orgmode@gnu.org; Wed, 27 Aug 2014 13:52:34 +0200 Received: from pool-108-20-41-17.bstnma.fios.verizon.net ([108.20.41.17]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 27 Aug 2014 13:52:34 +0200 Received: from ndokos by pool-108-20-41-17.bstnma.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 27 Aug 2014 13:52:34 +0200 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 Ciaran Mulloy writes: > Hi Nick, > Many thanks for your input. > > The table I was trying was the example in the tutorial shown as follows > (not big) and no hint of a regex!: > > | Col1 | Col2 | Col3 | Col4 | Col5 | > |------+------+------+------+------| > | a | a | :='(mapconcat 'identity (delete-dups (list @2$1..@>$1 > @2$2..@>$2)) " ") | b | | > | b | a | | | | > | c | d | | | | > > #+TBLFM: @2$3='(mapconcat 'identity (delete-dups (list @2$1..@>$1 > @2$2..@>$2)) " ") > > I'm not sure where you got this: the tutorial's table does not have a field formula afaict. If you eliminate the field formula, the example works - just do C-c C-c on the #+TBLFM: line: --8<---------------cut here---------------start------------->8--- | Col1 | Col2 | Col3 | Col4 | Col5 | |------+------+---------+------+------| | a | a | | b | | | b | a | | | | | c | d | | | | #+TBLFM: @2$3='(mapconcat 'identity (delete-dups (list @2$1..@>$1 @2$2..@>$2)) " ") --8<---------------cut here---------------end--------------->8--- I don't know why the field formula fails. > > The version of emacs is GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, ) of > 2013-07-27 on roseapple, modified by Debian > Org-mode version 7.9.3f (release_7.9.3f-17-g7524ef @ > /usr/share/emacs/24.3/lisp/org/) > -- Nick From mboxrd@z Thu Jan 1 00:00:00 1970 From: ciaran_mulloy Subject: Re: Worg Tutorial error: using Emacs lisp as formulas Date: Wed, 27 Aug 2014 10:20:34 +0100 Message-ID: <53FDA2E2.7030502@druidsoftware.com> References: <53FCDD83.40206@gmail.com> <87a96qhcfb.fsf@alphaville.dokosmarshall.org> <53FD8701.4060707@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46683) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMZPJ-00005W-Fe for emacs-orgmode@gnu.org; Wed, 27 Aug 2014 05:20:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMZPD-00082U-BX for emacs-orgmode@gnu.org; Wed, 27 Aug 2014 05:20:45 -0400 Received: from www.druidsoftware.com ([148.251.52.124]:49168) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMZPC-000829-F0 for emacs-orgmode@gnu.org; Wed, 27 Aug 2014 05:20:38 -0400 Received: from localhost (unknown [127.0.0.1]) by www.druidsoftware.com (Postfix) with ESMTP id 340A117BA9A3 for ; Wed, 27 Aug 2014 09:20:36 +0000 (UTC) Received: from www.druidsoftware.com ([127.0.0.1]) by localhost (www.druidsoftware.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MDoGSqqr3-Lu for ; Wed, 27 Aug 2014 10:20:35 +0100 (IST) Received: from [172.28.2.159] (unknown [95.45.250.213]) (Authenticated sender: cmulloy@druidsoftware.com) by www.druidsoftware.com (Postfix) with ESMTPSA id 6161517BA9A2 for ; Wed, 27 Aug 2014 10:20:35 +0100 (IST) In-Reply-To: <53FD8701.4060707@gmail.com> 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 On 27/08/14 08:21, Ciaran Mulloy wrote: > On 27/08/14 03:52, Nick Dokos wrote: >> Ciaran Mulloy writes: >> >>> Hi! >>> I was fascinated to work through the examples provided in the >>> org-tutorials sections under Worg and really see the power of using >>> eLisp as spreadsheet formula: http://orgmode.org/worg/ >>> org-tutorials/org-spreadsheet-lisp-formulas.html >>> >>> However the use of the mapconcat function always generated an error: >>> Invalid regex "Regular expression too big", even with only a few >>> terms in the formula. >>> >>> The offending formula was: >>> >>> #+TBLFM: @2$3='(mapconcat 'identity (delete-dups (list @2$1..@>$1 >>> @2$2..@>$2)) " ") >>> >>> I experimented with variations of the formula getting the same error >>> every time. >>> >>> I did a search of the org-mode forum without finding any solution. >>> >>> Any thoughts? >>> >> I can't reproduce it - e.g. this >> >> --8<---------------cut here---------------start------------->8--- >> | one | two | three | four | five | >> |-----+-----+---------------+------+------| >> | a | a | a b c e f d g | | | >> | a | b | | | | >> | b | a | | | | >> | c | d | | | | >> | e | f | | | | >> | f | g | | | | >> | a | f | | | | >> #+TBLFM: @2$3='(mapconcat 'identity (delete-dups (list @2$1..@>$1 >> @2$2..@>$2)) " ") >> --8<---------------cut here---------------end--------------->8--- >> >> works fine for me. This is with more-or-less latest org. >> >> Moreover, none of the functions used (mapconcat, identity, delete-dups >> or list) use regexps at all. There is a chance that regexps are used by >> the evaluator when building the ranges, but it's unlikely IMO, so the >> regexp error seems like a red herring to me. How big a table did you >> try? Did you try restarting emacs and redoing the evaluation? How about >> starting emacs without any of your customizations and redoing the >> evaluation? Something like this >> >> emacs -q -l /path/to/minimal/init /path/to/file/with/the/table >> >> where the minimal init file just sets load-path if necessary and >> initializes org. >> > Hi Nick, > Many thanks for your input. > > The table I was trying was the example in the tutorial shown as follows > (not big) and no hint of a regex!: > > | Col1 | Col2 | Col3 | Col4 | Col5 | > |------+------+------+------+------| > | a | a | :='(mapconcat 'identity (delete-dups (list @2$1..@>$1 > @2$2..@>$2)) " ") | b | | > | b | a | | | | > | c | d | | | | > #+TBLFM: @2$3='(mapconcat 'identity (delete-dups (list @2$1..@>$1 > @2$2..@>$2)) " ") > > > I did as you suggested and ran emacs -q -l ~/.emacs ~/path_to_file and > got the same result as above: > > org-table-eval-formula: Invalid regexp: "Regular expression too big" > > The .emacs file is blank. > > The version of emacs is GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, ) of > 2013-07-27 on roseapple, modified by Debian > Org-mode version 7.9.3f (release_7.9.3f-17-g7524ef @ > /usr/share/emacs/24.3/lisp/org/) > > Using Mint 17 Xfce. > > I don't think I'm doing something silly here but am at a loss to figure > out the problem. > > > Hi, Further to my earlier posting, tried calculating the table on my PC in work and it worked! So I'm a little puzzled at what the differences are. Configurations as follows: GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.7) of 2014-03-07 on lamiak, modified by Debian Org-mode version 7.9.3f (release_7.9.3f-17-g7524ef @ /usr/share/emacs/24.3/lisp/org/) Cinnamon Mint 64 bit version 17 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrea Rossetti Subject: Re: Worg Tutorial error: using Emacs lisp as formulas Date: Wed, 27 Aug 2014 19:17:43 +0200 Message-ID: <84lhq9ua14.fsf@gmail.com> References: <53FCDD83.40206@gmail.com> <87a96qhcfb.fsf@alphaville.dokosmarshall.org> <53FD8701.4060707@gmail.com> <53FDA2E2.7030502@druidsoftware.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56833) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMgrB-0005XD-LU for emacs-orgmode@gnu.org; Wed, 27 Aug 2014 13:18:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMgr2-0005j2-JP for emacs-orgmode@gnu.org; Wed, 27 Aug 2014 13:18:01 -0400 Received: from mail-wg0-x234.google.com ([2a00:1450:400c:c00::234]:39481) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMgr2-0005ik-Ab for emacs-orgmode@gnu.org; Wed, 27 Aug 2014 13:17:52 -0400 Received: by mail-wg0-f52.google.com with SMTP id a1so501637wgh.23 for ; Wed, 27 Aug 2014 10:17:49 -0700 (PDT) In-Reply-To: <53FDA2E2.7030502@druidsoftware.com> (ciaran mulloy's message of "Wed, 27 Aug 2014 10:20:34 +0100") 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: ciaran_mulloy Cc: emacs-orgmode@gnu.org Hello Ciaran, given your example: > | Col1 | Col2 | Col3 | Col4 | Col5 | > |------+------+------+------+------| > | a | a | :='(mapconcat 'identity (delete-dups (list @2$1..@>$1 @2$2..@>$2)) " ") | b | | > | b | a | | | | > | c | d | | | | > #+TBLFM: @2$3='(mapconcat 'identity (delete-dups (list @2$1..@>$1 @2$2..@>$2)) " ") I confirm I see your same hitting C-c C-c in the cell containing the formula. My setup is: - Org 8.2.7c - GNU Emacs 24.3.1 (i386-mingw-nt6.1.7600) of 2013-03-17 on MARVIN - Win 7 Further observations I collected are: 1) if I use "II-1" instead of ">" in the formula (though it's not exactly the same) it works properly. 2) I tried to reduce the test case to a simpler formula: for example :='(length (list @2$1..@>$1)) gave me another, maybe more helpful error message: user-error: Spreadsheet error: invalid reference "'(length (list @2$1..@>$1))" toggle-debug-on-error did not work for case 2) because it's a "catched" error condition. Some random debugging made me think the problem lies in (or around) function `org-table-get-range'. Kindest regards, Andrea From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ciaran Mulloy Subject: Re: Worg Tutorial error: using Emacs lisp as formulas Date: Thu, 28 Aug 2014 00:29:38 +0100 Message-ID: <53FE69E2.8000509@gmail.com> References: <53FCDD83.40206@gmail.com> <87a96qhcfb.fsf@alphaville.dokosmarshall.org> <53FD8701.4060707@gmail.com> <8761hegnez.fsf@alphaville.dokosmarshall.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42689) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMmf1-0006IR-EY for emacs-orgmode@gnu.org; Wed, 27 Aug 2014 19:29:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMmev-0001lB-FN for emacs-orgmode@gnu.org; Wed, 27 Aug 2014 19:29:51 -0400 Received: from mail-we0-x22b.google.com ([2a00:1450:400c:c03::22b]:44905) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMmev-0001km-4f for emacs-orgmode@gnu.org; Wed, 27 Aug 2014 19:29:45 -0400 Received: by mail-we0-f171.google.com with SMTP id u56so5983wes.2 for ; Wed, 27 Aug 2014 16:29:42 -0700 (PDT) Received: from [192.168.15.102] ([89.124.44.33]) by mx.google.com with ESMTPSA id ky3sm4833632wjb.39.2014.08.27.16.29.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 27 Aug 2014 16:29:41 -0700 (PDT) In-Reply-To: <8761hegnez.fsf@alphaville.dokosmarshall.org> 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 On 27/08/14 12:52, Nick Dokos wrote: > Ciaran Mulloy writes: > >> Hi Nick, >> Many thanks for your input. >> >> The table I was trying was the example in the tutorial shown as follows >> (not big) and no hint of a regex!: >> >> | Col1 | Col2 | Col3 | Col4 | Col5 | >> |------+------+------+------+------| >> | a | a | :='(mapconcat 'identity (delete-dups (list @2$1..@>$1 >> @2$2..@>$2)) " ") | b | | >> | b | a | | | | >> | c | d | | | | >> >> #+TBLFM: @2$3='(mapconcat 'identity (delete-dups (list @2$1..@>$1 >> @2$2..@>$2)) " ") >> >> > I'm not sure where you got this: the tutorial's table does not have a > field formula afaict. If you eliminate the field formula, the example > works - just do C-c C-c on the #+TBLFM: line: > > --8<---------------cut here---------------start------------->8--- > | Col1 | Col2 | Col3 | Col4 | Col5 | > |------+------+---------+------+------| > | a | a | | b | | > | b | a | | | | > | c | d | | | | > #+TBLFM: @2$3='(mapconcat 'identity (delete-dups (list @2$1..@>$1 @2$2..@>$2)) " ") > --8<---------------cut here---------------end--------------->8--- > > I don't know why the field formula fails. > >> The version of emacs is GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, ) of >> 2013-07-27 on roseapple, modified by Debian >> Org-mode version 7.9.3f (release_7.9.3f-17-g7524ef @ >> /usr/share/emacs/24.3/lisp/org/) >> Hi Guys, Some definite strangeness that I'd love to get to the bottom of, if only to preserve my sanity and understanding of how Org-Mode works! The following is the example given in the excellent Worg tutorial on using Emacs Lisp in spreadsheet formulas: http://orgmode.org/worg/org-tutorials/org-spreadsheet-lisp-formulas.html | Col1 | Col2 | Col3 | Col4 | Col5 | |------+------+------+------+------| | a | a | | d | | | a | b | | | | | b | a | | | | | c | d | | | | Inserting the following as a field formula in location @2$3: :='(mapconcat 'identity (delete-dups (list @2$1..@>$1 @2$2..@>$2)) " ") and doing a C-c or a C-u-C-c C-c generates an 'Invalid regexp: "Regular expression too big"' error. I used the formula debug option C-{ to enable formula debugging and got the following result: With the debugging formula on, when the debugger asks whether to continue on the newly entered formula I get the following output and the error is resolved and formula properly calculated as shown below. This is the output provided by the formula debugger: Substitution history of formula Orig: '(mapconcat 'identity (delete-dups (list @2$1..@5$1 @2$2..@5$2)) " ") $xyz-> '(mapconcat 'identity (delete-dups (list @2$1..@5$1 @2$2..@5$2)) " ") @r$c-> '(mapconcat 'identity (delete-dups (list #("a" 0 1 (fontified nil org-category "spreadsheets" face org-table)) #("a" 0 1 (fontified t org-category "spreadsheets" face org-table)) #("b" 0 1 (fontified t org-category "spreadsheets" face org-table)) #("c" 0 1 (fontified t org-category "spreadsheets" face org-table)) #("a" 0 1 (fontified nil org-category "spreadsheets" face org-table)) #("b" 0 1 (fontified t org-category "spreadsheets" face org-table)) #("a" 0 1 (fontified t org-category "spreadsheets" face org-table)) #("d" 0 1 (fontified t org-category "spreadsheets" face org-table)))) " ") $1-> '(mapconcat 'identity (delete-dups (list #("a" 0 1 (fontified nil org-category "spreadsheets" face org-table)) #("a" 0 1 (fontified t org-category "spreadsheets" face org-table)) #("b" 0 1 (fontified t org-category "spreadsheets" face org-table)) #("c" 0 1 (fontified t org-category "spreadsheets" face org-table)) #("a" 0 1 (fontified nil org-category "spreadsheets" face org-table)) #("b" 0 1 (fontified t org-category "spreadsheets" face org-table)) #("a" 0 1 (fontified t org-category "spreadsheets" face org-table)) #("d" 0 1 (fontified t org-category "spreadsheets" face org-table)))) " ") Result: a b c d Format: NONE Final: a b c d After The formula was correctly resolved and shows the following result correctly: | Col1 | Col2 | Col3 | Col4 | Col5 | |------+------+---------+------+------| | a | a | a b c d | d | | | a | b | | | | | b | a | | | | | c | d | | | | #+TBLFM: @2$3='(mapconcat 'identity (delete-dups (list @2$1..@>$1 @2$2..@>$2)) " ") The output in the messages file is as follows: Loading 00debian-vars...done Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)... Loading debian-ispell... Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...done Loading debian-ispell...done Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...done Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...done For information about GNU Emacs and the GNU system, type C-h C-a. Loading vc-git...done Formula debugging has been turned on Re-applying formulas to full table... Re-applying formula to field: @2$3 Re-applying formulas to full table...(line 3) Re-applying formula to field: @2$3 Debugging Formula. Continue to next? (y or n) n user-error: Abort byte-code: Beginning of buffer [10 times] Auto-saving...done Mark set org-table-eval-formula: Invalid regexp: "Regular expression too big" [2 times] Re-applying formulas to full table... Re-applying formula to field: @2$3 Re-applying formula to field: @3$3 Re-applying formulas to full table...(line 3) Re-applying formula to field: @2$3 Debugging Formula. Continue to next? (y or n) y Re-applying formula to field: @3$3 Debugging Formula. Continue to next? (y or n) y Re-applying formulas to 3 lines...done Re-applying formulas...done [2 times] Mark set org-table-eval-formula: Invalid regexp: "Regular expression too big" [2 times] byte-code: End of buffer Re-applying formulas to full table... Re-applying formula to field: @2$3 Re-applying formula to field: @3$3 Re-applying formula to field: @4$3 Re-applying formulas to full table...(line 3) Re-applying formula to field: @2$3 Debugging Formula. Continue to next? (y or n) y Re-applying formula to field: @3$3 Debugging Formula. Continue to next? (y or n) y Re-applying formula to field: @4$3 Debugging Formula. Continue to next? (y or n) y Re-applying formulas to 3 lines...done Re-applying formulas...done [2 times] Auto-saving...done Mark set org-table-eval-formula: Invalid regexp: "Regular expression too big" Auto-saving... byte-code: End of buffer Re-applying formulas to full table... Re-applying formula to field: @2$3 Re-applying formula to field: @2$5 Re-applying formula to field: @3$3 Re-applying formula to field: @4$3 Re-applying formulas to full table...(line 3) Re-applying formula to field: @2$3 Debugging Formula. Continue to next? (y or n) y Re-applying formula to field: @2$5 Debugging Formula. Continue to next? (y or n) y Re-applying formula to field: @3$3 Debugging Formula. Continue to next? (y or n) y Re-applying formula to field: @4$3 Debugging Formula. Continue to next? (y or n) y Re-applying formulas to 3 lines...done Re-applying formulas...done [2 times] Mark set org-table-eval-formula: Invalid regexp: "Regular expression too big" [2 times] Formula debugging has been turned off Formula debugging has been turned on Formula debugging has been turned off Formula debugging has been turned on Mark set [2 times] org-table-eval-formula: Invalid regexp: "Regular expression too big" Formula debugging has been turned off Formula debugging has been turned on Re-applying formulas to full table... Re-applying formula to field: @2$3 Re-applying formulas to full table...(line 4) Re-applying formula to field: @2$3 Debugging Formula. Continue to next? (y or n) n user-error: Abort Mark set [4 times] Auto-saving... Mark set Visual-Line mode enabled Re-applying formulas to full table... Re-applying formula to field: @2$3 Re-applying formulas to full table...(line 4) Re-applying formula to field: @2$3 Debugging Formula. Continue to next? (y or n) y Re-applying formulas to 4 lines...done Re-applying formulas...done [2 times] Auto-saving... Mark set org-table-eval-formula: Invalid regexp: "Regular expression too big" [2 times] call-interactively: No recursive edit is in progress Formula debugging has been turned off Formula debugging has been turned on Saving file /home/crmulloy/.emacs.d/init.el... Wrote /home/crmulloy/.emacs.d/init.el [2 times] File added to front of agenda file list Formula debugging has been turned off Formula debugging has been turned on Re-applying formulas to full table... Re-applying formula to field: @2$3 Re-applying formula to field: @3$3 Re-applying formulas to full table...(line 4) Re-applying formula to field: @2$3 Debugging Formula. Continue to next? (y or n) y Re-applying formula to field: @3$3 Debugging Formula. Continue to next? (y or n) y Re-applying formulas to 4 lines...done Re-applying formulas...done [2 times] byte-code: Beginning of buffer [5 times] Auto-saving...done Mark set Auto-saving...done Tables Row/Column numbers display turned on Auto-saving...done byte-code: End of buffer Mark set org-table-eval-formula: Invalid regexp: "Regular expression too big" Re-applying formulas to full table... Re-applying formula to field: @2$3 Re-applying formulas to full table...(line 4) Re-applying formula to field: @2$3 Debugging Formula. Continue to next? (y or n) y Re-applying formulas to 4 lines...done Re-applying formulas...done [2 times] Auto-saving...done Mark set [2 times] org-table-eval-formula: Invalid regexp: "Regular expression too big" [2 times] Re-applying formulas to full table... Re-applying formula to field: @2$3 Re-applying formulas to full table...(line 4) Re-applying formula to field: @2$3 Debugging Formula. Continue to next? (y or n) y Re-applying formulas to 4 lines...done Re-applying formulas...done [2 times] Auto-saving... byte-code: End of buffer [3 times] byte-code: Beginning of buffer [8 times] byte-code: Beginning of buffer It seems that I can reliably reproduce a bug that I haven't been able to find on forums and that most other people have difficulty replicating. If I've done something to my installation of emacs I'd love to find out what has caused the problem. Is there a way of determining what could be my issue? Many thanks for your help! Ciaran From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrea Rossetti Subject: Re: Worg Tutorial error: using Emacs lisp as formulas Date: Thu, 28 Aug 2014 02:05:08 +0200 Message-ID: <84zjepiimj.fsf@gmail.com> References: <53FCDD83.40206@gmail.com> <87a96qhcfb.fsf@alphaville.dokosmarshall.org> <53FD8701.4060707@gmail.com> <8761hegnez.fsf@alphaville.dokosmarshall.org> <53FE69E2.8000509@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47045) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMnDN-0003D8-Sk for emacs-orgmode@gnu.org; Wed, 27 Aug 2014 20:05:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XMnDE-0004S5-QP for emacs-orgmode@gnu.org; Wed, 27 Aug 2014 20:05:21 -0400 Received: from mail-we0-x233.google.com ([2a00:1450:400c:c03::233]:40365) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XMnDE-0004RY-IH for emacs-orgmode@gnu.org; Wed, 27 Aug 2014 20:05:12 -0400 Received: by mail-we0-f179.google.com with SMTP id t60so23807wes.38 for ; Wed, 27 Aug 2014 17:05:11 -0700 (PDT) In-Reply-To: <53FE69E2.8000509@gmail.com> (Ciaran Mulloy's message of "Thu, 28 Aug 2014 00:29:38 +0100") 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: Ciaran Mulloy Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Ciaran Mulloy writes: > Inserting the following as a field formula in location @2$3: > :='(mapconcat 'identity (delete-dups (list @2$1..@>$1 @2$2..@>$2)) " ") > and doing a C-c or a C-u-C-c C-c generates an 'Invalid regexp: "Regular > expression too big"' error. > .... > It seems that I can reliably reproduce a bug that I haven't been able to > find on forums and that most other people have difficulty replicating. > If I've done something to my installation of emacs I'd love to find out > what has caused the problem. > > Is there a way of determining what could be my issue? Hello Ciaran, long story short: digging in org-table.el I noticed that functions f1=`org-table-formula-handle-first/last-rc' and f2=`org-table-formula-substitute-names' were used sometimes like this: (f2 (f1 x)), and sometimes like this: (f2 x). I conjecture it should always be (f2 (f1 x)), so I applied to my org-table.el, reloaded its definitions with `eval-buffer' and... it worked! File formula.diff attached here shows the exact changes that I applied on my org-table.el. (if you try formula.diff and it works for you, beware that you need to remove or recompile the old org-table.elc file). --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=formula.diff diff -c "-L" "c:/Users/andrea/AppData/Roaming/.emacs.d/elpa/org-20140804/org-table.el" "-L" "#" "c:/Users/andrea/AppData/Roaming/.emacs.d/elpa/org-20140804/org-table.el" "c:/Users/andrea/AppData/Local/Temp/buffer-content-3236IUh" *** c:/Users/andrea/AppData/Roaming/.emacs.d/elpa/org-20140804/org-table.el --- # *************** *** 2600,2606 **** (unless (string-match "\\S-" fmt) (setq fmt nil)))) (if (and (not suppress-const) org-table-formula-use-constants) ! (setq formula (org-table-formula-substitute-names formula))) (setq orig (or (get-text-property 1 :orig-formula formula) "?")) (while (> ndown 0) (setq fields (org-split-string --- 2600,2606 ---- (unless (string-match "\\S-" fmt) (setq fmt nil)))) (if (and (not suppress-const) org-table-formula-use-constants) ! (setq formula (org-table-formula-substitute-names (org-table-formula-handle-first/last-rc formula)))) (setq orig (or (get-text-property 1 :orig-formula formula) "?")) (while (> ndown 0) (setq fields (org-split-string *************** *** 3767,3773 **** (if (eq what 'name) (setq var (substring match 1))) (when (eq what 'range) (or (equal (string-to-char match) ?@) (setq match (concat "@" match))) ! (setq match (org-table-formula-substitute-names match))) (unless local (save-excursion (end-of-line 1) --- 3767,3773 ---- (if (eq what 'name) (setq var (substring match 1))) (when (eq what 'range) (or (equal (string-to-char match) ?@) (setq match (concat "@" match))) ! (setq match (org-table-formula-substitute-names (org-table-formula-handle-first/last-rc match)))) (unless local (save-excursion (end-of-line 1) Diff finished. Thu Aug 28 01:17:44 2014 --=-=-= Content-Type: text/plain Hope it may be of some help, kindest regards. Andrea --=-=-=--