我是 Emacs 的新手,正在弄清楚如何启用 shift-click 选择。在CUA 模式的 EmacsWiki 页面上,以下代码片段概述了如何执行此操作:
;; shift + click select region
(define-key global-map (kbd "<S-down-mouse-1>") 'ignore) ; turn off font dialog
(define-key global-map (kbd "<S-mouse-1>") 'mouse-set-point)
(put 'mouse-set-point 'CUA 'move)
我不明白最后一行如何启用选择。我研究了put的定义:
put is a built-in function in `C source code'.
(put SYMBOL PROPNAME VALUE)
Store SYMBOL's PROPNAME property with value VALUE.
It can be retrieved with `(get SYMBOL PROPNAME)'.
和 mouse-set-point的定义:
mouse-set-point is an interactive compiled Lisp function in
`mouse.el'.
It is bound to <S-mouse-1>, <triple-mouse-1>, <double-mouse-1>,
<mouse-1>.
(mouse-set-point EVENT)
Move point to the position clicked on with the mouse.
This should be bound to a mouse click event type.
但他们都没有提供任何线索。我找不到任何名为move的变量或函数,并且我还查看了 mouse.el、cua-base.el、cua-gmrk.el 和 cua-rect.el 的源代码。
有人会解释最后一行是如何工作的,以及我如何自己找到更多信息?谢谢。