summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Brand <michael.ch.brand@gmail.com>2014-09-14 10:44:28 +0200
committerMichael Brand <michael.ch.brand@gmail.com>2014-09-14 10:44:28 +0200
commit739136e17f815210506e77bdbc81e5475140ced0 (patch)
treef445c78b89fce3c623c17244c8c43f5bc4c891d2
parent551891e2ad78e14e7893fa7c7ef70e550cc107d9 (diff)
downloadorg-mode-739136e17f815210506e77bdbc81e5475140ced0.tar.gz
Table formula: Fix for Lisp return value nil
* lisp/org-table.el (org-table-eval-formula): Substitute `listp' with `consp'. * testing/lisp/test-org-table.el (test-org-table/lisp-return-value): Fix test.
-rw-r--r--lisp/org-table.el4
-rw-r--r--testing/lisp/test-org-table.el3
2 files changed, 3 insertions, 4 deletions
diff --git a/lisp/org-table.el b/lisp/org-table.el
index 4981259..cd0030b 100644
--- a/lisp/org-table.el
+++ b/lisp/org-table.el
@@ -2764,7 +2764,7 @@ Orig: %s
$xyz-> %s
@r$c-> %s
$1-> %s\n" orig formula form0 form))
- (if (listp ev)
+ (if (consp ev)
(princ (format " %s^\nError: %s"
(make-string (car ev) ?\-) (nth 1 ev)))
(princ (format "Result: %s\nFormat: %s\nFinal: %s"
@@ -2779,7 +2779,7 @@ $1-> %s\n" orig formula form0 form))
(user-error "Abort"))
(delete-window bw)
(message "")))
- (if (listp ev) (setq fmt nil ev "#ERROR"))
+ (when (consp ev) (setq fmt nil ev "#ERROR"))
(org-table-justify-field-maybe
(format org-table-formula-field-format
(if fmt (format fmt (string-to-number ev)) ev)))
diff --git a/testing/lisp/test-org-table.el b/testing/lisp/test-org-table.el
index 530bc8f..e083683 100644
--- a/testing/lisp/test-org-table.el
+++ b/testing/lisp/test-org-table.el
@@ -411,7 +411,6 @@ reference (with row). Mode string N."
| type-of (identity @1) | r | r | r |
| identity @1 | r | r | r |
"
- ;; TODO Fix "#ERROR".
"
| | nil | (list) | '() |
|-------------------------+--------+--------+--------|
@@ -425,7 +424,7 @@ reference (with row). Mode string N."
|-------------------------+--------+--------+--------|
| type-of @1 | symbol | symbol | symbol |
| type-of (identity @1) | symbol | symbol | symbol |
-| identity @1 | #ERROR | #ERROR | #ERROR |
+| identity @1 | nil | nil | nil |
"
1 (concat "#+TBLFM: @2$<<..@2$> = '(type-of @1) :: "
"@3$<<..@3$> = '(type-of (identity @1)) :: "