[Tex/LaTex] emacs / AuCTeX and itemize

auctexemacs

I am having an issue with my newline's within itemized lists in AucTex mode of Emacs. If I do, C-c C-e RET itemize RET, I expect the following

\begin{itemize}
   \item 
\end{itemize}

but instead get

\begin{itemize}\item 
\end{itemize}

Additionally, when I do C-c C-j at the end of an item, it just gives me a new \item without putting me on an new line. So, C-h k C-c C-j reveals

C-c C-j runs the command LaTeX-insert-item, which is an interactive
compiled Lisp function in `latex.el'.

It is bound to C-c C-j, M-RET, <menu-bar> <LaTeX> <Item>.

(LaTeX-insert-item)

Insert a new item in an environment.
You may use `LaTeX-item-list' to change the routines used to insert the item.

So, it seems that my LaTeX-insert-item is somehow broken? How can I recover the correct C-c C-j behaviour?

Best Answer

Step 1: close Emacs completely and start it up again. This will fix the problem if it was caused by you inadvertently changing some setting/variable.

Step 2: if that didn't work:

comment out everything in your .emacs except for the line loading AUCTeX. In my case, the line is:

(load "auctex.el" nil t t)

The command

M-;

will comment-out everything in the active region. It will also uncomment everything in the region, if it is already commented, so you'll want to use that rather than manually adding a whole pile of ;;.

Following step 2, you should have an unmodified version of Emacs + AUCTeX, so you should have the correct behaviour back. This will confirm that the problem is something in your .emacs file conflicting with AUCTeX. If the problem persists, it may be a bug in AUCTeX, although that seems unlikely for such a commonly-used feature.

Step 3: Uncomment more of your .emacs, and restart. If the problem returns, it was caused by the now-uncommented code. If it doesn't, repeat the process until you find the code that triggers the problem.

Step 4: solve the problem yourself, or ask another question about the specific code that you discovered that caused the conflict.