diff --git a/latex.el b/latex.el index 6d255591..beb65b91 100644 --- a/latex.el +++ b/latex.el @@ -1253,7 +1253,22 @@ If SHORT-CAPTION is non-nil pass it as an optional argument to ;; Suppose an existing tabular environment should just ;; be wrapped into a table if there is an active region. (not active-mark)) - (LaTeX-environment-menu LaTeX-default-tabular-environment)))) + (LaTeX-environment-menu + (completing-read + (TeX-argument-prompt nil nil + (concat + "Tabular environment to insert (default " + LaTeX-default-tabular-environment + ")")) + (let (result) + (dolist (env (mapcar #'car (LaTeX-environment-list)) result) + (when (string-match (concat + "\\`tabular" + "\\|" + "\\(tabular\\|[a-zA-Z]+tables?\\)\\*?\\'") + env) + (push env result)))) + nil nil nil nil LaTeX-default-tabular-environment))))) (defun LaTeX-env-array (environment) "Insert ENVIRONMENT with position and column specifications.