Add latex env support to editor/fold with hideshow

Closes #2805
This commit is contained in:
yoavm448 2020-04-02 16:03:46 +03:00
parent a8f34f0f81
commit 2f8b4b85fc

View file

@ -53,7 +53,19 @@
nil (lambda (_arg) (matlab-forward-sexp))) nil (lambda (_arg) (matlab-forward-sexp)))
(nxml-mode "<!--\\|<[^/>]*[^/]>" (nxml-mode "<!--\\|<[^/>]*[^/]>"
"-->\\|</[^/>]*[^/]>" "-->\\|</[^/>]*[^/]>"
"<!--" sgml-skip-tag-forward nil)) "<!--" sgml-skip-tag-forward nil)
(latex-mode
;; LaTeX-find-matching-end needs to be inside the env
("\\\\begin{[a-zA-Z*]+}\\(\\)" 1)
"\\\\end{[a-zA-Z*]+}"
"%"
(lambda (_arg)
;; Don't fold whole document, that's useless
(unless (save-excursion
(search-backward "\\begin{document}"
(line-beginning-position) t))
(LaTeX-find-matching-end)))
nil))
hs-special-modes-alist hs-special-modes-alist
'((t)))))) '((t))))))