在AucTeX中,评论后的逐项列表中的新项目会生成注释的下一项

ste*_*ejb 6 emacs latex auctex

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

\begin{itemize}
 \item My item % note to self
\end{itemize}
Run Code Online (Sandbox Code Playgroud)

当我在"自我"之后做Cc Cj时,我得到:

\begin{itemize}
 \item My item % note to self
 % \item
\end{itemize}
Run Code Online (Sandbox Code Playgroud)

当我想要的时候:

\begin{itemize}
 \item My item % note to self
 \item
\end{itemize}
Run Code Online (Sandbox Code Playgroud)

是否有可以修改的设置以使其正常工作?

pol*_*lot 4

(setq LaTeX-insert-into-comments nil)
Run Code Online (Sandbox Code Playgroud)

似乎解决了问题,尽管它可能会产生我不知道的其他影响。要使用它,请将其放入您的 .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.
Run Code Online (Sandbox Code Playgroud)

编辑:

这是更好的东西:

(defadvice LaTeX-insert-item (around my-LaTeX-insert-item activate)
     (let  ((LaTeX-insert-into-comments nil)) ad-do-it))
Run Code Online (Sandbox Code Playgroud)

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