branch: externals/auctex commit ddd6b97c8c18cc797762224023753a66863e0deb Author: Tassilo Horn <t...@gnu.org> Commit: Tassilo Horn <t...@gnu.org>
Improve minted style. * style/minted.el (LaTeX-minted-auto-cleanup): Recognize macros generated by \newmint, \newmintinline, and \newmintedfile, too. --- ChangeLog | 3 +++ style/minted.el | 19 ++++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5bf02de..142694c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2014-12-20 Tassilo Horn <t...@gnu.org> + * style/minted.el (LaTeX-minted-auto-cleanup): Recognize macros + generated by \newmint, \newmintinline, and \newmintedfile, too. + * tex.el (TeX-evince-sync-view): Encode URI with `url-encode-url'. 2014-12-19 Tassilo Horn <t...@gnu.org> diff --git a/style/minted.el b/style/minted.el index b5733c3..dce725b 100644 --- a/style/minted.el +++ b/style/minted.el @@ -129,13 +129,7 @@ LaTeX-minted-auto-newmintedfile nil)) (defun LaTeX-minted-auto-cleanup () - ;; (message "1: %s\n2: %s\n3: %s\n4: %s" - ;; LaTeX-minted-auto-newminted - ;; LaTeX-minted-auto-newmint - ;; LaTeX-minted-auto-newmintinline - ;; LaTeX-minted-auto-newmintedfile) - ;; Every \newminted{lang}{opts} defines a new langcode and a new langcode* - ;; env. The starred version has mandatory args. + ;; \newminted{lang}{opts} => new langcode and langcode* envs. (dolist (lang LaTeX-minted-auto-newminted) (let* ((env (concat lang "code")) (env* (concat env "*"))) @@ -147,6 +141,17 @@ (add-to-list 'LaTeX-indent-environment-list `(,env* current-indentation)) (add-to-list 'LaTeX-verbatim-environments-local env) (add-to-list 'LaTeX-verbatim-environments-local env*))) + ;; \newmint{foo}{opts} => \foo|code| + (dolist (lang LaTeX-minted-auto-newmint) + (add-to-list 'TeX-auto-symbol lang) + (add-to-list 'LaTeX-verbatim-macros-with-delims-local lang)) + ;; \newmintinline{foo}{opts} => \fooinline|code| + (dolist (lang LaTeX-minted-auto-newmintinline) + (add-to-list 'TeX-auto-symbol lang) + (add-to-list 'LaTeX-verbatim-macros-with-delims-local (concat lang "inline"))) + ;; \newmintedfile{foo}{opts} => \foofile{file-name} + (dolist (lang LaTeX-minted-auto-newmintedfile) + (add-to-list 'TeX-auto-symbol (list lang 'TeX-arg-file))) (when (and (fboundp 'font-latex-add-keywords) (fboundp 'font-latex-set-syntactic-keywords) (eq TeX-install-font-lock 'font-latex-setup))