Am 21.03.2013 22:02, schrieb Nicolas Goaziou:
I suggest the following code instead, which allows to escape the
escaping backslash so the comma is not escaped:

   (args (mapcar 'org-trim
                 (split-string
                  (replace-regexp-in-string
                   "\\(\\\\+\\)?\\(,\\)"
                   (lambda (str)
                     (let ((slashes (match-string 1 str)))
                       (if (or (not slashes) (evenp (length slashes))) "\\1\000"
                         (concat (make-string (1- (length slashes)) ?\\) ","))))
                   (org-match-string-no-properties 3))
                  "\000")))

What do you think about it?

I think this is a lot harder to understand and I would guess it is also quite a bit slower. Also I'm not sure why you are trying to match multiple backslashes. The original implementation and the description of the syntax says that the only character that can be escaped is a comma, so the new implementation changes behaviour in that regard (maybe intentionally, I can't tell).


Regards,
--
Achim.

(on the road :-)


Reply via email to