Emacs ESS模式 - 评论区域的标签 [英] Emacs ESS Mode - Tabbing for Comment Region

查看:91
本文介绍了Emacs ESS模式 - 评论区域的标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Emacs的Emacs-Speaks-Statistics(ESS)模式。当编辑R代码时,当我在其上创建一条新行时,任何注释行(以#开头的那些)自动标签到最右边。如何更改.emacs.el文件来解决这个问题?



例如,我有:

 #评论

现在,把光标放在该行并按Enter键,我得到:

 #评论

感谢任何提示。

解决方案

使用'###'如果你不想让评论缩进。根据手册


默认情况下,以
'###开头的注释与
的开头对齐。以'##'
开始的注释与
的当前级别的
缩进相同,该块包含
的注释。最后,以'#'开头的
的注释与右侧的
列对齐(默认为第40列
,但该值为
,由变量$ b $控制b comment-column,)或刚刚在包含
注释的
表达式之后,如果它超出
缩进列。



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?

For example, I have:

# Comment

Now, after putting my cursor at the beginning of the line and pressing Enter, I get:

                                # Comment

Thanks for any hints.

解决方案

Use '###' if you don't want the comments indented. According to the manual,

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆