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: A better patch for mouse-drag-window-above Date: Tue, 29 Nov 2005 23:40:54 +0100 Message-ID: <438CD8F6.7070802@student.lu.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------020502090104030306080000" X-Trace: sea.gmane.org 1133304260 9372 80.91.229.2 (29 Nov 2005 22:44:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 29 Nov 2005 22:44:20 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 29 23:44:18 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EhECM-0006tS-4X for ged-emacs-devel@m.gmane.org; Tue, 29 Nov 2005 23:43:42 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EhECL-0004hE-Nb for ged-emacs-devel@m.gmane.org; Tue, 29 Nov 2005 17:43:41 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1EhEBV-0004SJ-FS for emacs-devel@gnu.org; Tue, 29 Nov 2005 17:42:49 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1EhEBT-0004RY-Dq for emacs-devel@gnu.org; Tue, 29 Nov 2005 17:42:48 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EhEBT-0004RR-3r for emacs-devel@gnu.org; Tue, 29 Nov 2005 17:42:47 -0500 Original-Received: from [81.228.11.98] (helo=pne-smtpout1-sn1.fre.skanova.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1EhEBF-00084J-T4; Tue, 29 Nov 2005 17:42:34 -0500 Original-Received: from [192.168.123.121] (83.249.218.244) by pne-smtpout1-sn1.fre.skanova.net (7.2.060.1) id 438C7B5E0001EB8F; Tue, 29 Nov 2005 23:40:55 +0100 User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en Original-To: Emacs Devel , "Richard M. Stallman" 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:46782 Archived-At: This is a multi-part message in MIME format. --------------020502090104030306080000 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sorry, but the patch in http://lists.gnu.org/archive/html/emacs-devel/2005-11/msg01522.html was broken with many "typos". I thought I was testing it but obviously I was not. What do I need to do to test it? I was just recompiling the function inside emacs with M-C-x. I have attached a patch that I hope is better, but I have not tested this either. I am sending it now so that the old patch does not get used. --------------020502090104030306080000 Content-Type: text/plain; name="mouse-drag-window-above2.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="mouse-drag-window-above2.patch" Index: lisp/mouse.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/mouse.el,v retrieving revision 1.287 diff -u -r1.287 mouse.el --- lisp/mouse.el 27 Nov 2005 19:28:58 -0000 1.287 +++ lisp/mouse.el 29 Nov 2005 22:27:26 -0000 @@ -355,14 +355,22 @@ (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))) + (let ((start-top (nth 1 (window-edges window))) + (start-left (nth 0 (window-edges window))) + (start-right (nth 2 (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)) + (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)))) + (message "here") + (setq above-window window))) (setq window (previous-window window))) above-window)) --------------020502090104030306080000 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 --------------020502090104030306080000--