Ciaran Mulloy <crmul...@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). 

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
  Hope it may be of some help, kindest regards.

  Andrea

Reply via email to