From: Lennart Borgman <lennart.borgman.073@student.lu.se>
Subject: A better patch for mouse-drag-window-above
Date: Tue, 29 Nov 2005 23:40:54 +0100 [thread overview]
Message-ID: <438CD8F6.7070802@student.lu.se> (raw)
[-- Attachment #1: Type: text/plain, Size: 418 bytes --]
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.
[-- Attachment #2: mouse-drag-window-above2.patch --]
[-- Type: text/plain, Size: 1530 bytes --]
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))
[-- Attachment #3: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel
reply other threads:[~2005-11-29 22:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=438CD8F6.7070802@student.lu.se \
--to=lennart.borgman.073@student.lu.se \
/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).