Subject: bug#51557: 27.2; `mouse-1' with `cua-rectangle-mark-mode'

From: Lars Ingebrigtsen <[email-masked]>
Date: Thu, 04 Nov 2021 19:35:49 +0100

Drew Adams <[email-masked]> writes:

> 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?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no