;;; sup-mouse.el --- supdup mouse support for lisp machines
+;; Copyright (C) 1985, 1986, 2001, 2002, 2003, 2004,
+;; 2005, 2006, 2007 Free Software Foundation, Inc.
+
;; Author: Wolfgang Rupprecht
;; Maintainer: FSF
;; Created: 21 Nov 1986
-;; Last-Modified: 16 Mar 1992
+;; Keywords: hardware
;; (from code originally written by John Robinson@bbn for the bitgraph)
-;; Copyright (C) Free Software Foundation 1985, 1986
-
;; This file is part of GNU Emacs.
;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 2, or (at your option)
+;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING. If not, write to
-;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; along with GNU Emacs; see the file COPYING. If not, write to the
+;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+;; Boston, MA 02110-1301, USA.
+
+;;; Commentary:
;;; Code:
L scroll-up line to top execute-extended-command
C proportional goto-char line to middle mouse-help
R scroll-down line to bottom eval-expression"
-
+
(interactive)
(let*
;; expect a string of <esc>:<buttons>;<x-pos>;<y-pos>c
((= buttons mouse-left)
(call-interactively 'execute-extended-command))
((= buttons mouse-center)
- (describe-function 'sup-mouse-report)); silly self help
+ (describe-function 'sup-mouse-report)); silly self help
))
(t ;in another window
(select-window window)
(defun sup-pos-to-window (x y)
"Find window corresponding to frame coordinates.
X and Y are 0-based character positions on the frame."
- (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))
- )
- (or window (selected-window))
- )
- )
+ (get-window-with-predicate (lambda (w)
+ (coordinates-in-window-p (cons x y) w))))
+;;; arch-tag: ec644ed4-cac4-43b8-b3db-cfe83e9098d7
;;; sup-mouse.el ends here