emacs-devel
[Top][All Lists]
Advanced

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

Re: transient-mark-mode in 22.0


From: Stefan Monnier
Subject: Re: transient-mark-mode in 22.0
Date: Sun, 12 Jun 2005 12:29:42 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

> So does anyone besides me see it as a problem that mouse-drag-region
> does not return when the mouse drag is complete, but instead requires
> yet another event of some kind (any kind) after the mouse-up to let it
> return?  Is that not a new bug?  That functionality was really what was
> behind my use of transient-mark-mode.

> If that's really now an impossibility, can anyone recommend another
> method to allow a region to be mouse-dragged with highlighting, and a
> menu popped up upon drag completion?

I agree with you that Emacs should have a function similar to XEmacs's
mouse-track and that your (let ((transient-mark-mode t))
(mouse-drag-region)) was a pretty good approximation of it, which
Emacs-22 breaks.

But I also agree with Richard that the solution is probably not to change
mouse-drag-region to do what you want.  After all mouse-drag-region is
a command which does many predefined things which you don't want, whereas
you only want a function that does "one" particular thing.

Maybe you should try and restructure mouse-drag-region so as to define a new
function, used by mouse-drag-region and that you could also use for your
own purposes.  You may want to check holes.el which also needs something
like that.

I guess the function could begin something like the following:

  (defun mouse-drag-loop ()
    "Track mouse movements while highlighting the region.
  Maintain the region between point and the mouse's position highlighted,
  until some non-motion event.
  Return the event that caused the loop to exit."

Most of the code can be extracted from mouse-drag-region-1.


        Stefan




reply via email to

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