GNU bug report logs - #31240
mouse commands not aware of rectangle regions

Previous Next

Package: emacs;

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 #97 received at 31240 <at> debbugs.gnu.org (full text, mbox):

From: martin rudalics <rudalics <at> gmx.at>
To: Federico Tedin <federicotedin <at> gmail.com>, homeros.misasa <at> gmail.com
Cc: 31240 <at> debbugs.gnu.org, tkk <at> misasa.okayama-u.ac.jp, charles <at> aurox.ch
Subject: Re: bug#31240: 26.1; mouse-save-then-kill does not kill rectangles
Date: Sat, 06 Oct 2018 19:08:51 +0200
> The example Homeros tried to run won't work, because the newly intersected
> rectangle would intersect the original rectangle. This behaviour is
> intentional, as it
> is similar to mouse-drag-and-drop-region's behaviour with non-rectangle regions.
>
> However, I think an exception could be made for rectangle operations move the
> rectangle horizontally to the left, as Tak said. When the rectangle is
> dragged to the left,
> there's no way its content could be accidentally added to the overlays
> tracking the original
> rectangle, so it'll always work correctly (even if
> rectangle-intersect-p returns t).

FWIW I see no problems with the following naive amendment

                           (let ((size (cons region-width region-height)))
                             (and (rectangle-intersect-p
                                   (rectangle-position-as-coordinates start) size
                                   (rectangle-position-as-coordinates point-to-paste) size)
                                  (not (= (line-number-at-pos start)
                                          (line-number-at-pos point-to-paste)))))

which also allows shifting the rectangle strictly to the left or
right.  IIUC it's the deletion of the original rectangle after the
copy was inserted on a different line that's causing havoc with
intersections.  But I have not tested all possible variants so please
correct me if I'm wrong.

martin




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.