我想改变Ctrl-d键的行为。所以它会向后删除一个单词。我创建了一个函数:
(defun backward-delete-word (arg)
"Delete characters backward until encountering the beginning of a word.
With argument ARG, do this that many times."
(interactive "p")
(delete-region (point) (progn (backward-word arg) (point))))
然后将其插入emacs.d
:
(global-set-key (kbd "\C-d") 'backward-delete-word)
它在基本模式下工作,但在 php 模式下它只是删除下一个字符。当我点击
Ctrl-h k Ctrl-d
Emacs 给出了这个:
C-d runs the command c-electric-delete-forward, which is an
interactive compiled Lisp function in `cc-cmds.el'.
It is bound to C-d.
(c-electric-delete-forward ARG)
不知何故,它被重置为另一个功能。如何找出它的重置位置并使其与我的功能一起使用?