summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2016-01-14 11:57:09 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2016-01-14 11:57:09 +0100
commit4e913b1c627edb9a06fdc1a4dcef8364c939a560 (patch)
treef67cd335f95f1692d545ebcdb9ade86a64ca332d
parent7d0104f44933d924261ca254528557a4f10cdc76 (diff)
downloadorg-mode-4e913b1c627edb9a06fdc1a4dcef8364c939a560.tar.gz
org-table: Fix formula editor
* lisp/org-table.el (org-table-edit-formulas): (org-table-fedit-finish): Do not remove "$" from column formulas when exiting the editor.
-rw-r--r--lisp/org-table.el11
1 files changed, 5 insertions, 6 deletions
diff --git a/lisp/org-table.el b/lisp/org-table.el
index 863ba98..5f3d5e5 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -3559,9 +3559,9 @@ Parameters get priority."
(setq startline (org-current-line))
(dolist (entry eql)
(let* ((type (cond
- ((string-match "\\`$[<>]" (car entry)) 'column)
+ ((string-match "\\`$\\([0-9]+\\|[<>]+\\)\\'" (car entry))
+ 'column)
((equal (string-to-char (car entry)) ?@) 'field)
- ((string-match "\\'[0-9]" (car entry)) 'column)
(t 'named)))
(title (assq type titles)))
(when title
@@ -3832,10 +3832,9 @@ With prefix ARG, apply the new formulas to the table."
(while (re-search-forward
"^\\(@[-+I<>0-9.$@]+\\|@?[0-9]+\\|\\$\\([a-zA-Z0-9]+\\|[<>]+\\)\\) *= *\\(.*\\(\n[ \t]+.*$\\)*\\)"
nil t)
- (setq var (if (match-end 2) (match-string 2) (match-string 1))
- form (match-string 3))
- (setq form (org-trim form))
- (when (not (equal form ""))
+ (setq var (match-string 1))
+ (setq form (org-trim (match-string 3)))
+ (unless (equal form "")
(while (string-match "[ \t]*\n[ \t]*" form)
(setq form (replace-match " " t t form)))
(when (assoc var eql)