summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Schulte <eric.schulte@gmx.com>2012-01-03 11:44:32 -0700
committerEric Schulte <eric.schulte@gmx.com>2012-01-03 11:45:27 -0700
commit2c2e1a544872e6e0884b1f4c76baf5495627dbfe (patch)
treefbdf97295dc696ee7461a5f121a7e167bee9535e
parent2b3534a81f6f4c925f55ed7aaec31ead6f400577 (diff)
downloadorg-mode-2c2e1a544872e6e0884b1f4c76baf5495627dbfe.tar.gz
fixed bug in org-babel-balanced-split when run on Emacs22
Thanks to Martyn Jago for the test case * lisp/ob.el (org-babel-balanced-split): Explicit checking if list before calling member. * testing/lisp/test-ob.el (test-ob/org-babel-balanced-split): Testing the new Emacs22-proof behavior.
-rw-r--r--lisp/ob.el3
-rw-r--r--testing/lisp/test-ob.el6
2 files changed, 7 insertions, 2 deletions
diff --git a/lisp/ob.el b/lisp/ob.el
index 8aee052..745163b 100644
--- a/lisp/ob.el
+++ b/lisp/ob.el
@@ -1074,8 +1074,7 @@ ALTS is a cons of two character options where each option may be
either the numeric code of a single character or a list of
character alternatives. For example to split on balanced
instances of \"[ \t]:\" set ALTS to '((32 9) . 58)."
- (flet ((matches (ch spec) (or (and (numberp spec) (= spec ch))
- (member ch spec)))
+ (flet ((matches (ch spec) (if (listp spec) (member ch spec) (equal spec ch)))
(matched (ch last)
(if (consp alts)
(and (matches ch (cdr alts))
diff --git a/testing/lisp/test-ob.el b/testing/lisp/test-ob.el
index 6c7ac6c..2644ef1 100644
--- a/testing/lisp/test-ob.el
+++ b/testing/lisp/test-ob.el
@@ -583,6 +583,12 @@ on two lines
(should (= 2 (length (org-babel-ref-split-args
"a=\"this, no work\", b=1"))))))
+(ert-deftest test-ob/org-babel-balanced-split ()
+ (should (equal
+ '(":a 1" "b [2 3]" "c (4 :d (5 6))")
+ (org-babel-balanced-split ":a 1 :b [2 3] :c (4 :d (5 6))"
+ '((32 9) . 58)))))
+
(provide 'test-ob)
;;; test-ob ends here