Add +fold flag to lang/latex for TeX-fold

This commit is contained in:
yoavm448 2020-04-07 15:48:49 +03:00
parent b3af9dbc3c
commit 5e35662b9f
4 changed files with 54 additions and 3 deletions

View file

@ -39,6 +39,18 @@ Continuation lines are indented either twice `LaTeX-indent-level', or
(+ offset indent))
((+ contin indent))))))
;;;###autoload
(defun +latex-fold-last-macro-a (&rest _)
"Advice to auto-fold LaTeX macros after functions that
typically insert macros."
;; A simpler approach would be to just fold the whole line, but if point was
;; inside a macro that would would kick it out. So instead we fold the last
;; macro before point, hoping its the one newly inserted.
(TeX-fold-region (save-excursion
(search-backward "\\" (line-beginning-position) t)
(point))
(1+ (point))))
;;;###autoload
(defun +latex-symbols-company-backend (command &optional arg &rest _ignored)
"A wrapper backend for `company-mode' that either uses