org-element: Allow to escape escaping character before a comma
commit42e1a6351df0a34197815d9701cf8b00b477703c
authorNicolas Goaziou <n.goaziou@gmail.com>
Sat, 23 Mar 2013 18:10:41 +0000 (23 19:10 +0100)
committerNicolas Goaziou <n.goaziou@gmail.com>
Sat, 23 Mar 2013 19:42:34 +0000 (23 20:42 +0100)
tree5a8c3e01eee96f728f1d6a0613458ab7368b2e86
parent7847b4d7a800903ff06026b20817e5c2d165f66a
org-element: Allow to escape escaping character before a comma

* lisp/org-element.el (org-element-macro-parser): Allow to escape
  escaping character before a comma.  Also do not trim spaces at
  argument boundaries.
* doc/org.texi (Macro replacement): Update documentation about
  possible locations and escaping mechanism.
* testing/lisp/test-org-element.el: Add tests.

With this patch, macro's arguments are read as the following:

  "a,b"     -> '("a" "b")
  "a\,b"    -> '("a,b")
  "a\\,b"   -> '("a\" "b")
  "a\\\,b"  -> '("a\,b")
  "a\\\\,b" -> '(a"\\" "b")

Note that with the patch, you only need to escape backslashes before
a comma:

  "a\\b\,c" -> '("a\\b,c")
doc/org.texi
lisp/org-element.el
testing/lisp/test-org-element.el