Emacs ESS 模式 - 注释区域的标签 [英] Emacs ESS Mode - Tabbing for Comment Region
问题描述
我正在为 Emacs 使用 Emacs-Speaks-Statistics (ESS) 模式.编辑 R 代码时,当我在其上方创建新行时,任何注释行(以 # 开头的那些)都会自动被标签到最右侧.我应该如何更改我的 .emacs.el 文件来解决这个问题?
I am using the Emacs-Speaks-Statistics (ESS) mode for Emacs. When editing R code, any comment lines (those starting with #) automatically get tabbed to the far right when I create a new line above it. How should I change my .emacs.el file to fix this?
例如,我有:
# Comment
现在,将光标放在行首并按 Enter 后,我得到:
Now, after putting my cursor at the beginning of the line and pressing Enter, I get:
# Comment
感谢您的任何提示.
推荐答案
如果您不希望注释缩进,请使用###".根据手册,
Use '###' if you don't want the comments indented. According to the manual,
默认情况下,注释以‘###’ 对齐到开头线.以‘##’开头的注释与当前的水平保持一致包含块的缩进评论.最后,评论以#"开头的对齐到一个右侧的列(第 40 列默认情况下,但这个值是由变量控制评论栏,) 或就在包含该行的表达式评论如果它超出了缩进列.
By default, comments beginning with ‘###’ are aligned to the beginning of the line. Comments beginning with ‘##’ are aligned to the current level of indentation for the block containing the comment. Finally, comments beginning with ‘#’ are aligned to a column on the right (the 40th column by default, but this value is controlled by the variable comment-column,) or just after the expression on the line containing the comment if it extends beyond the indentation column.
这篇关于Emacs ESS 模式 - 注释区域的标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!