comparison lisp/prim/mouse.el @ 185:3d6bfa290dbd r20-3b19

Import from CVS: tag r20-3b19
author cvs
date Mon, 13 Aug 2007 09:55:28 +0200
parents 43dd3413c7c7
children acd284d43ca1
comparison
equal deleted inserted replaced
184:bcd2674570bf 185:3d6bfa290dbd
30 (global-set-key '(shift button1) 'mouse-track-adjust) 30 (global-set-key '(shift button1) 'mouse-track-adjust)
31 (global-set-key '(control button1) 'mouse-track-insert) 31 (global-set-key '(control button1) 'mouse-track-insert)
32 (global-set-key '(control shift button1) 'mouse-track-delete-and-insert) 32 (global-set-key '(control shift button1) 'mouse-track-delete-and-insert)
33 (global-set-key '(meta button1) 'mouse-track-do-rectangle) 33 (global-set-key '(meta button1) 'mouse-track-do-rectangle)
34 34
35 (global-set-key 'button2 'mouse-yank) 35 ;; enable drag regions (ograf@fga.de)
36 (if (or (featurep 'offix) ;; do we have DnD support?
37 (featurep 'cde))
38 (global-set-key 'button2 'mouse-drag-or-yank)
39 (global-set-key 'button2 'mouse-yank))
36 40
37 (defcustom mouse-track-rectangle-p nil 41 (defcustom mouse-track-rectangle-p nil
38 "*If true, then dragging out a region with the mouse selects rectangles 42 "*If true, then dragging out a region with the mouse selects rectangles
39 instead of simple start/end regions." 43 instead of simple start/end regions."
40 :type 'boolean 44 :type 'boolean
139 (defun point-inside-selection-p () 143 (defun point-inside-selection-p ()
140 ;; by Stig@hackvan.com 144 ;; by Stig@hackvan.com
141 (or (point-inside-extent-p primary-selection-extent) 145 (or (point-inside-extent-p primary-selection-extent)
142 (point-inside-extent-p zmacs-region-extent))) 146 (point-inside-extent-p zmacs-region-extent)))
143 147
144 ;;; #### - finish this... 148 (defun mouse-drag-or-yank (event)
145 ;;; (defun mouse-drag-or-yank (event) 149 "Either drag or paste the current selection. If the variable
146 ;;; "Either drag or paste the current selection. If the variable 150 `mouse-yank-at-point' is non-nil, then moves the cursor to the location of
147 ;;; `mouse-yank-at-point' is non-nil, then moves the cursor to the location of 151 the click before pasting.
148 ;;; the click before pasting." 152 This functions has to be improved. Until now it is just a (working) test."
149 ;;; (interactive "e") 153 ;; by ograf@fga.de
150 ;;; (if (click-inside-selection-p event) 154 (interactive "e")
151 ;;; ;; okay, this is a drag 155 (if (click-inside-extent-p event zmacs-region-extent)
152 ;;; ) 156 ;; okay, this is a drag
153 ;;; ) 157 (cond ((featurep 'offix)
158 (offix-start-drag-region event
159 (extent-start-position zmacs-region-extent)
160 (extent-end-position zmacs-region-extent)))
161 ((featurep 'cde)
162 ;; should also work with CDE
163 (cde-start-drag
164 (extent-start-position zmacs-region-extent)
165 (extent-end-position zmacs-region-extent)))
166 (t ding))
167 ;; no drag, call region-funct
168 (and (not mouse-yank-at-point)
169 (mouse-set-point event))
170 (funcall mouse-yank-function))
171 )
154 172
155 (defun mouse-eval-sexp (click force-window) 173 (defun mouse-eval-sexp (click force-window)
156 "Evaluate the sexp under the mouse. Usually, this is the last sexp before 174 "Evaluate the sexp under the mouse. Usually, this is the last sexp before
157 the click, but if you click on a left paren, then it is the sexp beginning 175 the click, but if you click on a left paren, then it is the sexp beginning
158 with the paren that is evaluated. Also, since strings evaluate to themselves, 176 with the paren that is evaluated. Also, since strings evaluate to themselves,