--- Begin Message ---
Subject: |
23.0.92; posn-col-row wrong with line-spacing in terminals |
Date: |
Tue, 14 Apr 2009 13:11:55 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (darwin) |
posn-col-row uses the `line-spacing' value in terminals. According to the
doc `line-spacing' only has an effect in window systems.
Steps to reproduce:
- (setq-default line-spacing 3)
- emacsclient -t
- Move to a non-trivial pos.
- M-: (posn-col-row (posn-at-point))
Something like this would help:
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -934,7 +934,8 @@ and `event-end' functions."
(y (/ (cdr pair) (+ (frame-char-height frame)
(or (frame-parameter frame 'line-spacing)
;; FIXME: Why the `default'?
- (default-value 'line-spacing)
+ (when (window-system frame)
+ (default-value 'line-spacing))
0)))))
(cons x y))))))
--- End Message ---
--- Begin Message ---
Subject: |
Re: 23.0.92; posn-col-row wrong with line-spacing in terminals |
Date: |
Wed, 15 Apr 2009 18:46:02 -0400 |
> posn-col-row uses the `line-spacing' value in terminals. According to
> the doc `line-spacing' only has an effect in window systems.
Actually, there were several additional bugs in the code. The function
should have used the line-spacing variable in the buffer itself, not its
default value, and also the line-spacing variable should take precedence
over the line-spacing frame parameter. Also, it failed to account for
floating-point line-spacing values.
I've committed a fix. Thanks.
--- End Message ---