From: Andrea Rossetti <andrea.rossetti@gmail.com>
To: Ciaran Mulloy <crmulloy@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Worg Tutorial error: using Emacs lisp as formulas
Date: Thu, 28 Aug 2014 02:05:08 +0200 [thread overview]
Message-ID: <84zjepiimj.fsf@gmail.com> (raw)
In-Reply-To: <53FE69E2.8000509@gmail.com> (Ciaran Mulloy's message of "Thu, 28 Aug 2014 00:29:38 +0100")
[-- Attachment #1: Type: text/plain, Size: 1222 bytes --]
Ciaran Mulloy <crmulloy@gmail.com> 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).
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: formula.diff --]
[-- Type: text/x-patch, Size: 1838 bytes --]
diff -c "-L" "c:/Users/andrea/AppData/Roaming/.emacs.d/elpa/org-20140804/org-table.el" "-L" "#<buffer org-table.el>" "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
--- #<buffer 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
[-- Attachment #3: Type: text/plain, Size: 59 bytes --]
Hope it may be of some help, kindest regards.
Andrea
prev parent reply other threads:[~2014-08-28 0:05 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-26 19:18 Worg Tutorial error: using Emacs lisp as formulas Ciaran Mulloy
2014-08-27 2:52 ` Nick Dokos
2014-08-27 7:21 ` Ciaran Mulloy
2014-08-27 9:20 ` ciaran_mulloy
2014-08-27 17:17 ` Andrea Rossetti
2014-08-27 11:52 ` Nick Dokos
2014-08-27 23:29 ` Ciaran Mulloy
2014-08-28 0:05 ` Andrea Rossetti [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=84zjepiimj.fsf@gmail.com \
--to=andrea.rossetti@gmail.com \
--cc=crmulloy@gmail.com \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).