Subject: bug#38013: [PATCH] Rectangular region selection with mouse

From: martin rudalics <[email-masked]>
Date: Tue, 5 Nov 2019 10:35:30 +0100

> The rectangle-mark code can perhaps be rewritten to work that way,

Any code based on mouse dragging should be written in such way that
the corresponding click event can be easily handed over to a separate
command.  That's what the drag- prefix is for.

 > but doesn't it force the pop-up menu to be used with
 > click-release-select-click-release instead of the quicker
 > click-select-release?

Yes and I think that the former is the correct and expected behavior.
I don't use the buffer menu but if I did I were much more annoyed by
the fact that when I abandon the selection by clicking somewhere else
I get an active region which I then have to click away in a further
step.

Note that even the Emacs manual itself confuses down-mouse events and
clicks as

   ‘C-mouse-1’
      This menu is for selecting a buffer.

      The MSB (“mouse select buffer”) global minor mode makes this menu
      smarter and more customizable.  *Note Buffer Menus::.

and

   It replaces the ‘mouse-buffer-menu’ commands, normally bound to
   ‘C-Down-mouse-1’

IMHO the rule should be that non-dragging commands are always bound to
clicks (including double and triple ones) and never to a down- event.
The menu bar might be an exception (Firefox even pops up an entry when
the mouse just hovers over it) but the various (non-)toolkits Emacs
uses for it apparently defeat a common unified behavior anway.

And personally, I'd reserve C-drag-mouse for marking arbitrary
non-contiguous text (like, for example, Firefox does) and use
C-S-drag-mouse for marking rectangular regions.

martin