diff options
| author | John Paul Wallington | 2003-03-10 13:25:42 +0000 |
|---|---|---|
| committer | John Paul Wallington | 2003-03-10 13:25:42 +0000 |
| commit | 3a24cce05be3b93d612490953a216b7bbddf87ac (patch) | |
| tree | 4f79700dc4591c164f340ea25408ad84ce5a0a49 | |
| parent | b84d224e6b65cc8db632a629b2aa906cf5260af1 (diff) | |
| download | emacs-3a24cce05be3b93d612490953a216b7bbddf87ac.tar.gz emacs-3a24cce05be3b93d612490953a216b7bbddf87ac.zip | |
(posn-col-row): Take into account `line-spacing'.
| -rw-r--r-- | lisp/subr.el | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lisp/subr.el b/lisp/subr.el index 39240b601ec..29afbecb1e5 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -655,8 +655,11 @@ POSITION should be a list of the form | |||
| 655 | as returned by the `event-start' and `event-end' functions. | 655 | as returned by the `event-start' and `event-end' functions. |
| 656 | For a scroll-bar event, the result column is 0, and the row | 656 | For a scroll-bar event, the result column is 0, and the row |
| 657 | corresponds to the vertical position of the click in the scroll bar." | 657 | corresponds to the vertical position of the click in the scroll bar." |
| 658 | (let ((pair (nth 2 position)) | 658 | (let* ((pair (nth 2 position)) |
| 659 | (window (posn-window position))) | 659 | (window (posn-window position)) |
| 660 | (vspacing (or (buffer-local-value 'line-spacing | ||
| 661 | (window-buffer window)) | ||
| 662 | 0))) | ||
| 660 | (if (eq (if (consp (nth 1 position)) | 663 | (if (eq (if (consp (nth 1 position)) |
| 661 | (car (nth 1 position)) | 664 | (car (nth 1 position)) |
| 662 | (nth 1 position)) | 665 | (nth 1 position)) |
| @@ -669,7 +672,7 @@ corresponds to the vertical position of the click in the scroll bar." | |||
| 669 | (cons (scroll-bar-scale pair (window-width window)) 0) | 672 | (cons (scroll-bar-scale pair (window-width window)) 0) |
| 670 | (let* ((frame (if (framep window) window (window-frame window))) | 673 | (let* ((frame (if (framep window) window (window-frame window))) |
| 671 | (x (/ (car pair) (frame-char-width frame))) | 674 | (x (/ (car pair) (frame-char-width frame))) |
| 672 | (y (/ (cdr pair) (frame-char-height frame)))) | 675 | (y (/ (cdr pair) (+ (frame-char-height frame) vspacing)))) |
| 673 | (cons x y)))))) | 676 | (cons x y)))))) |
| 674 | 677 | ||
| 675 | (defsubst posn-timestamp (position) | 678 | (defsubst posn-timestamp (position) |