aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/mouse-sel.el24
1 files changed, 13 insertions, 11 deletions
diff --git a/lisp/mouse-sel.el b/lisp/mouse-sel.el
index 57df04e1674..112f7285663 100644
--- a/lisp/mouse-sel.el
+++ b/lisp/mouse-sel.el
@@ -165,15 +165,15 @@
165 165
166(defvar mouse-sel-leave-point-near-mouse t 166(defvar mouse-sel-leave-point-near-mouse t
167 "*Leave point near last mouse position. 167 "*Leave point near last mouse position.
168If non-nil, \\[mouse-select] and \\[mouse-extend] will leave point at the end 168If non-nil, \\[mouse-select] and \\[mouse-extend] leave point at the end
169of the region nearest to where the mouse last was. 169of the region nearest to where the mouse last was.
170If nil, point will always be placed at the beginning of the region.") 170If nil, point is always placed at the beginning of the region.")
171 171
172(defvar mouse-sel-retain-highlight nil 172(defvar mouse-sel-retain-highlight nil
173 "*Retain highlight on mouse-drag-overlay. 173 "*Retain highlight after dragging is finished.
174If non-nil, regions selected using \\[mouse-select] and \\[mouse-extend] will 174If non-nil, regions selected using \\[mouse-select] and \\[mouse-extend] will
175remain highlighted. 175remain highlighted.
176If nil, highlighting will be turned off when the mouse is lifted.") 176If nil, highlighting turns off when you release the mouse button.")
177 177
178(defvar mouse-sel-cycle-clicks t 178(defvar mouse-sel-cycle-clicks t
179 "*If non-nil, \\[mouse-select] cycles the click-counts after 3 clicks. 179 "*If non-nil, \\[mouse-select] cycles the click-counts after 3 clicks.
@@ -208,12 +208,12 @@ Called with no argument.")
208 (if (fboundp 'x-selection-owner-p) 208 (if (fboundp 'x-selection-owner-p)
209 'x-selection-owner-p 209 'x-selection-owner-p
210 nil) 210 nil)
211 "Function to check whether emacs still owns the selection. 211 "Function to check whether Emacs still owns the selection.
212Called with no arguments.") 212Called with no arguments.")
213 213
214(defun mouse-sel-determine-selection-type (NCLICKS) 214(defun mouse-sel-determine-selection-type (NCLICKS)
215 "Determine what `thing' `mouse-sel' should operate on. 215 "Determine what \"thing\" `mouse-sel' should operate on.
216The first argument is NCLICKS, is the number of consecutive 216The first argument, NCLICKS, is the number of consecutive
217mouse clicks at the same position." 217mouse clicks at the same position."
218 (let* ((next-char (char-after (point))) 218 (let* ((next-char (char-after (point)))
219 (char-syntax (if next-char (char-syntax next-char))) 219 (char-syntax (if next-char (char-syntax next-char)))
@@ -229,7 +229,8 @@ mouse clicks at the same position."
229(defun mouse-select (EVENT) 229(defun mouse-select (EVENT)
230 "Set region/selection using the mouse. 230 "Set region/selection using the mouse.
231 231
232On click, point & mark are set to click position, and mark is disabled. 232Clicking sets point to click position, and deactivates the mark
233if you are in Transient Mark mode.
233Dragging extends region/selection. 234Dragging extends region/selection.
234 235
235Double-clicking on word constituents selects words. 236Double-clicking on word constituents selects words.
@@ -247,6 +248,7 @@ This should be bound to a down-mouse event."
247 (setq mouse-sel-selection-type 248 (setq mouse-sel-selection-type
248 (mouse-sel-determine-selection-type (event-click-count EVENT))) 249 (mouse-sel-determine-selection-type (event-click-count EVENT)))
249 (let ((object-bounds (bounds-of-thing-at-point mouse-sel-selection-type))) 250 (let ((object-bounds (bounds-of-thing-at-point mouse-sel-selection-type)))
251 (setq foo object-bounds)
250 (if object-bounds 252 (if object-bounds
251 (progn 253 (progn
252 (setq mark-active t) 254 (setq mark-active t)
@@ -263,8 +265,8 @@ See documentation for mouse-select for more details.
263This should be bound to a down-mouse event." 265This should be bound to a down-mouse event."
264 (interactive "e") 266 (interactive "e")
265 (if EVENT (select-window (posn-window (event-end EVENT)))) 267 (if EVENT (select-window (posn-window (event-end EVENT))))
266 (let* ((min (if mark-active (region-beginning) (point))) 268 (let* ((min (if (and EVENT mark-active) (region-beginning) (point)))
267 (max (if mark-active (region-end) (point))) 269 (max (if (and EVENT mark-active) (region-end) (point)))
268 (orig-window (selected-window)) 270 (orig-window (selected-window))
269 (orig-window-frame (window-frame orig-window)) 271 (orig-window-frame (window-frame orig-window))
270 (top (nth 1 (window-edges orig-window))) 272 (top (nth 1 (window-edges orig-window)))
@@ -332,7 +334,7 @@ This should be bound to a down-mouse event."
332 (t (goto-char (posn-point end))) 334 (t (goto-char (posn-point end)))
333 335
334 ) 336 )
335 337 (setq foo1 (cons (list min max (point)) foo1))
336 ;; Determine direction of drag 338 ;; Determine direction of drag
337 (cond 339 (cond
338 ((and (not direction) (not (eq min max))) 340 ((and (not direction) (not (eq min max)))