Hi Keita,

Ikumi Keita <[email protected]> writes:

>>>>>> Arash Esbati <[email protected]> writes:
>> I like the idea, but `LaTeX-default-tabular-environment' is notoriously
>> the one I currently don't want.  Should we change this part a little in
>> order to give users a chance to pick up what they want?  I'm thinking
>> about a change like this:
>
> It looks basically good, though the patch actually doesn't apply for me
> with an error saying "Patching file latex.el using Plan A...
> patch: **** malformed patch at line 116: Over the time, we have to adjust the 
> regexp, but it should get us".

Sorry for my late response and thanks for looking into this.  I'm
attaching the change, but I think it will now apply no more after the
recent changes to latex.el.

> But shouldn't we wait for Mosè to make a new release before making a
> large change? (And what happend to him? Does anyone know?)

I didn't consider this a big change, but I admit it is a change in a
probably frequently used function.  So maybe we wait with this.

Reg. the release, we were waiting for David to cook up something for the
known preview bug.  This has now happened, but we'll have to go through
some testing.  I will write a message about that as well.

> Speaking about this part, maybe we should consider to exclude "expert"
> environments:
>        (let (result)
>          (dolist (entry (LaTeX-environment-list-filtered) result)
>            (when (string-match (concat
>                                 "\\`tabular"
>                                 "\\|"
>                                 "\\(tabular\\|[a-zA-Z]+tables?\\)\\*?\\'")
>                                (car entry))
>              (push (car entry) result))))

As Tassilo mentioned in his other message, expert environments are
seldom used in our styles.  Hence, I didn't have that on my mind.  Do
you think it should be considered?

> ...but wait, I just noticed that the implementation of
> `TeX-complete-make-expert-command-functions' seems to have a defect. I'm
> currently not sure whether `LaTeX-environment-list-filtered' works as
> expected or not. I'll write the detail in another message later.

Thanks for raising and fixing this issue.

Best, Arash
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.

Reply via email to