From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: mouse-drag-mode-line should maybe use window-tree Date: Tue, 29 Nov 2005 00:57:32 +0100 Message-ID: <438B996C.5000107@student.lu.se> References: <43850983.8000707@student.lu.se> <4388372C.2010305@student.lu.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------030507090300020003030708" X-Trace: sea.gmane.org 1133222299 22154 80.91.229.2 (28 Nov 2005 23:58:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 28 Nov 2005 23:58:19 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 29 00:58:17 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Egssc-0006gQ-Ip for ged-emacs-devel@m.gmane.org; Tue, 29 Nov 2005 00:57:54 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Egssc-0001X9-5z for ged-emacs-devel@m.gmane.org; Mon, 28 Nov 2005 18:57:54 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EgssP-0001Wr-M8 for emacs-devel@gnu.org; Mon, 28 Nov 2005 18:57:41 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EgssO-0001Wc-Ti for emacs-devel@gnu.org; Mon, 28 Nov 2005 18:57:41 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EgssN-0001WT-Or for emacs-devel@gnu.org; Mon, 28 Nov 2005 18:57:40 -0500 Original-Received: from [81.228.8.83] (helo=pne-smtpout1-sn2.hy.skanova.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EgssN-0003j2-0P; Mon, 28 Nov 2005 18:57:39 -0500 Original-Received: from [192.168.123.121] (83.249.218.244) by pne-smtpout1-sn2.hy.skanova.net (7.2.060.1) id 438AFE400004BA96; Tue, 29 Nov 2005 00:57:37 +0100 User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en Original-To: rms@gnu.org In-Reply-To: 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:46740 Archived-At: This is a multi-part message in MIME format. --------------030507090300020003030708 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Richard M. Stallman wrote: > Sorry, forgot to write that it is the code in `mouse-drag-window-above' > that looks suspicious to me. It seems like it only compares the top of > the parameter window with the bottom of other windows. > >Yes, it is finding a window whose bottom is at the same height >as the top of this one. > >Are you saying it might find the wrong window? It could find a window >that ends at the same vertical position as the right window, but is >located to the side of it? > >I am not sure if that bug can occur. Can you add code to >verify that the window found overlaps in the horizontal dimension >with the given window? > > I have attached a patched where I believe I have done that. --------------030507090300020003030708 Content-Type: text/plain; name="mouse-drag-window-above.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="mouse-drag-window-above.patch" Index: lisp/mouse.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/mouse.el,v retrieving revision 1.287 diff -c -r1.287 mouse.el *** lisp/mouse.el 27 Nov 2005 19:28:58 -0000 1.287 --- lisp/mouse.el 28 Nov 2005 23:51:44 -0000 *************** *** 355,368 **** (defun mouse-drag-window-above (window) "Return the (or a) window directly above WINDOW. That means one whose bottom edge is at the same height as WINDOW's top edge." ! (let ((top (nth 1 (window-edges window))) (start-window window) above-window) (setq window (previous-window window 0)) (while (and (not above-window) (not (eq window start-window))) ! (if (= (+ (window-height window) (nth 1 (window-edges window))) ! top) ! (setq above-window window)) (setq window (previous-window window))) above-window)) --- 355,375 ---- (defun mouse-drag-window-above (window) "Return the (or a) window directly above WINDOW. That means one whose bottom edge is at the same height as WINDOW's top edge." ! (let ((start-top (nth 1 (window-edges window))) ! (start-left (nth 0 window)) ! (start-right (nth 2 window)) (start-window window) above-window) (setq window (previous-window window 0)) (while (and (not above-window) (not (eq window start-window))) ! (let ((left (nth 0 (window-edges window))) ! (right (nth 2 (window-edges window)))) ! (when (and (= (+ (window-height window) (nth 1 (window-edges window))) ! start-top) ! (or (and (< left start-left) (< start-right right)) ! (and (< start-left left) (< left start-right)) ! (and (< start-left right) (< right start-right)))) ! (setq above-window window))) (setq window (previous-window window))) above-window)) --------------030507090300020003030708 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --------------030507090300020003030708--