GNU bug report logs - #17303
On tty or -nw, (window-body-width) is one column too big.

Previous Next

Package: emacs;

Reported by: Alan Mackenzie <acm <at> muc.de>

Date: Sun, 20 Apr 2014 17:09:01 UTC

Severity: normal

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 17303 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: acm <at> muc.de
Cc: 17303 <at> debbugs.gnu.org
Subject: Re: bug#17303: On tty or -nw,
 (window-body-width) is one column too big.
Date: Sun, 20 Apr 2014 23:05:46 +0300
> Date: Sun, 20 Apr 2014 22:35:24 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 17303 <at> debbugs.gnu.org
> 
> > Date: Sun, 20 Apr 2014 17:03:43 +0000
> > From: Alan Mackenzie <acm <at> muc.de>
> > 
> > I'm doing something at the moment involving scrolling of windows, and I
> > need to know at what "visual" column point is in.  So, naturally, I do
> > 
> >     (% (current-column) (window-body-width))
> > 
> > .  At the start of the first continuation line, this formula (correctly)
> > returns 0 on a GUI, but (e.g.) 79 on a tty or in emacs -nw.
> 
> You mean, it says 80 in a GUI session, not 0, right?

Wait, perhaps I misunderstood your complain.

Is the problem with window-body-width, rather than with
current-column?  (You seemed to ask about current-column, not
window-body-width.)

If so, then you should know that the continuation character does not
have to take one column, it can be customized via the buffer display
table.  So the effective window width on a TTY is not always 1 column
less than on GUI frames.  Also, if there's a truncation glyph at the
left, you'd probably want us to subtract its length as well, right?

Moreover, when there are no fringes on a GUI frame, we also use "\"
there to indicate a continued line, but we still return from
window-body-width a value that counts the continuation character.

So this is not an easy thing to change.  And the question is of
course: why do it?  What is the use case where you bumped into this
issue, and why window-body-width was important to you?




This bug report was last modified 11 years and 34 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.