Subject: RE: [External] : Re: bug#51557: 27.2; `mouse-1' with `cua-rectangle-mark-mode'

From: Drew Adams <[email-masked]>
Date: Thu, 4 Nov 2021 18:47:14 +0000

> > M-x cua-rectangle-mark-mode ; (after selecting a region or not)
> >
> > Click `mouse-1' somewhere.  No effect, it seems.  The mode remains in
> > effect (same key help is displayed).
> >
> > Click `mouse-1' again (anywhere).  It seems that that exits
> > `cua-rectangle-mode'.
> 
> It seems like the intention is to re-start the rectangle on mouse-1?  I
> don't use the mode either, but that does seem to make sense to me.
> 
> (defun cua-mouse-set-rectangle-mark (event)
>   "Start rectangle at mouse click position."
>   (interactive "e")
>   (when cua--rectangle
>     (cua--deactivate-rectangle)
>     (cua--deactivate t))
>   (setq cua--last-rectangle nil)
>   (mouse-set-point event)
>   ;; FIX ME -- need to calculate virtual column.
>   (cua-set-rectangle-mark)
>   (setq cua--buffer-and-point-before-command nil)
>   (setq cua--mouse-last-pos nil))
> 
> And I guess the "FIX ME" is part of the problem here.  Anybody else got
> any insights here?

Whatever you decide, I suggest that (other things being
equal), the same behavior be added to `rectangle-mark-mode'.

(It seems to me that mouse-1 could do something useful
here.  Maybe that would be a simple as exiting (as in
`rectangle-mark-mode' or as simple as restarting a
rectangle.  Or maybe it could be something more helpful
or more interesting (I don't have any suggestion, off
the top of my head.).