【发布时间】:2012-04-03 10:28:30
【问题描述】:
我想在matlab-mode 中将forward-sexp 重新映射为matlab-forward-sexp。
目前我这样做:
(define-key matlab-mode-map [remap forward-sexp] 'matlab-forward-sexp-safe)
但是当我在 matlab 模式下输入 M-x forward-sexp 时,我仍然会得到旧的行为。为什么?只有当我通过键盘快捷键调用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]
【问题讨论】:
标签: emacs elisp key-bindings remap