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 change Date: Wed, 24 Mar 2004 21:01:13 -0500 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 1080180649 22776 80.91.224.253 (25 Mar 2004 02:10:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 25 Mar 2004 02:10:49 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Mar 25 03:10:45 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 1B6KKT-0003rB-00 for ; Thu, 25 Mar 2004 03:10:45 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1B6KKT-0007VB-00 for ; Thu, 25 Mar 2004 03:10:45 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B6KIF-0003Ap-LD for emacs-devel@quimby.gnus.org; Wed, 24 Mar 2004 21:08:27 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.30) id 1B6KHk-00039Q-Dn for emacs-devel@gnu.org; Wed, 24 Mar 2004 21:07:56 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.30) id 1B6KFt-0002ST-1F for emacs-devel@gnu.org; Wed, 24 Mar 2004 21:06:22 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.30) id 1B6KFs-0002S9-IA for emacs-devel@gnu.org; Wed, 24 Mar 2004 21:06:00 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.24) id 1B6KBF-0001xz-AP; Wed, 24 Mar 2004 21:01:13 -0500 Original-To: Boris Goldowsky 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:20863 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:20863 Does this change look right to you? 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