GNU bug report logs - #16470
24.3.50; term mode and newlines with some window configurations

Previous Next

Package: emacs;

Reported by: Constantine Vetoshev <vetoshev <at> gmail.com>

Date: Thu, 16 Jan 2014 23:16:02 UTC

Severity: normal

Found in version 24.3.50

Done: martin rudalics <rudalics <at> gmx.at>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: martin rudalics <rudalics <at> gmx.at>
To: Constantine Vetoshev <vetoshev <at> gmail.com>
Cc: Jan Djärv <jan.h.d <at> swipnet.se>, 16470 <at> debbugs.gnu.org
Subject: bug#16470: 24.3.50; term mode and newlines with some window configurations
Date: Sat, 18 Jan 2014 18:24:31 +0100
> Results attached.

From these results we see the following: The root window is 1597 pixels
wide which results in 228 columns.  (* 7 228) is 1596 pixels so the
rounding of the root window is OK with one pixel left.  Now lets look
into the sums of the live windows before and after balancing:

Pixels are (+ 400 399 798) before and (+ 533 532 532) after balancing
both yielding 1697.

Columns are (+ 57 57 114) before and (+ 76 76 76) after balancing both
yielding 228.

Now (* 7 76) is 532 so the sizes of the two right windows are precise
while the left-most window has one pixel left.  All these are total
sizes including scrollbars, fringes etc.  But we can't draw text into
scrollbars so we have to look at the body widths instead.

For the body widths subtract 15 pixel for the scrollbar and 21 for the
fringes giving (- 533 36) that is 497 pixels for the first window
yielding 71 columns.  Next we have (- 532 36) that is 496 pixels rounded
_up_ to 71 for the other two windows.  So it seems that the problem is
with rounding up the body width: `window-width' says that the window has
71 columns while it has 70 columns plus 6 pixels, that is one pixel
less.  Apparently this one missing pixel causes the problem: The
characters don't fit into the line and some wrapping occurs.

Now `term-window-width' does the following:

(defun term-window-width ()
  (if (and (not (featurep 'xemacs))
	   (display-graphic-p)
	   overflow-newline-into-fringe
	   (/= (frame-parameter nil 'right-fringe) 0))
      (window-width)
    (1- (window-width))))

returning (window-width) IIUC.  Now try to use

(defun term-window-width ()
  (if (and (not (featurep 'xemacs))
	   (display-graphic-p)
	   overflow-newline-into-fringe
	   (/= (frame-parameter nil 'right-fringe) 0))
      (/ (window-body-width nil t) (frame-char-width))
    (1- (window-width))))

instead.  If this works I shall make the change in window_body_width.

Thanks, martin




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

Previous Next


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