diff options
Diffstat (limited to 'lisp/avoid.el')
| -rw-r--r-- | lisp/avoid.el | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/lisp/avoid.el b/lisp/avoid.el index 1d97dd306db..1868707720e 100644 --- a/lisp/avoid.el +++ b/lisp/avoid.el | |||
| @@ -139,23 +139,13 @@ Only applies in mouse-avoidance-modes `animate' and `jump'." | |||
| 139 | (defun mouse-avoidance-point-position () | 139 | (defun mouse-avoidance-point-position () |
| 140 | "Return the position of point as (FRAME X . Y). | 140 | "Return the position of point as (FRAME X . Y). |
| 141 | Analogous to `mouse-position'." | 141 | Analogous to `mouse-position'." |
| 142 | (let* ((w (selected-window)) | 142 | (let ((edges (window-inside-edges)) |
| 143 | (edges (window-inside-edges w)) | 143 | (x-y (posn-x-y (posn-at-point)))) |
| 144 | (list | ||
| 145 | (compute-motion (max (window-start w) (point-min)) ; start pos | ||
| 146 | ;; window-start can be < point-min if the | ||
| 147 | ;; latter has changed since the last redisplay | ||
| 148 | '(0 . 0) ; start XY | ||
| 149 | (point) ; stop pos | ||
| 150 | nil ; stop XY: none | ||
| 151 | nil ; width | ||
| 152 | (cons (window-hscroll w) 0) ; 0 may not be right? | ||
| 153 | (selected-window)))) | ||
| 154 | ;; compute-motion returns (pos HPOS VPOS prevhpos contin) | ||
| 155 | ;; we want: (frame hpos . vpos) | ||
| 156 | (cons (selected-frame) | 144 | (cons (selected-frame) |
| 157 | (cons (+ (car edges) (car (cdr list))) | 145 | (cons (+ (car edges) |
| 158 | (+ (car (cdr edges)) (car (cdr (cdr list)))))))) | 146 | (/ (car x-y) (frame-char-width))) |
| 147 | (+ (car (cdr edges)) | ||
| 148 | (/ (cdr x-y) (frame-char-height))))))) | ||
| 159 | 149 | ||
| 160 | ;(defun mouse-avoidance-point-position-test () | 150 | ;(defun mouse-avoidance-point-position-test () |
| 161 | ; (interactive) | 151 | ; (interactive) |