From: Lennart Borgman <lennart.borgman.073@student.lu.se>
Cc: emacs-devel@gnu.org
Subject: Re: mouse-drag-mode-line should maybe use window-tree
Date: Tue, 29 Nov 2005 00:57:32 +0100 [thread overview]
Message-ID: <438B996C.5000107@student.lu.se> (raw)
In-Reply-To: <E1EgASQ-0000Ku-76@fencepost.gnu.org>
[-- Attachment #1: Type: text/plain, Size: 723 bytes --]
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.
[-- Attachment #2: mouse-drag-window-above.patch --]
[-- Type: text/plain, Size: 1921 bytes --]
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))
[-- Attachment #3: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel
prev parent reply other threads:[~2005-11-28 23:57 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-24 0:29 mouse-drag-mode-line should maybe use window-tree Lennart Borgman
2005-11-25 15:50 ` Richard M. Stallman
2005-11-25 18:37 ` Peter Whaite
2005-11-27 19:36 ` Richard M. Stallman
2005-12-01 23:56 ` Lennart Borgman
2005-12-02 18:22 ` Richard M. Stallman
2005-12-04 23:20 ` Lennart Borgman
2005-12-05 16:37 ` Richard M. Stallman
2005-12-05 16:48 ` Lennart Borgman
2005-12-06 16:41 ` Richard M. Stallman
2005-12-07 22:42 ` Lennart Borgman
2005-12-05 0:20 ` Stefan Monnier
2005-12-05 0:37 ` Lennart Borgman
2005-12-05 0:42 ` Lennart Borgman
2005-12-05 0:42 ` Stefan Monnier
2005-12-05 16:37 ` Richard M. Stallman
2005-12-05 17:04 ` Lennart Borgman
2005-12-06 16:43 ` Richard M. Stallman
2005-11-26 10:21 ` Lennart Borgman
2005-11-27 0:31 ` Richard M. Stallman
2005-11-28 23:57 ` Lennart Borgman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=438B996C.5000107@student.lu.se \
--to=lennart.borgman.073@student.lu.se \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).