# HG changeset patch # User Eli Zaretskii # Date 995972680 0 # Node ID f150471f4c55a9c734932a53b7a5e53dc4dbe470 # Parent f97bc8986baeacb1a7c8bc42d770bbbc680e96bc (mouse-avoidance-too-close-p): If the frame lacks a tool-bar-lines parameter, behave as if its value were zero. (mouse-avoidance-set-pointer-shape): Don't do anything if x-pointer-shape is not boundp. diff -r f97bc8986bae -r f150471f4c55 lisp/avoid.el --- a/lisp/avoid.el Tue Jul 24 10:44:48 2001 +0000 +++ b/lisp/avoid.el Tue Jul 24 11:04:40 2001 +0000 @@ -131,8 +131,9 @@ (defsubst mouse-avoidance-set-pointer-shape (shape) "Set the shape of the mouse pointer to SHAPE." - (setq x-pointer-shape shape) - (set-mouse-color nil)) + (when (boundp 'x-pointer-shape) + (setq x-pointer-shape shape) + (set-mouse-color nil))) (defun mouse-avoidance-point-position () "Return the position of point as (FRAME X . Y). @@ -179,6 +180,8 @@ (let* ((frame (car mouse)) (mouse-y (cdr (cdr mouse))) (tool-bar-lines (frame-parameter nil 'tool-bar-lines))) + (or tool-bar-lines + (setq tool-bar-lines 0)) (if (and mouse-y (< mouse-y tool-bar-lines)) nil (let ((point (mouse-avoidance-point-position)) @@ -386,7 +389,8 @@ (run-with-idle-timer 0.1 t 'mouse-avoidance-fancy-hook)) (setq mouse-avoidance-mode mode mouse-avoidance-state (cons 0 0) - mouse-avoidance-old-pointer-shape x-pointer-shape)) + mouse-avoidance-old-pointer-shape + (and (boundp 'x-pointer-shape) x-pointer-shape))) ((eq mode 'exile) (setq mouse-avoidance-timer (run-with-idle-timer 0.1 t 'mouse-avoidance-exile-hook))