title: Remapping Emacs Commands
body: <p>I want to remap <code>forward-sexp</code> to <code>matlab-forward-sexp</code> in <code>matlab-mode</code>.</p>
  
  <p>Currently I do this:</p>
  
  <pre><code>(define-key matlab-mode-map [remap forward-sexp] 'matlab-forward-sexp-safe)
  </code></pre>
  
  <p>but when I type <code>M-x forward-sexp</code> in matlab-mode I still get the old behaviour. Why? Does it only work when I call <code>forward-sexp</code> through a keyboard shortcut?</p>
  
  <p>when I type <code>C-h f forward-sexp</code> everything seems ok:</p>
  
  <pre><code>forward-sexp is an interactive compiled Lisp function in `lisp.el'.
  
  It is remapped to `matlab-forward-sexp-safe', which is bound to C-M-f,
  &lt;C-M-right&gt;, ESC &lt;C-right&gt;.
  
  (forward-sexp &amp;optional ARG)
  
  
  
  For more information check the manuals.
  
  Move forward across one balanced expression (sexp).
  With ARG, do it that many times.  Negative arg -N means
  move backward across N balanced expressions.
  This command assumes point is not in a string or comment.
  
  This function is advised.
  
  After-advice `ctx-flash'.
  
  [back]
  </code></pre>