Merge branch 'maint'

This commit is contained in:
Nicolas Goaziou 2013-05-12 17:16:41 +02:00
commit a09d968d30
2 changed files with 11 additions and 2 deletions

View File

@ -3775,7 +3775,8 @@ element it has to parse."
(goto-char (car affiliated)) (goto-char (car affiliated))
(org-element-keyword-parser limit nil)) (org-element-keyword-parser limit nil))
;; LaTeX Environment. ;; LaTeX Environment.
((looking-at "[ \t]*\\\\begin{\\([A-Za-z0-9*]+\\)}") ((looking-at
"[ \t]*\\\\begin{[A-Za-z0-9*]+}\\(\\[.*?\\]\\|{.*?}\\)*[ \t]*$")
(org-element-latex-environment-parser limit affiliated)) (org-element-latex-environment-parser limit affiliated))
;; Drawer and Property Drawer. ;; Drawer and Property Drawer.
((looking-at org-drawer-regexp) ((looking-at org-drawer-regexp)

View File

@ -1136,11 +1136,19 @@ e^{i\\pi}+1=0
:value :value
(org-element-map (org-element-map
(org-element-parse-buffer) 'latex-environment 'identity nil t))))) (org-element-parse-buffer) 'latex-environment 'identity nil t)))))
;; Allow environments with options. ;; Allow environments with options and arguments.
(should (should
(eq 'latex-environment (eq 'latex-environment
(org-test-with-temp-text (org-test-with-temp-text
"\\begin{theorem}[Euler]\ne^{i\\pi}+1=0\n\\end{theorem}" "\\begin{theorem}[Euler]\ne^{i\\pi}+1=0\n\\end{theorem}"
(org-element-type (org-element-at-point)))))
(should
(eq 'latex-environment
(org-test-with-temp-text "\\begin{env}{arg}\nvalue\n\\end{env}"
(org-element-type (org-element-at-point)))))
(should-not
(eq 'latex-environment
(org-test-with-temp-text "\\begin{env}{arg} something\nvalue\n\\end{env}"
(org-element-type (org-element-at-point)))))) (org-element-type (org-element-at-point))))))