title: Emacs customization
body: <p>I'm new to the whole Emacs thing, and one of the things that gets me is that out-of-the-box Emacs doesn't keep you within blocks when programming. I program in mostly Python and C++ and hitting enter sends the cursor back to column 1 on a new line rather than keeping you in the block you're working in. I managed to find this:</p>
  
  <pre><code>(add-hook 'python-mode-hook '(lambda () (define-key python-mode-map "\C-m" 'newline-and-indent)))
  </code></pre>
  
  <p>Which binds the enter key to newline-and-indent in Python mode, but how do I extend this to cover C/C++ mode too?</p>