Pedro Andres Aranda Gutierrez <[email protected]> writes:

> just a bit of editing comfort. Current behaviour is preserved.
> 100% backward compatible.

Thanks!

> +*** Square brackets around LATEX_CLASS_OPTIONS are now optional.
> +
> +Square brackets around the LATEX_CLASS_OPTIONS may be ommited.

Maybe put an example here - just as in the manual.
Otherwise, you have two sentences that are almost the same - that very
strange to read.

> +(defun org-latex--mk-options (str)
> +  "Make STR be enclosed in [ ] or return an empty string if nil or empty.
> +
> +If STR is nil or an empty string, return an empty string.
> +If STR is a traditional LATEX_CLASS_OPTIONS enclosed in [ ], return it as is.
> +If the square brackets are missing, return STR enclosed in square brackets."
> +  (if (or (not str) (length= str 0)) ""
> +    (save-match-data
> +      (concat "[" (replace-regexp-in-string
> +                   "\\[?\\([^]]+\\)\\]?" "\\1" str)
> +              "]"))))

What about

#+LATEX_CLASS_OPTIONS: [foo{[}bar{]}]

I admit that it is very unlikely to happen, but I think we can change
regexp to capture the last ] greedily.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to