changeset 50078:1b6393475a9b

(posn-col-row): Heed frame parameter `line-spacing' and `default-line-spacing', rather than buffer-local `line-spacing'.
author John Paul Wallington <jpw@pobox.com>
date Tue, 11 Mar 2003 12:47:56 +0000
parents 21135e13f9cd
children d9f4e02aba7e
files lisp/subr.el
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/subr.el	Mon Mar 10 14:06:57 2003 +0000
+++ b/lisp/subr.el	Tue Mar 11 12:47:56 2003 +0000
@@ -657,9 +657,8 @@
 corresponds to the vertical position of the click in the scroll bar."
   (let* ((pair   (nth 2 position))
 	 (window (posn-window position))
-	 (vspacing (or (buffer-local-value 'line-spacing 
-					   (window-buffer window))
-		       0)))
+	 (vspacing (or (frame-parameter (window-frame window) 'line-spacing)
+		       default-line-spacing)))
     (if (eq (if (consp (nth 1 position))
 		(car (nth 1 position))
 	      (nth 1 position))
@@ -672,7 +671,8 @@
 	  (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) vspacing))))
+	       (y (/ (cdr pair) (+ (frame-char-height frame)
+				   (or vspacing 0)))))
 	  (cons x y))))))
 
 (defsubst posn-timestamp (position)