title: Switch back and forth between last two buffers in emacs
body: <p>I would like to switch back and forth between the last two visited buffers (current one and previous one) and bind the command to <code>M-b</code>.</p>
  
  <p><code>(switch-to-buffer (other-buffer))</code> in theory should accomplish this, but adding the following code to my <code>.emacs</code> has no effect.</p>
  
  <pre><code>(defun my-switch-to-other-buffer ()
    "Switch to other buffer"
    (interactive)
    (switch-to-buffer (other-buffer)))
  
  (global-set-key [M-b] 'my-switch-to-other-buffer)
  </code></pre>
  
  <p>Please suggest a fix to the code above or a better way to accomplish this task.</p>