From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Marshall, Simon" Newsgroups: gmane.emacs.devel Subject: RE: [simon.marshall@misys.com: mouse-autoselect-window needs a de lay] Date: Tue, 4 Jul 2006 17:17:30 +0100 Message-ID: <81CCA6588E60BB42BE68BD029ED4826007E977DA@wimex2.wim.midas-kapiti.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: sea.gmane.org 1152029997 8156 80.91.229.2 (4 Jul 2006 16:19:57 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 4 Jul 2006 16:19:57 +0000 (UTC) Cc: "'cyd@stupidchicken.com'" , "'emacs-devel@gnu.org'" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 04 18:19:55 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Fxncc-0006AK-Or for ged-emacs-devel@m.gmane.org; Tue, 04 Jul 2006 18:19:35 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Fxncb-0006t5-QV for ged-emacs-devel@m.gmane.org; Tue, 04 Jul 2006 12:19:33 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FxncN-0006qd-5v for emacs-devel@gnu.org; Tue, 04 Jul 2006 12:19:19 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FxncK-0006nI-Jt for emacs-devel@gnu.org; Tue, 04 Jul 2006 12:19:18 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FxncK-0006n1-9N for emacs-devel@gnu.org; Tue, 04 Jul 2006 12:19:16 -0400 Original-Received: from [217.68.146.190] (helo=cluster-b.mailcontrol.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1Fxnq0-0003av-SQ; Tue, 04 Jul 2006 12:33:25 -0400 Original-Received: from rly29b.srv.mailcontrol.com (localhost.localdomain [127.0.0.1]) by rly29b.srv.mailcontrol.com (MailControl) with ESMTP id k64GJA4F014094 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 4 Jul 2006 17:19:12 +0100 Original-Received: from submission.mailcontrol.com (submission.mailcontrol.com [212.158.48.250]) by rly29b.srv.mailcontrol.com (MailControl) id k64GIIsj012826; Tue, 4 Jul 2006 17:18:18 +0100 Original-Received: from wimex2.wim.midas-kapiti.com ([217.196.233.101]) by rly29b-eth0.srv.mailcontrol.com (envelope-sender simon.marshall@misys.com) (MIMEDefang) with ESMTP id k64GIHYC012812; Tue, 04 Jul 2006 17:18:18 +0100 (BST) Original-Received: by wimex2.wim.midas-kapiti.com with Internet Mail Service (5.5.2657.72) id ; Tue, 4 Jul 2006 17:17:31 +0100 Original-To: "'martin rudalics'" , "'rms@gnu.org'" X-Mailer: Internet Mail Service (5.5.2657.72) X-Scanned-By: MailControl A-07-00-10 (www.mailcontrol.com) on 10.66.1.139 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:56502 Archived-At: > The attached patch is a first approximation. I've been able > to test this on Windows 98 only, hence I would be glad to > hear if this works in a general context too - simply > customize the variable `mouse-autoselect-window'. Hi Martin, thanks, when it works it certainly is an improvement. A few comments though, with a Solaris 8 build with LUCID toolbars. - A value of nil for mouse-autoselect-window doesn't seem to stop it selecting! I think the xterm.c check should be for !NILP(mouse_autoselect_window) now. - When I tried to see how the lisp functions mouse-autoselect-window-cancel, mouse-autoselect-window-start and mouse-autoselect-window-select were called (by adding message forms to them), I got an instant abort() when handle_one_xevent() called mouse_autoselect_window_function (bound to mouse-autoselect-window-start) and something called an Feval(): [5] abort(), line 464 in "emacs.c" [6] Feval(form = 1619100224), line 2127 in "eval.c" [7] Fprogn(args = -1598899992), line 434 in "eval.c" [8] funcall_lambda(fun = -1598900616, nargs = 2, arg_vector = 0xffbec1f8), line 3084 in "eval.c" [9] Ffuncall(nargs = 3, args = 0xffbec1f4), line 2959 in "eval.c" [10] call2(fn = 544825944, arg1 = -2138684416, arg2 = -2138684416), line 2711 in "eval.c" =>[11] handle_one_xevent(dpyinfo = 0x83ae00, eventp = 0xffbec8a0, finish = 0xffbec894, hold_quit = 0xffbed970), line 6591 in "xterm.c" In fact, setting mouse-autoselect-window to a number, doing ESC C-x on the defun of mouse-autoselect-window-cancel or mouse-autoselect-window-start, and moving the mouse is enough to trigger this abort even with one window. - I think the uncertainty over the actual delay is more than a little odd. It is more than frustrating to have to wait perhaps twice the amount of time (in fact the doc string says the amount of time is any multiple of mouse-autoselect-window). Perhaps the problem is that mouse_autoselect_window_function is run even if the window has not changed? (Currently it is run if mouse_autoselect_window is a number, regardless of whether the window has changed or not.) If it were only to run if the window has changed, perhaps mouse-autoselect-window-start can set mouse-autoselect-window-position to (mouse-position)? Unfortunately, it's a little difficult for me to play around with the lisp code - I can only avoid an abort by make/make recompile/make each time. If you can work out how to make it stable I can help test etc. Simon.