When I have a commented line in my TeX file, eg
some text that is not commented
|%% here is a comment
followed by more uncommented text
(the | represents point), and I hit RET
, point is moved past the %%
and into the comment, like so:
some text that is not commented
%% |here is a comment
followed by more uncommented text
This seems very strange, and to me it is undesirable. For instance, if I want to add another newline before the commented line, I have to backtrack to the beginning of the line first. I want point to stay in front of the %
characters.
How can I disable this annoying behavior?
C-o
will open a new line at point, which does what you wantRET
to do in this case.C-o
(which calls the functionopen-line
), but that leaves point on the current line, that is, it inserts the newline after point, not before it. I just wantRET
to act like it used to and I don't understand why this behavior is now the default. It is truly bizarre.electric-indent-mode
in your .tex file where you observe this? Ift
, please tryM-x electric-indent-local-mode RET
and try it again.(setq LaTeX-syntactic-comments nil)
solved it for me (see this manual page).