From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: avoid.el patch Date: 20 Aug 2004 18:01:00 -0400 Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1093039307 29234 80.91.224.253 (20 Aug 2004 22:01:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 20 Aug 2004 22:01:47 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 21 00:01:38 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1ByHS6-0006qh-00 for ; Sat, 21 Aug 2004 00:01:38 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1ByHWQ-0001QA-F9 for ged-emacs-devel@m.gmane.org; Fri, 20 Aug 2004 18:06:06 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1ByHWC-0001Q5-K4 for emacs-devel@gnu.org; Fri, 20 Aug 2004 18:05:52 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1ByHWB-0001Pp-QG for emacs-devel@gnu.org; Fri, 20 Aug 2004 18:05:52 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1ByHWB-0001PU-KH for emacs-devel@gnu.org; Fri, 20 Aug 2004 18:05:51 -0400 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.34) id 1ByHRn-0007ga-Nw; Fri, 20 Aug 2004 18:01:19 -0400 Original-Received: from asado.iro.umontreal.ca (asado.iro.umontreal.ca [132.204.24.84]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id 8FC5BB30282; Fri, 20 Aug 2004 18:01:01 -0400 (EDT) Original-Received: by asado.iro.umontreal.ca (Postfix, from userid 20848) id 7C1278CA23; Fri, 20 Aug 2004 18:01:01 -0400 (EDT) Original-To: rms@gnu.org In-Reply-To: Original-Lines: 89 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-DIRO-MailScanner-SpamCheck: n'est pas un polluriel, SpamAssassin (score=0, requis 5) X-MailScanner-From: monnier@iro.umontreal.ca X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:26355 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:26355 > 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). It looks right and seems to behave right as well. I've installed it (along with a few other changes to make life a bit less miserable when the mode is on). Stefan > 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 > _______________________________________________ > Emacs-devel mailing list > Emacs-devel@gnu.org > http://mail.gnu.org/mailman/listinfo/emacs-devel