auctex
[Top][All Lists]
Advanced

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

Re: [AUCTeX] disable fill indent


From: Ralf Angeli
Subject: Re: [AUCTeX] disable fill indent
Date: Sun, 27 Mar 2011 15:51:28 +0200

* marco stronati (2011-03-23) writes:

> I'm currently having an hard time with the command LaTeX-environment (C-c 
> C-e) 
> to insert environments.
> If I select a region and then apply the command, i.e. to itemize, the result 
> is that the region is filled/indented in the wrong way.
> ex:
> first item
> second item
> third item
>
> I'd expect:
> \begin{itemize}
> \item first-item 
> second-item
> third-item
> \end{itemize}
>
> but I get:
> \begin{itemize}
> \item first-item second-item third-item
> \end{itemize}

You're doing it wrong.

SCNR.  Now, seriously.  A bunch of consecutive lines of text without
empty lines in between are treated as a single paragraph by AUCTeX.  If
you press `M-q' on your three items (before adding an environment) you
will see that they are put on a single line as well.

When an environment is inserted, marked text to be inclosed in it will
be indented and refilled in order to avoid overfull lines.  And here the
same logic applies.  So AUCTeX does not know that your three consecutive
lines of text are meant to be separate items.

With respect to the itemize environment I'd recommend to insert the
environment first and then add your items.  This would be more in line
with the way it is meant to be used.  A new item can easily be added by
typing `M-<RET>'.

> The only way I could find to disable this behavior was to add the itemize 
> environment to the list LaTeX-indent-environment-list.
> This doesn't feel like the clean way and moreover I'd need to add every 
> environment. Is there a way to do it the right way and globally?

Judging from the code I'd say no.  But as hinted at above, this seems to
be a clash of your expectations and the intentions of the guy who wrote
the environment insertion functionality.  Since this is not easily
adaptable to your expectations, aligning them more with the intentions
of the implementation might provide you with a more pleasant editing
experience.

-- 
Ralf



reply via email to

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