diff options
| author | Richard M. Stallman | 1994-07-12 17:37:32 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1994-07-12 17:37:32 +0000 |
| commit | 72e2e0c393dec5bcab8bd1ea99e21d1cd76b0abb (patch) | |
| tree | ce9c228628b8a108e125582dd5f994e104fd84fa | |
| parent | 0136e1e36cf02aa96d14d2b2e2b3c0ff98236f6a (diff) | |
| download | emacs-72e2e0c393dec5bcab8bd1ea99e21d1cd76b0abb.tar.gz emacs-72e2e0c393dec5bcab8bd1ea99e21d1cd76b0abb.zip | |
Many doc fixes.
(mouse-extend): Don't use existing region if EVENT is nil.
| -rw-r--r-- | lisp/mouse-sel.el | 24 |
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. |
| 168 | If non-nil, \\[mouse-select] and \\[mouse-extend] will leave point at the end | 168 | If non-nil, \\[mouse-select] and \\[mouse-extend] leave point at the end |
| 169 | of the region nearest to where the mouse last was. | 169 | of the region nearest to where the mouse last was. |
| 170 | If nil, point will always be placed at the beginning of the region.") | 170 | If 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. |
| 174 | If non-nil, regions selected using \\[mouse-select] and \\[mouse-extend] will | 174 | If non-nil, regions selected using \\[mouse-select] and \\[mouse-extend] will |
| 175 | remain highlighted. | 175 | remain highlighted. |
| 176 | If nil, highlighting will be turned off when the mouse is lifted.") | 176 | If 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. |
| 212 | Called with no arguments.") | 212 | Called 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. |
| 216 | The first argument is NCLICKS, is the number of consecutive | 216 | The first argument, NCLICKS, is the number of consecutive |
| 217 | mouse clicks at the same position." | 217 | mouse 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 | ||
| 232 | On click, point & mark are set to click position, and mark is disabled. | 232 | Clicking sets point to click position, and deactivates the mark |
| 233 | if you are in Transient Mark mode. | ||
| 233 | Dragging extends region/selection. | 234 | Dragging extends region/selection. |
| 234 | 235 | ||
| 235 | Double-clicking on word constituents selects words. | 236 | Double-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. | |||
| 263 | This should be bound to a down-mouse event." | 265 | This 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))) |