changeset 50074:dfd66f399ed5

(posn-col-row): Take into account `line-spacing'.
author John Paul Wallington <jpw@pobox.com>
date Mon, 10 Mar 2003 13:25:42 +0000
parents f1a836dd325d
children cfb7d0684cf8
files lisp/subr.el
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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)