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.
This commit is contained in:
parent
2b3534a81f
commit
2c2e1a5448
|
@ -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
|
either the numeric code of a single character or a list of
|
||||||
character alternatives. For example to split on balanced
|
character alternatives. For example to split on balanced
|
||||||
instances of \"[ \t]:\" set ALTS to '((32 9) . 58)."
|
instances of \"[ \t]:\" set ALTS to '((32 9) . 58)."
|
||||||
(flet ((matches (ch spec) (or (and (numberp spec) (= spec ch))
|
(flet ((matches (ch spec) (if (listp spec) (member ch spec) (equal spec ch)))
|
||||||
(member ch spec)))
|
|
||||||
(matched (ch last)
|
(matched (ch last)
|
||||||
(if (consp alts)
|
(if (consp alts)
|
||||||
(and (matches ch (cdr alts))
|
(and (matches ch (cdr alts))
|
||||||
|
|
|
@ -583,6 +583,12 @@ on two lines
|
||||||
(should (= 2 (length (org-babel-ref-split-args
|
(should (= 2 (length (org-babel-ref-split-args
|
||||||
"a=\"this, no work\", b=1"))))))
|
"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)
|
(provide 'test-ob)
|
||||||
|
|
||||||
;;; test-ob ends here
|
;;; test-ob ends here
|
||||||
|
|
Loading…
Reference in New Issue