There has got to be a better way to indent a block of code for stackoverflow posts using Emacs. My current strategy is to:
- Select a text region
- execute M-x indent-code-rigidly
- run C-x z three times to reindent the region
This seems brain-dead. Please enlighten me as to how to make this happen in a clever and elegant manner.
This isn’t materially different from scottfrazer’s answer, but it’s a tad easier to type:
C-u C-x C-i