# emacs AucTeX:Turn off auto-fill-mode inside a particular LaTeX environment

I like using auto-fill-mode for hard line wrapping. However, when I'm making a big tabular in a .tex file, I like using align-current to have the table look somewhat like it would when printed. The difficulty is that if I have a table that is longer than the line width, auto-fill-mode breaks it, and then align-current can't put things to rights and gets confused.

Is there a way to tell emacs that when I'm between the \begin and \end tags of a particular kind of environment (in this case, tabular), don't word wrap...

-
Interesting problem which also bugged me a lot. See stackoverflow.com/questions/2008849/…. The second code sample by Ivan Andrus works nicely for me. –  eldering Jul 13 '11 at 12:11
Hmmm... actually doesn't seem to work out of the box. It only disabled auto-fill-mode because it gave an error in my .emacs file. –  eldering Jul 14 '11 at 9:24

## 1 Answer

There are many things you can do, including but not limited to (In order of implementation time):

• You can turn off auto-fill-mode and use M-q (fill-paragraph) to manually fill when you need it.
• You can use org-mode on-the-fly to create and edit clean tabular data.
• You can advise fill-paragraph to do something different depending on context
-