Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • You say you're mostly writing Python, but your examples look like they're from C++. Which is it? Commented Sep 22, 2016 at 3:50
  • Yes, it's C++, I just copied this, cuz I have a work to do for my college holiday project, and they force C++ Commented Sep 22, 2016 at 3:51
  • I think you want to set your c-indentation-style to something else like "linux" (instead of the default "gnu"), via c-set-style. It's been a while since I played with this, so I'll leave it to someone else to answer. It's documented somewhere in the cc-mode manual. Commented Sep 22, 2016 at 3:58
  • 3
    Read this: gnu.org/software/emacs/manual/html_node/emacs/… Commented Sep 22, 2016 at 3:59
  • You can use C-c C-s to check the syntax as it appears to emacs. Then you can use the function c-set-offset to change the indentation for that bit of syntax. Commented Sep 22, 2016 at 15:09