Make Emacs less aggressive about indentation

╄→尐↘猪︶ㄣ 提交于 2019-12-18 17:14:27

问题


Emacs reindents the current line whenever I type certain things, like ";" or "//". This is pretty annoying, since there are a whole lot of places where it isn't smart enough to indent correctly.

How do I disable this feature? I still want to be able to indent the line with TAB, but I don't want any source code I type to cause it to reindent.

(I'm using Dylan Moonfire's C# mode, but this probably applies to any cc-mode.)


回答1:


Try running c-toggle-electric-state to turn off the electric action of these characters.

You can do this as part of a c-mode-common-hook, or toggle the state manually by hitting C-c C-l.




回答2:


most likely caused by the inline-and-indent 'feature' of c-mode and derivatives. emacswiki has several solutions.



来源:https://stackoverflow.com/questions/1330066/make-emacs-less-aggressive-about-indentation

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