例如,我的光标(point)位于单词" cursor“中的任意字母处。我想删除(删除)这个单词,这样它就会被复制到kill-ring。
发布于 2015-10-31 18:41:45
你可以使用它作为一个框架,在这一点上杀死各种东西:
(defun my-kill-thing-at-point (thing)
"Kill the `thing-at-point' for the specified kind of THING."
(let ((bounds (bounds-of-thing-at-point thing)))
(if bounds
(kill-region (car bounds) (cdr bounds))
(error "No %s at point" thing))))
(defun my-kill-word-at-point ()
"Kill the word at point."
(interactive)
(my-kill-thing-at-point 'word))
(global-set-key (kbd "s-k w") 'my-kill-word-at-point)https://stackoverflow.com/questions/33442027
复制相似问题