From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.bugs Subject: bug#10165: [PATCH] Allow setting corner in mouse avoidance mode. Date: Wed, 30 Nov 2011 07:05:29 +0100 Message-ID: <87y5uyrvpy.fsf@gmail.com> References: <877h2itald.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1322633170 20142 80.91.229.12 (30 Nov 2011 06:06:10 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 30 Nov 2011 06:06:10 +0000 (UTC) To: 10165@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 30 07:06:07 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RVdJ0-0002i1-7b for geb-bug-gnu-emacs@m.gmane.org; Wed, 30 Nov 2011 07:06:06 +0100 Original-Received: from localhost ([::1]:60694 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RVdIz-00031g-G9 for geb-bug-gnu-emacs@m.gmane.org; Wed, 30 Nov 2011 01:06:05 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:51035) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RVdIw-00031E-74 for bug-gnu-emacs@gnu.org; Wed, 30 Nov 2011 01:06:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RVdIv-0001SH-6j for bug-gnu-emacs@gnu.org; Wed, 30 Nov 2011 01:06:02 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44930) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RVdIv-0001S9-5E for bug-gnu-emacs@gnu.org; Wed, 30 Nov 2011 01:06:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1RVdIw-00055r-7b for bug-gnu-emacs@gnu.org; Wed, 30 Nov 2011 01:06:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <877h2itald.fsf@gmail.com> Resent-From: Thierry Volpiatto Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 30 Nov 2011 06:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 10165 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.132263315119558 (code B ref -1); Wed, 30 Nov 2011 06:06:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 30 Nov 2011 06:05:51 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RVdIl-00055P-9a for submit@debbugs.gnu.org; Wed, 30 Nov 2011 01:05:51 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RVdIi-00055H-Iz for submit@debbugs.gnu.org; Wed, 30 Nov 2011 01:05:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RVdIg-0001QA-31 for submit@debbugs.gnu.org; Wed, 30 Nov 2011 01:05:47 -0500 Original-Received: from lists.gnu.org ([140.186.70.17]:37243) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RVdIg-0001Q6-1X for submit@debbugs.gnu.org; Wed, 30 Nov 2011 01:05:46 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:50968) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RVdIe-00030x-R1 for bug-gnu-emacs@gnu.org; Wed, 30 Nov 2011 01:05:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RVdId-0001Po-Le for bug-gnu-emacs@gnu.org; Wed, 30 Nov 2011 01:05:44 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:46676) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RVdId-0001Pi-AJ for bug-gnu-emacs@gnu.org; Wed, 30 Nov 2011 01:05:43 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1RVdIc-0002Zz-NT for bug-gnu-emacs@gnu.org; Wed, 30 Nov 2011 07:05:42 +0100 Original-Received: from 121.78.88.79.rev.sfr.net ([79.88.78.121]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 30 Nov 2011 07:05:42 +0100 Original-Received: from thierry.volpiatto by 121.78.88.79.rev.sfr.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 30 Nov 2011 07:05:42 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 71 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 121.78.88.79.rev.sfr.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.91 (gnu/linux) Cancel-Lock: sha1:jU52bZvAlDBQPuwwJRY+jHmIXDk= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 30 Nov 2011 01:06:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:54454 Archived-At: As a reminder, I will have to put back the original behavior in defcustom, that is to move the mouse by default in the top right corner i.e (defcustom mouse-avoidance-banish-destination '(right . top) Thierry Volpiatto writes: >> Hi all, >> there was nothing except modifying function >> `mouse-avoidance-banish-destination' to set in which corner mouse is >> banish. >> This patch allow setting this through >> `mouse-avoidance-banish-destination' user variable like this: >> (left . top) or (right . bottom) etc... > > Thanks. We're in feature freeze---please file this in the bug database > so it doesn't get forgotten. > > > # HG changeset patch > # User Thierry Volpiatto > # Date 1322632617 -3600 > # Node ID 885228e9f341f392fc6886bf2855a66c5bdba6c5 > # Parent c511f9c3f7a2cab8b3684b2f1ea4782176988ac6 > * lisp/avoid.el: Allow setting in which corner banish move the mouse. > (mouse-avoidance-banish-destination): New user variable, a cons pair to specify banish corner position. > (mouse-avoidance-banish-destination): Set destination according to mouse-avoidance-banish-destination value. > > diff --git a/lisp/avoid.el b/lisp/avoid.el > --- a/lisp/avoid.el > +++ b/lisp/avoid.el > @@ -115,6 +115,11 @@ > :type 'integer > :group 'avoid) > > +(defcustom mouse-avoidance-banish-destination '(left . top) > + "Set the position to which Mouse Avoidance mode `banish' moves the mouse." > + :group 'avoid > + :type 'list) > + > ;; Internal variables > (defvar mouse-avoidance-state nil) > (defvar mouse-avoidance-pointer-shapes nil) > @@ -183,10 +188,18 @@ > > (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." > - (let* ((pos (window-edges))) > - (cons (- (nth 2 pos) 2) > - (nth 1 pos)))) > +If you want the mouse banished to a different corner set > +`mouse-avoidance-banish-destination' as you need." > + (let* ((pos (loop for v in (window-edges) > + for k in '(left top right bottom) > + collect (cons k v))) > + (side (car mouse-avoidance-banish-destination)) > + (up-down (cdr mouse-avoidance-banish-destination)) > + (fn (case side > + (left '+) > + (right '-)))) > + (cons (funcall fn (assoc-default side pos) 2) > + (assoc-default up-down pos)))) > > (defun mouse-avoidance-banish-mouse () > ;; Put the mouse pointer in the upper-right corner of the current frame. -- Thierry Get my Gnupg key: gpg --keyserver pgp.mit.edu --recv-keys 59F29997