all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Constantine Vetoshev <vetoshev@gmail.com>
Cc: 16470@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	[thread overview]
Message-ID: <52DAB8CF.5040505@gmx.at> (raw)
In-Reply-To: <61D14675-A7B6-47A7-8028-FD8D09F33E30@gmail.com>

 > 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





  reply	other threads:[~2014-01-18 17:24 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-16 23:15 bug#16470: 24.3.50; term mode and newlines with some window configurations Constantine Vetoshev
2014-01-17  4:29 ` Constantine Vetoshev
2014-01-17  7:51 ` martin rudalics
2014-01-17 16:52   ` Constantine Vetoshev
2014-01-17 19:06     ` martin rudalics
2014-01-17 19:26       ` Constantine Vetoshev
2014-01-18 12:07         ` martin rudalics
2014-01-18 16:03           ` Constantine Vetoshev
2014-01-18 17:24             ` martin rudalics [this message]
2014-01-18 18:43               ` Constantine Vetoshev
2014-01-19  9:31               ` martin rudalics
2014-01-19 16:11                 ` Constantine Vetoshev
2014-01-19 17:30                   ` martin rudalics
2014-01-22 10:35                     ` martin rudalics
2014-01-22 16:00                       ` Constantine Vetoshev
2014-01-23  8:53                         ` martin rudalics
2014-01-18 11:36     ` Jan Djärv

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52DAB8CF.5040505@gmx.at \
    --to=rudalics@gmx.at \
    --cc=16470@debbugs.gnu.org \
    --cc=vetoshev@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.