auctex-devel
[Top][All Lists]

## Re: [AUCTeX-devel] Extending LaTeX-array-count-columns'

 From: Ikumi Keita Subject: Re: [AUCTeX-devel] Extending LaTeX-array-count-columns' Date: Thu, 15 Dec 2016 02:57:05 +0900

Hi Arash,

> 2 thing occurred to me when hitting M-RET' in tabular environments:
> Current code in LaTeX-array-count-columns' cannot handle multi column
> specs like `*{num}{spec}' and optional args to column specs S and s from
> siunitx.el.  I have a patch to handle both issues.

Instead of modifying LaTeX-array-count-columns, how about putting such
customized function in array.el and preparing to call it in a fashion
like

(LaTeX-insert-ampersands
LaTeX-array-skipping-regexp 'NEW-FUNCTION-NAME)

in TeX-add-style-hook?  Syntaxes like
\begin{tabular}[t]{*{4}{l}l}
and
\begin{tabular}{X[foo = bar]}
are not supported in the standard LaTeX.  If such enhancements continue
to pile up in future to cover syntaxes provided by other packages,
LaTeX-array-count-columns might become much complicated and be hard to

Of course such approach has drawbacks.  As well as being redundant to
have similar codes at multiple locations, when someone improves
LaTeX-array-count-columns, that person has to look in all style/*.el
files and apply the same change to all the customized functions.

So I won't object if you choose your original approach.  How do you

Bye,
Ikumi Keita

reply via email to