GNU bug report logs - #18601
24.3.94; set-fringe-mode with left fringe 0 breaks window width calculations on Mac OS

Previous Next

Package: emacs;

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

Date: Thu, 2 Oct 2014 08:40:02 UTC

Severity: important

Found in version 24.3.94

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: 18601 <at> debbugs.gnu.org
Subject: bug#18601: 24.3.94; set-fringe-mode with left fringe 0 breaks window width calculations on Mac OS
Date: Fri, 03 Oct 2014 08:54:37 +0200
> After (set-fringe-mode '(0 . 2)), executing (window--dump-frame) puts
> the following contents into *window-frame-dump*:

> frame pixel: 600 x 494   cols/lines: 86 x 35   units: 7 x 14

> width left fringe: 0
> width right fringe: 7

> After (set-fringe-mode '(1 . 2)), executing (window--dump-frame) puts
> the following contents into *window-frame-dump*:

> body pixel: 574 x 462   char: 82 x 33
> width left fringe: 3
> width right fringe: 4

Here is the old fringe compensation code at work which apaprently adds 4
or 5 pixels to the specified value in order to get the sum of the widths
of the fringes equal to 7 (the frame's nominal character width).  I
removed that code for NS on Emacs 25 but never did so for Emacs 24-4.
Even now I don't know whether it works correctly (see also bug #16856).

In any case I don't see why this should have any impact on what happens
in ansi-term.  Apparently `term-window-width' kicks in and due to

(/= (frame-parameter nil 'right-fringe) 0))

it eventually stores in `term-width' a value that is one less than if
both fringes are present.

Since Eli now confirmed that what you observe is a result of one of his
fixes all I can suggest at the moment is to play with

(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)
    (1- (window-body-width))))

What happens when you make it always return (window-body-width)?

(defun term-window-width ()
  (window-body-width))

martin




This bug report was last modified 10 years and 231 days ago.

Previous Next


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