mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-05 15:11:30 -08:00
Many doc fixes.
(mouse-extend): Don't use existing region if EVENT is nil.
This commit is contained in:
parent
0136e1e36c
commit
72e2e0c393
1 changed files with 13 additions and 11 deletions
|
|
@ -165,15 +165,15 @@
|
|||
|
||||
(defvar mouse-sel-leave-point-near-mouse t
|
||||
"*Leave point near last mouse position.
|
||||
If non-nil, \\[mouse-select] and \\[mouse-extend] will leave point at the end
|
||||
If non-nil, \\[mouse-select] and \\[mouse-extend] leave point at the end
|
||||
of the region nearest to where the mouse last was.
|
||||
If nil, point will always be placed at the beginning of the region.")
|
||||
If nil, point is always placed at the beginning of the region.")
|
||||
|
||||
(defvar mouse-sel-retain-highlight nil
|
||||
"*Retain highlight on mouse-drag-overlay.
|
||||
"*Retain highlight after dragging is finished.
|
||||
If non-nil, regions selected using \\[mouse-select] and \\[mouse-extend] will
|
||||
remain highlighted.
|
||||
If nil, highlighting will be turned off when the mouse is lifted.")
|
||||
If nil, highlighting turns off when you release the mouse button.")
|
||||
|
||||
(defvar mouse-sel-cycle-clicks t
|
||||
"*If non-nil, \\[mouse-select] cycles the click-counts after 3 clicks.
|
||||
|
|
@ -208,12 +208,12 @@ Called with no argument.")
|
|||
(if (fboundp 'x-selection-owner-p)
|
||||
'x-selection-owner-p
|
||||
nil)
|
||||
"Function to check whether emacs still owns the selection.
|
||||
"Function to check whether Emacs still owns the selection.
|
||||
Called with no arguments.")
|
||||
|
||||
(defun mouse-sel-determine-selection-type (NCLICKS)
|
||||
"Determine what `thing' `mouse-sel' should operate on.
|
||||
The first argument is NCLICKS, is the number of consecutive
|
||||
"Determine what \"thing\" `mouse-sel' should operate on.
|
||||
The first argument, NCLICKS, is the number of consecutive
|
||||
mouse clicks at the same position."
|
||||
(let* ((next-char (char-after (point)))
|
||||
(char-syntax (if next-char (char-syntax next-char)))
|
||||
|
|
@ -229,7 +229,8 @@ mouse clicks at the same position."
|
|||
(defun mouse-select (EVENT)
|
||||
"Set region/selection using the mouse.
|
||||
|
||||
On click, point & mark are set to click position, and mark is disabled.
|
||||
Clicking sets point to click position, and deactivates the mark
|
||||
if you are in Transient Mark mode.
|
||||
Dragging extends region/selection.
|
||||
|
||||
Double-clicking on word constituents selects words.
|
||||
|
|
@ -247,6 +248,7 @@ This should be bound to a down-mouse event."
|
|||
(setq mouse-sel-selection-type
|
||||
(mouse-sel-determine-selection-type (event-click-count EVENT)))
|
||||
(let ((object-bounds (bounds-of-thing-at-point mouse-sel-selection-type)))
|
||||
(setq foo object-bounds)
|
||||
(if object-bounds
|
||||
(progn
|
||||
(setq mark-active t)
|
||||
|
|
@ -263,8 +265,8 @@ See documentation for mouse-select for more details.
|
|||
This should be bound to a down-mouse event."
|
||||
(interactive "e")
|
||||
(if EVENT (select-window (posn-window (event-end EVENT))))
|
||||
(let* ((min (if mark-active (region-beginning) (point)))
|
||||
(max (if mark-active (region-end) (point)))
|
||||
(let* ((min (if (and EVENT mark-active) (region-beginning) (point)))
|
||||
(max (if (and EVENT mark-active) (region-end) (point)))
|
||||
(orig-window (selected-window))
|
||||
(orig-window-frame (window-frame orig-window))
|
||||
(top (nth 1 (window-edges orig-window)))
|
||||
|
|
@ -332,7 +334,7 @@ This should be bound to a down-mouse event."
|
|||
(t (goto-char (posn-point end)))
|
||||
|
||||
)
|
||||
|
||||
(setq foo1 (cons (list min max (point)) foo1))
|
||||
;; Determine direction of drag
|
||||
(cond
|
||||
((and (not direction) (not (eq min max)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue