bug-auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-AUCTeX] [AUCTeX] Wrong Placement of \end{tabularx}


From: Mosè Giordano
Subject: Re: [Bug-AUCTeX] [AUCTeX] Wrong Placement of \end{tabularx}
Date: Sun, 26 Oct 2014 16:19:45 +0100

Hi Ralf,

2014-10-26 14:07 GMT+01:00 Ralf Angeli <address@hidden>:
> * Arash Esbati (2014-10-26) writes:
>
>> \begin{tabularx}{1.0\linewidth}{lrlX}
>>   &&
>>   \end{tabularx}
>> ^^
>
> This is a bug in the new code for table indentation.
>
> In style/tabularx.el the following code marks the tabularx environment
> to use the indentation function `LaTeX-indent-tabular':
>
>    (add-to-list 'LaTeX-indent-environment-list
>                 '("tabularx" LaTeX-indent-tabular))
>
> In order for this to work correctly the value of the internal variable
> `LaTeX--tabular-like-end' would have to be updated.  The defcustom of
> `LaTeX-indent-environment-list' has a function to do this, but this is
> not called when modifying the variable with `add-to-list'.
>
> This could be fixed by making the lambda function function used in the
> :set property of `LaTeX-indent-environment-list' a named function and
> calling it manually after modifying the variable with `add-to-list'.  Or
> by providing a function to add stuff to the variable which does this.
>
> Any other suggestions?  Both of the above options are a bit error-prone,
> i.e. if you forget to use this stuff, it will not work.

How about moving the body of that lambda inside `LaTeX-indent-tabular'
function to let-bind a `tabular-like-end' variable?  In this way the
variable `LaTeX--tabular-like-end' would not be needed anymore; the
only drawback is a little performance regression.  Otherwise a new
function to add the environment to the list and update
`LaTeX--tabular-like-end' at once.

Bye,
Mosè



reply via email to

[Prev in Thread] Current Thread [Next in Thread]