emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] bad table formula recorded in some cases


From: Timothy
Subject: Re: [PATCH] bad table formula recorded in some cases
Date: Wed, 21 Jul 2021 18:50:59 +0800
User-agent: mu4e 1.4.15; emacs 28.0.50

Hi Thierry,

Thanks for this! Looking at the change you suggest, do you know why the
(match-string 2) bit might have been added in the first place? I'm just
wondering if there might be some edge-case adversely affected by this ---
hence trading one bug for another :P

--
Timothy

tbanelwebmin <tbanelwebmin@free.fr> writes:

> Small bug, small fix.
>
> Suppose we have a table embedded in a begin-end block.
>
> #+begin: aaa :param value
> | a | b |
> | a | b |
> #+end:
>
> Suppose we want to add a formula, with C-c =
> We end up with an incorrect result:
>
> #+begin: aaa :param value
> | a | 33 |
> | a |  b |
>  :param value $2=33
> #+end:
>
> The fix: in org-table.el, line 2177, change
>   (insert (or (match-string 2) "#+TBLFM:")))
> to
>   (insert "#+TBLFM:"))
>
> Then we get the correct result:
>
> #+begin: aaa :param value
> | a | 33 |
> | a |  b |
> #+TBLFM: $2=33
> #+end:
>
> Why? Because (match-string 2) is supposed to refer to the (looking-at)
> instruction 7 lines above. But (match-string 2) is in the else branch,
> which means that (looking-at) failed. Therefore (match-string 2) returns
> garbage.
>
> Thanks to Uwe Brauer for pointing to this bug.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]