emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

mouse.el patch for region tracking


From: JD Smith
Subject: mouse.el patch for region tracking
Date: Sat, 31 Dec 2005 00:00:02 -0700


Recently I found that Emacs 22 breaks a simple usage of mouse-drag- region for defining regions by mouse drag. When transient-mark-mode is set, mouse-drag-region under Emacs 21 would let you define a region by dragging, and when the drag is released, it completes (at which point you can operate on the region). This is somewhat similar to the XEmacs function 'mouse-track'.

With Emacs 22, several changes were introduced to mouse-drag-region (unrelated improvements) which broke this apparently unsupported usage. This breaks a very useful drag-to-inspect functionality in my IDLWAVE programming mode. The call to mouse-drag-region would not complete without an additional event after the drag completes.

Since I want all the rich behavior of mouse-drag-region (double- and triple-click select by word and line, etc.), a very simple fix is to re-christen 'mouse-drag-region-1' as 'mouse-drag-track', and provide it an optional argument to enable calling the final event handling code which was tripping me up. Then I can use this functio

I have to admit having understood little of the code I've wrapped in 'handle-terminating-event', only that it indirectly calls read-event via 'mouse-show-mark' and thus blocks the return of the function, thus breaking of my old use of mouse-drag-region. I would appreciate it if you could look this over and see if it's doing what I want it to (inasmuch as I've communicated that). In particular the doc string is a bit weak if this function were to be advertised for more general usage by programmers.

JD

 

Attachment: mouse_patch_jds.diff
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]