title: Emacs comment/uncomment current line
body: <p>I know there's already an Emacs question on this, and that it was closed, but I find it quite relevant and important.</p>
  
  <p>Basically, I want to comment/uncomment the current line. I was expecting this to be fairly easy with a macro, but I found that it really isn't.</p>
  
  <p>If the current line is commented, uncomment. If it is uncommented, comment it. And I would also to comment out the whole line, not just from cursor position.</p>
  
  <p>I tried a macro like this:</p>
  
  <p><kbd>C-a</kbd></p>
  
  <pre><code>'comment-dwim
  </code></pre>
  
  <p>But this only work to comment a line, not to uncomment it, if it's already commented.</p>
  
  <p>I'm not sure of how easy it is, but if there's some way, I'd really like it.</p>
  
  <p>Also, the reason I love this idea so much is that when I used Geany, I just used <kbd>C-e</kbd> and it was perfect.</p>