Emacs 在AucTeX中,注释后的项目列表中的新项目将导致注释后的下一个项目

Emacs 在AucTeX中,注释后的项目列表中的新项目将导致注释后的下一个项目,emacs,latex,auctex,Emacs,Latex,Auctex,在AucTeX中,编辑项目列表时: \begin{itemize} \item My item % note to self \end{itemize} 当我在“自我”之后做C-C-j时,我得到: \begin{itemize} \item My item % note to self % \item \end{itemize} 当我想要的时候: \begin{itemize} \item My item % note to self \item \end{itemize} 是否

在AucTeX中,编辑项目列表时:

\begin{itemize}
 \item My item % note to self
\end{itemize}
当我在“自我”之后做C-C-j时,我得到:

\begin{itemize}
 \item My item % note to self
 % \item
\end{itemize}
当我想要的时候:

\begin{itemize}
 \item My item % note to self
 \item
\end{itemize}
是否有可以修改的设置以使其正常工作

(setq LaTeX-insert-into-comments nil)
似乎解决了这个问题,虽然它可能有其他影响,我不知道。要使用它,请将其放入.emacs自定义文件中;要测试它,请尝试
M-:
,然后将上面的代码粘贴到提示符中

变量
LaTeX insert into comments
定义为

*Whether insertion commands stay in comments. 
This allows using the insertion commands even when
the lines are outcommented, like in dtx files.

编辑:

这里有更好的:

(defadvice LaTeX-insert-item (around my-LaTeX-insert-item activate)
     (let  ((LaTeX-insert-into-comments nil)) ad-do-it))

这将通过仅在插入项目时临时更改
LaTeX insert-into-comments
来防止将
LaTeX insert-into-comments
全局设置为
nil
产生不必要的影响。同样,要使用它,请将它放在.emacs自定义文件中。

。。。因此,前一行末尾的注释导致新行被注释。我认为这是AucTeX的一个已知错误。