From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.devel Subject: Re: mouse-autoselect-window Date: Fri, 07 Sep 2007 00:58:59 +0200 Message-ID: <87zlzzz9ho.fsf@escher.local.home> References: <86abs1bd54.fsf@lola.quinscape.zz> <87myw1p8yb.fsf@escher.local.home> <46DEEF9F.5060904@gmx.at> <87r6lc0zqr.fsf@escher.local.home> <46DFF0FF.6060502@gmx.at> <87lkbj27zc.fsf@escher.local.home> <46E01859.1050709@gmx.at> <87d4wv238e.fsf@escher.local.home> <46E0395D.7010704@gmx.at> <878x7j1wr9.fsf@escher.local.home> <46E06708.8000001@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1189119590 17251 80.91.229.12 (6 Sep 2007 22:59:50 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 6 Sep 2007 22:59:50 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 07 00:59:45 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1ITQJx-0007z3-VU for ged-emacs-devel@m.gmane.org; Fri, 07 Sep 2007 00:59:34 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ITQJw-0005M5-IN for ged-emacs-devel@m.gmane.org; Thu, 06 Sep 2007 18:59:32 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ITQJt-0005Lo-LF for emacs-devel@gnu.org; Thu, 06 Sep 2007 18:59:29 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ITQJs-0005LS-AT for emacs-devel@gnu.org; Thu, 06 Sep 2007 18:59:29 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ITQJs-0005LP-6P for emacs-devel@gnu.org; Thu, 06 Sep 2007 18:59:28 -0400 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1ITQJr-0005QZ-Dv for emacs-devel@gnu.org; Thu, 06 Sep 2007 18:59:27 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1ITQJe-0002zr-7s for emacs-devel@gnu.org; Fri, 07 Sep 2007 00:59:14 +0200 Original-Received: from i577bc1b3.versanet.de ([87.123.193.179]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 07 Sep 2007 00:59:14 +0200 Original-Received: from Stephen.Berman by i577bc1b3.versanet.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 07 Sep 2007 00:59:14 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 51 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: i577bc1b3.versanet.de User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) 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:78044 Archived-At: On Thu, 06 Sep 2007 22:46:00 +0200 martin rudalics wrote: >>>Is `mouse-autoselect-window-select' called at all? >> >> >> How can I determine that? The first thing I did after applying your >> patch was to instrument mouse-autoselect-window-select for edebug, but >> when I moved the mouse between windows (and frames) after setting >> mouse-autoselect-window to t, edebug never kicked in. I also >> instrumented mouse-autoselect-window-start but still no edebug. Does >> this mean those functions are not being called? If so, how is >> mouse-autoselect-window taking effect; if not, why isn't edebug >> working? > > This would mean that `handle-select-window' gets it wrong. Can you look > there, especially why `mouse-autoselect-window-start' is not called? The reason is that I had mouse-autoselect-window set to t, and handle-select-window contains this code: (unless (and (numberp mouse-autoselect-window) (not (zerop mouse-autoselect-window)) (not (eq mouse-autoselect-window-state 'select)) (progn ;; Cancel any delayed autoselection. (mouse-autoselect-window-cancel t) ;; Start delayed autoselection from current mouse position ;; and window. (mouse-autoselect-window-start (mouse-position) window) ;; Executing a command cancels delayed autoselection. (add-hook 'pre-command-hook 'mouse-autoselect-window-cancel))) So (numberp mouse-autoselect-window) => (numberp t) => nil and mouse-autoselect-window-start is skipped over. When I set mouse-autoselect-window to a number, I can use edebug to step through mouse-autoselect-window-select. The results I have gotten so far are puzzling. Sometimes (mouse-position) evaluates to e.g. (# 42 . 9) and then the variable `window' gets let-bound to #. But sometimes (mouse-position) evaluates to e.g. (# nil) and then `window' evaluates to nil. I haven't been able to see when or why this happens, but when it does, your code gets skipped over. But even when `window' has a valid window value, I find that in edebug (selected-window) evaluated to the same window, so again your code gets skipped over. But when I don't use edebug and move the mouse over another frame, then (selected-window) is still the window in the frame I moved off of. I don't understand this discrepancy, and I don't understand how (selected window) could change. Steve Berman