Fix bug with algebraic evaluation in tables.

There was a problem that complex fields need a pair of parenthesis
around them.  For example, if one field is "a a" and another field
is "a+b", multiplication of the two gave "a^3+b" instead of "a^3+a^2 b".
Now variable replacement puts extra parenthesis around values.
This commit is contained in:
Carsten Dominik 2008-04-13 21:28:26 +02:00
parent ca52d56da5
commit e7e5e25100
2 changed files with 6 additions and 1 deletions

View File

@ -1,5 +1,9 @@
2008-04-13 Carsten Dominik <dominik@science.uva.nl> 2008-04-13 Carsten Dominik <dominik@science.uva.nl>
* lisp/org-table.el (org-table-make-reference): Extra parenthesis
around single fields, to make sure that algebraic formulas get
correctly interpreted by calc.
* lisp/org-mhe.el: Changed author name to Thomas Baumann. * lisp/org-mhe.el: Changed author name to Thomas Baumann.
* lisp/org-exp.el (org-export-preprocess-string): Renamed-from * lisp/org-exp.el (org-export-preprocess-string): Renamed-from

View File

@ -2298,7 +2298,8 @@ LISPP means to return something appropriate for a Lisp list."
elements elements
(prin1-to-string (if numbers (string-to-number elements) elements))) (prin1-to-string (if numbers (string-to-number elements) elements)))
(if (equal elements "") (setq elements "0")) (if (equal elements "") (setq elements "0"))
(if numbers (number-to-string (string-to-number elements)) elements)) (if numbers (setq elements (number-to-string (string-to-number elements))))
(concat "(" elements ")"))
(unless keep-empty (unless keep-empty
(setq elements (setq elements
(delq nil (delq nil