-;;; bg-mouse.el --- GNU Emacs code for BBN Bitgraph mouse.
+;;; bg-mouse.el --- GNU Emacs code for BBN Bitgraph mouse
;; Copyright (C) Free Software Foundation, Inc. Oct 1985.
-;; Time stamp <89/03/21 14:27:08 gildea>
+
+;; Author: John Robinson <jr@bbn-unix.arpa>
+;; Stephen Gildea <gildea@bbn.com>
+;; Maintainer: FSF
+;; Keywords: hardware
;; 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 1, or (at your option)
+;; the Free Software Foundation; either version 2, 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., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
+
+;;; Commentary:
+;;; Code:
;;; Original version by John Robinson (jr@bbn-unix.arpa, bbncca!jr), Oct 1985
;;; Modularized and enhanced by gildea@bbn.com Nov 1987
+;;; Time stamp <89/03/21 14:27:08 gildea>
;;; User customization option:
(interactive "P")
(bg-get-tty-num semicolon)
(let*
- ((screen-mouse-x (min (1- (screen-width)) ;don't hit column 86!
+ ((screen-mouse-x (min (1- (frame-width)) ;don't hit column 86!
(/ (bg-get-tty-num semicolon) 9)))
- (screen-mouse-y (- (1- (screen-height)) ;assume default font size.
+ (screen-mouse-y (- (1- (frame-height)) ;assume default font size.
(/ (bg-get-tty-num semicolon) 16)))
(bg-mouse-buttons (% (bg-get-tty-num ?c) 8))
(bg-mouse-window (bg-window-from-x-y screen-mouse-x screen-mouse-y))
(bg-cursor-window (selected-window))
(edges (window-edges bg-mouse-window))
- (minibuf-p (= screen-mouse-y (1- (screen-height))))
+ (minibuf-p (= screen-mouse-y (1- (frame-height))))
(in-modeline-p (and (not minibuf-p)
(= screen-mouse-y (1- (nth 3 edges)))))
(in-scrollbar-p (and (not minibuf-p) (not in-modeline-p)
"Move point to location of BitGraph mouse and yank. If last command
was a yank, do a yank-pop."
(interactive "*")
- (if (eql last-command 'yank)
+ (if (eq last-command 'yank)
(yank-pop 1)
(bg-yank)))
;;; 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)