GNU bug report logs - #10165
[PATCH] Allow setting corner in mouse avoidance mode.

Previous Next

Package: emacs;

Reported by: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>

Date: Wed, 30 Nov 2011 06:00:02 UTC

Severity: wishlist

Tags: fixed, patch

Fixed in version 24.2

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #47 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#10165: [PATCH] Allow setting corner in mouse avoidance mode.
Date: Sat, 03 Dec 2011 10:26:09 +0100
Use this, as there is an error in precedent patch (still using value of
old variable), sorry.

--8<---------------cut here---------------start------------->8---
(defun mouse-avoidance-banish-destination ()
  "The position to which Mouse Avoidance mode `banish' moves the mouse.

If you want the mouse banished to a different corner set
`mouse-avoidance-banish-position' as you need."
  (let* ((fra-or-win         (assoc-default
                              'frame-or-window
                              mouse-avoidance-banish-position 'eq))
         (list-values        (case fra-or-win
                               (frame (list 0 0 (frame-width) (frame-height)))
                               (window (window-edges))))
         (alist              (loop for v in list-values
                                   for k in '(left top right bottom)
                                   collect (cons k v)))
         (side               (assoc-default
                              'side
                              mouse-avoidance-banish-position 'eq))
         (side-dist          (assoc-default
                              'side-pos
                              mouse-avoidance-banish-position 'eq))
         (top-or-bottom      (assoc-default
                              'top-or-bottom
                              mouse-avoidance-banish-position 'eq))
         (top-or-bottom-dist (assoc-default
                              'top-or-bottom-pos
                              mouse-avoidance-banish-position 'eq))
         (side-fn            (case side
                               (left '+)
                               (right '-)))
         (top-or-bottom-fn   (case top-or-bottom
                               (top '+)
                               (bottom '-))))
    (cons (funcall side-fn                        ; -/+
                   (assoc-default side alist 'eq) ; right or left
                   side-dist)                     ; distance from side
	  (funcall top-or-bottom-fn                        ; -/+
                   (assoc-default top-or-bottom alist 'eq) ; top/bottom
                   top-or-bottom-dist)))) ; distance from top/bottom
--8<---------------cut here---------------end--------------->8---



-- 
  Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 





This bug report was last modified 13 years and 43 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.