Emacs ESS Mode TAB stops indenting

巧了我就是萌 提交于 2019-12-05 18:13:22

Try to add a space after "#". I don't think ESS-mode handles # as a comment unless you have space after it.

just for the record. Whenever such things happens, select the whole buffer C-x h and press C-M-\ to indent the whole region. This will show unambiguously the syntax error.

I just came across the same problem you describe.

None of the above seemed to work, but I narrowed it down to using a carriage return and then an open parenthesis inside a string, like so:

### indent ( <tab> ) working fine up to here 
   s1 <- "string
(then this in brackets)"
### now indent does nothing!

The fact that it's balanced later doesn't help. I think EMACS reads this as opening a new expression/ block in spite of the fact that it occurs in a quoted string. This seems to apply also to expression openers { and [. It only seems to happen when the 'open expression' symbol appears at the start of the line...

In my case the string was part of a plot label, so the solution was to use \n instead.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!