【发布时间】:2012-06-25 23:19:18
【问题描述】:
我是 Emacs 的新手,正在弄清楚如何启用 shift-click 选择。在 CUA Mode 的 EmacsWiki 页面上,以下代码 sn-p 概述了如何执行此操作:
;; 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 的源代码。埃尔。
谁能解释最后一行的工作原理,以及我如何自己找到更多信息?谢谢。
【问题讨论】: