# HG changeset patch # User John Paul Wallington # Date 1047302742 0 # Node ID dfd66f399ed59e10ece65dc36a59ed4f157cc81e # Parent f1a836dd325db9246688824e55cb0e97c0a1f9a3 (posn-col-row): Take into account `line-spacing'. diff -r f1a836dd325d -r dfd66f399ed5 lisp/subr.el --- a/lisp/subr.el Mon Mar 10 13:05:04 2003 +0000 +++ b/lisp/subr.el Mon Mar 10 13:25:42 2003 +0000 @@ -655,8 +655,11 @@ as returned by the `event-start' and `event-end' functions. For a scroll-bar event, the result column is 0, and the row corresponds to the vertical position of the click in the scroll bar." - (let ((pair (nth 2 position)) - (window (posn-window position))) + (let* ((pair (nth 2 position)) + (window (posn-window position)) + (vspacing (or (buffer-local-value 'line-spacing + (window-buffer window)) + 0))) (if (eq (if (consp (nth 1 position)) (car (nth 1 position)) (nth 1 position)) @@ -669,7 +672,7 @@ (cons (scroll-bar-scale pair (window-width window)) 0) (let* ((frame (if (framep window) window (window-frame window))) (x (/ (car pair) (frame-char-width frame))) - (y (/ (cdr pair) (frame-char-height frame)))) + (y (/ (cdr pair) (+ (frame-char-height frame) vspacing)))) (cons x y)))))) (defsubst posn-timestamp (position)