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