diff options
| author | Mattias EngdegÄrd | 2019-10-25 11:16:39 +0200 |
|---|---|---|
| committer | Mattias EngdegÄrd | 2019-11-27 13:40:29 +0100 |
| commit | 4eb7db5d4b84708912c63a77569c8adeeff6c640 (patch) | |
| tree | e4f014f3b2b2407ec74e875a8ef2ab3bc37b2225 /src | |
| parent | e7b4c248a6d2a2eca19a2a362103a7f24cfe30fc (diff) | |
| download | emacs-4eb7db5d4b84708912c63a77569c8adeeff6c640.tar.gz emacs-4eb7db5d4b84708912c63a77569c8adeeff6c640.zip | |
Mouse rectangular region selection (bug#38013)
Make it possible to select a rectangular region using the mouse.
The standard binding is C-M-mouse-1.
* lisp/mouse.el (mouse-scroll-subr): Add ADJUST argument.
(mouse-drag-region-rectangle): New.
* lisp/rect.el (rectangle--reset-point-crutches): New.
(rectangle--reset-crutches): Use 'rectangle--reset-point-crutches'.
* src/xdisp.c (remember_mouse_glyph, syms_of_xdisp):
Add 'mouse-fine-grained-tracking'.
* doc/lispref/commands.texi (Motion Events):
Document 'mouse-fine-grained-tracking'.
* doc/emacs/frames.texi (Mouse Commands):
* doc/emacs/killing.texi (Rectangles):
* etc/NEWS: Document rectangular selection with the mouse.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 2b4dda27157..c4d23be4cde 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -2491,6 +2491,12 @@ remember_mouse_glyph (struct frame *f, int gx, int gy, NativeRectangle *rect) | |||
| 2491 | enum glyph_row_area area; | 2491 | enum glyph_row_area area; |
| 2492 | int x, y, width, height; | 2492 | int x, y, width, height; |
| 2493 | 2493 | ||
| 2494 | if (mouse_fine_grained_tracking) | ||
| 2495 | { | ||
| 2496 | STORE_NATIVE_RECT (*rect, gx, gy, 1, 1); | ||
| 2497 | return; | ||
| 2498 | } | ||
| 2499 | |||
| 2494 | /* Try to determine frame pixel position and size of the glyph under | 2500 | /* Try to determine frame pixel position and size of the glyph under |
| 2495 | frame pixel coordinates X/Y on frame F. */ | 2501 | frame pixel coordinates X/Y on frame F. */ |
| 2496 | 2502 | ||
| @@ -34946,6 +34952,12 @@ The default is to use octal format (\200) whereas hexadecimal (\x80) | |||
| 34946 | may be more familiar to users. */); | 34952 | may be more familiar to users. */); |
| 34947 | display_raw_bytes_as_hex = false; | 34953 | display_raw_bytes_as_hex = false; |
| 34948 | 34954 | ||
| 34955 | DEFVAR_BOOL ("mouse-fine-grained-tracking", mouse_fine_grained_tracking, | ||
| 34956 | doc: /* Non-nil for pixel-wise mouse-movement. | ||
| 34957 | When nil, mouse-movement events will not be generated as long as the | ||
| 34958 | mouse stays within the extent of a single glyph (except for images). */); | ||
| 34959 | mouse_fine_grained_tracking = false; | ||
| 34960 | |||
| 34949 | } | 34961 | } |
| 34950 | 34962 | ||
| 34951 | 34963 | ||