我想重新映射forward-sexp
到matlab-forward-sexp
in matlab-mode
。
目前我这样做:
(define-key matlab-mode-map [remap forward-sexp] 'matlab-forward-sexp-safe)
但是当我输入M-x forward-sexp
matlab-mode 时,我仍然会得到旧的行为。为什么?只有当我forward-sexp
通过键盘快捷键调用时它才有效吗?
当我输入C-h f forward-sexp
一切似乎都很好:
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,
<C-M-right>, ESC <C-right>.
(forward-sexp &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]