unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#2993: 23.0.92; posn-col-row wrong with line-spacing in terminals
@ 2009-04-14 11:11 ` Nikolaj Schumacher
  2009-04-14 11:32   ` Eli Zaretskii
  2009-04-15 22:50   ` bug#2993: marked as done (23.0.92; posn-col-row wrong with line-spacing in terminals) Emacs bug Tracking System
  0 siblings, 2 replies; 5+ messages in thread
From: Nikolaj Schumacher @ 2009-04-14 11:11 UTC (permalink / raw)
  To: emacs-pretest-bug

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))))))






^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#2993: 23.0.92; posn-col-row wrong with line-spacing in terminals
  2009-04-14 11:11 ` bug#2993: 23.0.92; posn-col-row wrong with line-spacing in terminals Nikolaj Schumacher
@ 2009-04-14 11:32   ` Eli Zaretskii
  2009-04-14 12:12     ` Nikolaj Schumacher
  2009-04-15 22:50   ` bug#2993: marked as done (23.0.92; posn-col-row wrong with line-spacing in terminals) Emacs bug Tracking System
  1 sibling, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2009-04-14 11:32 UTC (permalink / raw)
  To: Nikolaj Schumacher, 2993

> From: Nikolaj Schumacher <me@nschum.de>
> Date: Tue, 14 Apr 2009 13:11:55 +0200
> Cc: 
> 
> posn-col-row uses the `line-spacing' value in terminals.  According to the
> doc `line-spacing' only has an effect in window systems.

You mean, on graphic displays.

> --- 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))))))

Please use `display-graphic-p' rather than assuming that if
`window-system' is non-nil, the display is necessarily a graphic one.
At least one Emacs configuration violates this assumption.






^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#2993: 23.0.92; posn-col-row wrong with line-spacing in terminals
  2009-04-14 11:32   ` Eli Zaretskii
@ 2009-04-14 12:12     ` Nikolaj Schumacher
  2009-04-14 13:59       ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Nikolaj Schumacher @ 2009-04-14 12:12 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 2993

Eli Zaretskii <eliz@gnu.org> wrote:

>> posn-col-row uses the `line-spacing' value in terminals.  According to the
>> doc `line-spacing' only has an effect in window systems.
>
> You mean, on graphic displays.

Yes.

If that wording is inaccurate, it should also be fixed in the doc
for `line-spacing', which says: "The space is measured in pixels, and
put below lines on window systems."

> Please use `display-graphic-p' rather than assuming that if
> `window-system' is non-nil, the display is necessarily a graphic one.
> At least one Emacs configuration violates this assumption.

I see.

--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -933,8 +933,10 @@ and `event-end' functions."
 	     (x (/ (car pair) (frame-char-width frame)))
 	     (y (/ (cdr pair) (+ (frame-char-height frame)
 				 (or (frame-parameter frame 'line-spacing)
-                                     ;; FIXME: Why the `default'?
-				     (default-value 'line-spacing)
+				     (when (display-graphic-p
+					    (frame-terminal frame))
+				       ;; FIXME: Why the `default'?
+				       (default-value 'line-spacing))
 				     0)))))
 	(cons x y))))))


regards,
Nikolaj Schumacher






^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#2993: 23.0.92; posn-col-row wrong with line-spacing in terminals
  2009-04-14 12:12     ` Nikolaj Schumacher
@ 2009-04-14 13:59       ` Eli Zaretskii
  0 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2009-04-14 13:59 UTC (permalink / raw)
  To: Nikolaj Schumacher; +Cc: 2993

> From: Nikolaj Schumacher <me@nschum.de>
> Cc: 2993@emacsbugs.donarmstrong.com
> Date: Tue, 14 Apr 2009 14:12:12 +0200
> 
> Eli Zaretskii <eliz@gnu.org> wrote:
> 
> >> posn-col-row uses the `line-spacing' value in terminals.  According to the
> >> doc `line-spacing' only has an effect in window systems.
> >
> > You mean, on graphic displays.
> 
> Yes.
> 
> If that wording is inaccurate, it should also be fixed in the doc
> for `line-spacing', which says: "The space is measured in pixels, and
> put below lines on window systems."

Fixed.  Thanks for pointing this out.

> --- a/lisp/subr.el
> +++ b/lisp/subr.el
> @@ -933,8 +933,10 @@ and `event-end' functions."
>  	     (x (/ (car pair) (frame-char-width frame)))
>  	     (y (/ (cdr pair) (+ (frame-char-height frame)
>  				 (or (frame-parameter frame 'line-spacing)
> -                                     ;; FIXME: Why the `default'?
> -				     (default-value 'line-spacing)
> +				     (when (display-graphic-p
> +					    (frame-terminal frame))
> +				       ;; FIXME: Why the `default'?
> +				       (default-value 'line-spacing))
>  				     0)))))
>  	(cons x y))))))

`display-graphic-p' accepts frames as its argument (see its doc
string ;-), so the extra call to `frame-terminal' is unnecessary.

Thanks.






^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#2993: marked as done (23.0.92; posn-col-row wrong with  line-spacing in terminals)
  2009-04-14 11:11 ` bug#2993: 23.0.92; posn-col-row wrong with line-spacing in terminals Nikolaj Schumacher
  2009-04-14 11:32   ` Eli Zaretskii
@ 2009-04-15 22:50   ` Emacs bug Tracking System
  1 sibling, 0 replies; 5+ messages in thread
From: Emacs bug Tracking System @ 2009-04-15 22:50 UTC (permalink / raw)
  To: Chong Yidong

[-- Attachment #1: Type: text/plain, Size: 902 bytes --]


Your message dated Wed, 15 Apr 2009 18:46:02 -0400
with message-id <87ab6hbknp.fsf@cyd.mit.edu>
and subject line Re: 23.0.92; posn-col-row wrong with line-spacing in terminals
has caused the Emacs bug report #2993,
regarding 23.0.92; posn-col-row wrong with line-spacing in terminals
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com
immediately.)


-- 
2993: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=2993
Emacs Bug Tracking System
Contact owner@emacsbugs.donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 2622 bytes --]

From: Nikolaj Schumacher <me@nschum.de>
To: emacs-pretest-bug@gnu.org
Subject: 23.0.92; posn-col-row wrong with line-spacing in terminals
Date: Tue, 14 Apr 2009 13:11:55 +0200
Message-ID: <m28wm31ock.fsf@nschum.de>

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))))))



[-- Attachment #3: Type: message/rfc822, Size: 1589 bytes --]

From: Chong Yidong <cyd@stupidchicken.com>
To: Nikolaj Schumacher <me@nschum.de>
Cc: Eli Zaretskii <eliz@gnu.org>, 2993-done@emacsbugs.donarmstrong.com
Subject: Re: 23.0.92; posn-col-row wrong with line-spacing in terminals
Date: Wed, 15 Apr 2009 18:46:02 -0400
Message-ID: <87ab6hbknp.fsf@cyd.mit.edu>

> 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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-04-15 22:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <87ab6hbknp.fsf@cyd.mit.edu>
2009-04-14 11:11 ` bug#2993: 23.0.92; posn-col-row wrong with line-spacing in terminals Nikolaj Schumacher
2009-04-14 11:32   ` Eli Zaretskii
2009-04-14 12:12     ` Nikolaj Schumacher
2009-04-14 13:59       ` Eli Zaretskii
2009-04-15 22:50   ` bug#2993: marked as done (23.0.92; posn-col-row wrong with line-spacing in terminals) Emacs bug Tracking System

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).