[Tex/LaTex] In emacs AucTeX mode, why is C-c C-j not working

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

In my configuration, it does insert a linebreak when needed.

From Seamus comment, you can see the definition of the insert function, the important part is:

(unless (bolp) (LaTeX-newline))

that checks if you are at a beginning of a line and if not inserts a new line.

You can check your latex.el file to see how it's defined (just click on the filename when it says "LaTeX-insert-item is an interactive Lisp function in `latex.el'."). As Seamus says, redefining it in your .emacs with the code he provides (it's the same in my latex.el) should solve it (unless it's your LaTeX-newline that is broken).

Related Question