From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: avoid.el patch Date: Sat, 24 Apr 2004 10:28:15 -0400 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: Reply-To: rms@gnu.org NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1082817215 754 80.91.224.253 (24 Apr 2004 14:33:35 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 24 Apr 2004 14:33:35 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Sat Apr 24 16:33:27 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BHODf-0004lp-00 for ; Sat, 24 Apr 2004 16:33:27 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1BHODf-0005Ms-00 for ; Sat, 24 Apr 2004 16:33:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BHODU-0000qZ-0U for emacs-devel@quimby.gnus.org; Sat, 24 Apr 2004 10:33:16 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1BHOAq-0008Fd-MD for emacs-devel@gnu.org; Sat, 24 Apr 2004 10:30:32 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1BHOAH-00084H-Qi for emacs-devel@gnu.org; Sat, 24 Apr 2004 10:30:30 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1BHOAG-000841-TU for emacs-devel@gnu.org; Sat, 24 Apr 2004 10:29:56 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.24) id 1BHO8d-0006pC-UK; Sat, 24 Apr 2004 10:28:15 -0400 Original-To: emacs-devel@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:22095 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:22095 Boris Goldowsky didn't respond about this; could someone see if it looks right, and if so install it? It is small enough to be a (tiny change). From: "Zoran Milojevic" To: Date: Tue, 23 Mar 2004 13:05:32 -0500 Organization: Sipquest Subject: [patch] avoid.el - keep mouse pointer within the same window Sender: emacs-pretest-bug-bounces+rms=gnu.org@gnu.org Hi. The following patch (excuse my lisp) keeps the mouse pointer within the same window when mouse avoidance mode decides to move it away. Helps with mouse-autoselect-window turned on. Cheers, Zoran Milojevic Index: lisp/avoid.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/avoid.el,v retrieving revision 1.35 diff -u -r1.35 avoid.el --- lisp/avoid.el 1 Sep 2003 15:45:08 -0000 1.35 +++ lisp/avoid.el 23 Mar 2004 17:34:09 -0000 @@ -196,8 +196,9 @@ (defun mouse-avoidance-banish-destination () "The position to which mouse-avoidance-mode `banish' moves the mouse. You can redefine this if you want the mouse banished to a different corner." - (cons (1- (frame-width)) - 0)) + (let* ((pos (window-edges))) + (cons (- (nth 2 pos) 2) + (nth 1 pos)))) (defun mouse-avoidance-banish-mouse () ;; Put the mouse pointer in the upper-right corner of the current frame. @@ -231,16 +232,21 @@ (let* ((cur (mouse-position)) (cur-frame (car cur)) (cur-pos (cdr cur)) + (pos (window-edges)) + (mleft (pop pos)) + (mtop (pop pos)) + (mright (pop pos)) + (mbot (pop pos)) (deltax (mouse-avoidance-delta (car cur-pos) (- (random mouse-avoidance-nudge-var) (car mouse-avoidance-state)) mouse-avoidance-nudge-dist mouse-avoidance-nudge-var - 0 (frame-width))) + mleft (1- mright))) (deltay (mouse-avoidance-delta (cdr cur-pos) (- (random mouse-avoidance-nudge-var) (cdr mouse-avoidance-state)) mouse-avoidance-nudge-dist mouse-avoidance-nudge-var - 0 (frame-height)))) + mtop (1- mbot)))) (setq mouse-avoidance-state (cons (+ (car mouse-avoidance-state) deltax) (+ (cdr mouse-avoidance-state) deltay))) _______________________________________________ Emacs-pretest-bug mailing list Emacs-pretest-bug@gnu.org http://mail.gnu.org/mailman/listinfo/emacs-pretest-bug