>From ac36b6e39de80b02210e4e4d0a334768a7b125ee Mon Sep 17 00:00:00 2001 From: Arash Esbati Date: Sat, 24 Oct 2015 16:35:15 +0200 Subject: [PATCH 4/4] Improve style. * style/enumitem.el (LaTeX-enumitem-auto-cleanup): Move some operations from style hook into this function. (LaTeX-enumitem-newlist-list-item-arg-local): Delete now unused variable. --- ChangeLog | 5 +++++ style/enumitem.el | 29 ++++++++++------------------- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4178918..3f5aec6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2015-10-24 Arash Esbati + * style/enumitem.el (LaTeX-enumitem-auto-cleanup): Move some + operations from style hook into this function. + (LaTeX-enumitem-newlist-list-item-arg-local): Delete now unused + variable. + * style/amsthm.el (LaTeX-amsthm-theoremstyle-list): New variable replacing the deleted function `LaTeX-amsthm-complete-theoremstyle'. diff --git a/style/enumitem.el b/style/enumitem.el index dff94aa..a527c86 100644 --- a/style/enumitem.el +++ b/style/enumitem.el @@ -116,11 +116,6 @@ plus available through `enumitem' package.") "List of description like environments defined by command `\\newlist' from `enumitem' package.") -(defvar LaTeX-enumitem-newlist-list-item-arg-local nil - "Local list of all description like environments defined by command -`\\newlist' plus available through `enumitem' package.") -(make-variable-buffer-local 'LaTeX-enumitem-newlist-list-item-arg-local) - (defvar LaTeX-auto-enumitem-newlist nil "Temporary for parsing the arguments of `\\newlist' from `enumitem' package.") @@ -183,7 +178,16 @@ package.") (when (or (string-equal type "description") (string-equal type "description*")) (add-to-list 'LaTeX-enumitem-newlist-list-item-arg - (list env)))))) + (list env))))) + ;; Now add the parsed env's to the local list. + (when LaTeX-enumitem-newlist-list + (setq LaTeX-enumitem-newlist-list-local + (append LaTeX-enumitem-newlist-list + LaTeX-enumitem-newlist-list-local))) + ;; Tell AUCTeX about parsed description like environments. + (when LaTeX-enumitem-newlist-list-item-arg + (dolist (env LaTeX-enumitem-newlist-list-item-arg) + (add-to-list 'LaTeX-item-list `(,(car env) . LaTeX-item-argument))))) (add-hook 'TeX-auto-prepare-hook #'LaTeX-enumitem-auto-prepare t) (add-hook 'TeX-auto-cleanup-hook #'LaTeX-enumitem-auto-cleanup t) @@ -302,19 +306,6 @@ in `enumitem'-completions." (append '(("itemize*") ("enumerate*") ("description*")) LaTeX-enumitem-newlist-list-local))) - ;; Now add the parsed env's to the local list. - (setq LaTeX-enumitem-newlist-list-local - (append LaTeX-enumitem-newlist-list - LaTeX-enumitem-newlist-list-local)) - - ;; Move parsed description like env's into a local variable. - (setq LaTeX-enumitem-newlist-list-item-arg-local - LaTeX-enumitem-newlist-list-item-arg) - - ;; Tell AUCTeX about special items parsed - (dolist (env LaTeX-enumitem-newlist-list-item-arg-local) - (add-to-list 'LaTeX-item-list `(,(car env) . LaTeX-item-argument))) - ;; Standard env's take key-val as optional argument. (LaTeX-add-environments '("itemize" LaTeX-enumitem-env-with-opts) -- 2.6.2