;;; sup-mouse.el --- supdup mouse support for lisp machines
-;; Copyright (C) Free Software Foundation 1985, 1986
+;; Copyright (C) 1985-1986, 2001-2011 Free Software Foundation, Inc.
;; Author: Wolfgang Rupprecht
;; Maintainer: FSF
;; This file is part of GNU Emacs.
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; 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)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; 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, Inc., 59 Temple Place - Suite 330,
-;; Boston, MA 02111-1307, USA.
+;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;;; User customization option:
-(defvar sup-mouse-fast-select-window nil
- "*Non-nil for mouse hits to select new window, then execute; else just select.")
+(defcustom sup-mouse-fast-select-window nil
+ "Non-nil means mouse hits select new window, then execute.
+Otherwise just select."
+ :type 'boolean
+ :group 'mouse)
(defconst mouse-left 0)
(defconst mouse-center 1)
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."
- (some-window (lambda (w) (coordinates-in-window-p (cons x y) w))))
+ (get-window-with-predicate (lambda (w)
+ (coordinates-in-window-p (cons x y) w))))
;;; sup-mouse.el ends here