GNU bug report logs -
#31240
mouse commands not aware of rectangle regions
Previous Next
Reported by: charles <at> aurox.ch (Charles A. Roelli)
Date: Sun, 22 Apr 2018 18:35:02 UTC
Severity: normal
Found in version 26.1
Done: martin rudalics <rudalics <at> gmx.at>
Bug is archived. No further changes may be made.
Full log
Message #133 received at 31240 <at> debbugs.gnu.org (full text, mbox):
> Let's keep B) in mind for the case that someone comes up with a real
> use case where this would be needed. Mine was just a constructed one
> that looked convincing to me to to be reported.
I agree that option B) seems better. Should I implement it now. or
would it be better to wait for other opinions?
> The only remaining problem I have now is that we are far beyond the 80
> columns limit for code. I came up with truncating the assignment to
> 'drag-but-negligible' as follows
> ...
> but that's ugly. If you have any ideas how to handle that better (for
> example, by moving the comment up by a few lines) I'll do that.
> Otherwise, I'll have to use that form above.
I started re-indenting some lines to see if I could make them fit in 80 columns,
but then I realized the results were exactly the same as yours. I just ended up
moving the comment instead:
;; Check if "drag but negligible". Operation "drag but
;; negligible" is defined as drag-and-drop the text to
;; the original region. When modifier is pressed, the
;; text will be inserted to inside of the original
;; region.
;; If the region is rectangular, check if the newly inserted
;; rectangular text would intersect the already selected
;; region. If it would, then set "drag-but-negligible" to t.
;; As a special case, allow dragging the region freely anywhere
;; to the left, as this will never trigger its contents to be
;; inserted into the overlays tracking it.
(setq drag-but-negligible
(and (eq (overlay-buffer (car mouse-drag-and-drop-overlays))
buffer-to-paste)
(if region-noncontiguous
(let ((size (cons region-width region-height))
(start-coordinates
(rectangle-position-as-coordinates start))
(point-to-paste-coordinates
(rectangle-position-as-coordinates
point-to-paste)))
(and (rectangle-intersect-p
start-coordinates size
point-to-paste-coordinates size)
(not (<= (car point-to-paste-coordinates)
(car start-coordinates)))))
(and (<= (overlay-start
(car mouse-drag-and-drop-overlays))
point-to-paste)
(<= point-to-paste
(overlay-end
(car mouse-drag-and-drop-overlays))))))))
This bug report was last modified 6 years and 219 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.