From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: transient-mark-mode in 22.0 Date: Sun, 12 Jun 2005 12:29:42 -0400 Message-ID: <87psur8sl2.fsf-monnier+emacs@gnu.org> References: <1118265475.26257.16.camel@turtle.as.arizona.edu> <1118339690.31013.16.camel@turtle.as.arizona.edu> <1118443750.4986.119.camel@turtle.as.arizona.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1118593548 12386 80.91.229.2 (12 Jun 2005 16:25:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 12 Jun 2005 16:25:48 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jun 12 18:25:43 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DhVH6-000879-4S for ged-emacs-devel@m.gmane.org; Sun, 12 Jun 2005 18:25:28 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DhVLi-0001W0-E5 for ged-emacs-devel@m.gmane.org; Sun, 12 Jun 2005 12:30:14 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DhVLU-0001Ve-Gw for emacs-devel@gnu.org; Sun, 12 Jun 2005 12:30:00 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DhVLT-0001Uw-A2 for emacs-devel@gnu.org; Sun, 12 Jun 2005 12:29:59 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DhVLT-0001Um-7i for emacs-devel@gnu.org; Sun, 12 Jun 2005 12:29:59 -0400 Original-Received: from [209.226.175.54] (helo=tomts10-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DhVM5-0006EB-EN; Sun, 12 Jun 2005 12:30:37 -0400 Original-Received: from alfajor ([70.48.82.205]) by tomts10-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20050612162943.WUWW26102.tomts10-srv.bellnexxia.net@alfajor>; Sun, 12 Jun 2005 12:29:43 -0400 Original-Received: by alfajor (Postfix, from userid 1000) id 5069ED73D3; Sun, 12 Jun 2005 12:29:42 -0400 (EDT) Original-To: JD Smith In-Reply-To: <1118443750.4986.119.camel@turtle.as.arizona.edu> (JD Smith's message of "Fri, 10 Jun 2005 15:49:10 -0700") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:38644 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:38644 > 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