aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/term
diff options
context:
space:
mode:
authorGerd Moellmann <[email protected]>2000-07-03 09:11:33 +0000
committerGerd Moellmann <[email protected]>2000-07-03 09:11:33 +0000
commitd8aa822b225aa8802df4527426fc59d6272dc149 (patch)
tree5372743c50cbb3c7f369cd8a91484c84b820c1eb /lisp/term
parenta74b0a725ac1699b1cb0e2b11dc782ff68d9364f (diff)
(bg-window-from-x-y): Use some-window instead
of cycling through windows with next-window.
Diffstat (limited to 'lisp/term')
-rw-r--r--lisp/term/bg-mouse.el19
1 files changed, 1 insertions, 18 deletions
diff --git a/lisp/term/bg-mouse.el b/lisp/term/bg-mouse.el
index 8f980c4d9d..fee358ae25 100644
--- a/lisp/term/bg-mouse.el
+++ b/lisp/term/bg-mouse.el
@@ -250,27 +250,10 @@ X and Y are 0-based character positions in the window."
;;; Returns the window that screen position (x, y) is in or nil if none,
;;; meaning we are in the echo area with a non-active minibuffer.
-;;; If coordinates-in-window-p were not in an X-windows-specific file
-;;; we could use that. In Emacs 19 can even use locate-window-from-coordinates
(defun bg-window-from-x-y (x y)
"Find window corresponding to screen coordinates.
X and Y are 0-based character positions on the screen."
- (let ((edges (window-edges))
- (window nil))
- (while (and (not (eq window (selected-window)))
- (or (< y (nth 1 edges))
- (>= y (nth 3 edges))
- (< x (nth 0 edges))
- (>= x (nth 2 edges))))
- (setq window (next-window window))
- (setq edges (window-edges window)))
- (cond ((eq window (selected-window))
- nil) ;we've looped: not found
- ((not window)
- (selected-window)) ;just starting: current window
- (t
- window))
- ))
+ (some-window (lambda (w) (coordinates-in-window-p (cons x y) w))))
(defun bg-command-execute (bg-command)
(if (commandp bg-command)