emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: avoid.el patch


From: Stefan Monnier
Subject: Re: avoid.el patch
Date: 20 Aug 2004 18:01:00 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

> 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" <address@hidden>
> To: <address@hidden>
> Date: Tue, 23 Mar 2004 13:05:32 -0500
> Organization: Sipquest
> Subject: [patch] avoid.el - keep mouse pointer within the same window
> Sender: address@hidden

> 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
> address@hidden
> http://mail.gnu.org/mailman/listinfo/emacs-pretest-bug



> _______________________________________________
> Emacs-devel mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/emacs-devel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]