Revert "org-table-eval-formula: Fix parsing of mode string when formula has ;"

This reverts commit 5af0625113.

The commit broken handling custom `format' spec for formula results:

Reported-by: Daniel Clemente <n142857@gmail.com>
Link: https://orgmode.org/list/CAJKAhPDFrgZY6sgefxu85qjEXnE2_HkPCHzbDOLsAD4Je57z7w@mail.gmail.com
This commit is contained in:
Ihor Radchenko 2024-05-21 11:09:46 +02:00
parent 3f539bc3d6
commit bae1b1fe70
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
2 changed files with 1 additions and 13 deletions

View File

@ -2491,13 +2491,7 @@ location of point."
duration duration-output-format)
;; Parse the format string. Since we have a lot of modes, this is
;; a lot of work. However, I think calc still uses most of the time.
(if (string-match
(rx (group (0+ any)) ";"
(group
(1+ (or whitespace
(seq (in "pnfse") (opt "-") (1+ digit))
(in "tTUNLEDRFSu")))))
formula)
(if (string-match "\\(.*\\);\\(.*\\)" formula)
(progn
(setq fmt (concat (cdr (assoc "%" org-table-local-parameters))
(match-string-no-properties 2 formula)))

View File

@ -2026,12 +2026,6 @@ See also `test-org-table/copy-field'."
(equal "| 1 | 1 |"
(org-test-with-temp-text "| 1 | <point> |"
(org-table-eval-formula nil "$<" nil nil t)
(buffer-string))))
;; Do not disambiguate ; in the formula itself with mode string.
(should
(equal "| 1 | 1; |"
(org-test-with-temp-text "| 1 | <point> |"
(org-table-eval-formula nil "'(concat $1 \";\")" nil nil t)
(buffer-string)))))
(ert-deftest test-org-table/field-formula-outside-table ()