1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 18:40:39 -08:00

Use lexical-binding in avoid.el

* lisp/avoid.el: Use lexical-binding.  Remove redundant :group args.
(mouse-avoidance-fancy): Quote function symbol as such.
This commit is contained in:
Stefan Kangas 2021-04-01 01:26:52 +02:00
parent c59dedcdf1
commit 168d2628b2

View file

@ -1,4 +1,4 @@
;;; avoid.el --- make mouse pointer stay out of the way of editing ;;; avoid.el --- make mouse pointer stay out of the way of editing -*- lexical-binding: t -*-
;; Copyright (C) 1993-1994, 2000-2021 Free Software Foundation, Inc. ;; Copyright (C) 1993-1994, 2000-2021 Free Software Foundation, Inc.
@ -80,7 +80,6 @@ use either \\[customize] or \\[mouse-avoidance-mode]."
:initialize 'custom-initialize-default :initialize 'custom-initialize-default
:type '(choice (const :tag "none" nil) (const banish) (const jump) :type '(choice (const :tag "none" nil) (const banish) (const jump)
(const animate) (const exile) (const proteus)) (const animate) (const exile) (const proteus))
:group 'avoid
:require 'avoid :require 'avoid
:version "20.3") :version "20.3")
@ -89,25 +88,21 @@ use either \\[customize] or \\[mouse-avoidance-mode]."
"Average distance that mouse will be moved when approached by cursor. "Average distance that mouse will be moved when approached by cursor.
Only applies in Mouse Avoidance mode `jump' and its derivatives. Only applies in Mouse Avoidance mode `jump' and its derivatives.
For best results make this larger than `mouse-avoidance-threshold'." For best results make this larger than `mouse-avoidance-threshold'."
:type 'integer :type 'integer)
:group 'avoid)
(defcustom mouse-avoidance-nudge-var 10 (defcustom mouse-avoidance-nudge-var 10
"Variability of `mouse-avoidance-nudge-dist' (which see)." "Variability of `mouse-avoidance-nudge-dist' (which see)."
:type 'integer :type 'integer)
:group 'avoid)
(defcustom mouse-avoidance-animation-delay .01 (defcustom mouse-avoidance-animation-delay .01
"Delay between animation steps, in seconds." "Delay between animation steps, in seconds."
:type 'number :type 'number)
:group 'avoid)
(defcustom mouse-avoidance-threshold 5 (defcustom mouse-avoidance-threshold 5
"Mouse-pointer's flight distance. "Mouse-pointer's flight distance.
If the cursor gets closer than this, the mouse pointer will move away. If the cursor gets closer than this, the mouse pointer will move away.
Only applies in Mouse Avoidance modes `animate' and `jump'." Only applies in Mouse Avoidance modes `animate' and `jump'."
:type 'integer :type 'integer)
:group 'avoid)
(defcustom mouse-avoidance-banish-position '((frame-or-window . frame) (defcustom mouse-avoidance-banish-position '((frame-or-window . frame)
(side . right) (side . right)
@ -380,7 +375,7 @@ redefine this function to suit your own tastes."
(mouse-avoidance-nudge-mouse) (mouse-avoidance-nudge-mouse)
(if (not (eq (selected-frame) (car old-pos))) (if (not (eq (selected-frame) (car old-pos)))
;; This should never happen. ;; This should never happen.
(apply 'set-mouse-position old-pos))))) (apply #'set-mouse-position old-pos)))))
;;;###autoload ;;;###autoload
(defun mouse-avoidance-mode (&optional mode) (defun mouse-avoidance-mode (&optional mode)