Subject: bug#22891: 25.0.92; set-fringe-mode with left fringe 0 breaks window width calculations on Mac OS (again)

From: Constantine Vetoshev <[email-masked]>
Date: Wed, 2 Mar 2016 22:38:05 -0800

The Emacs pretest released earlier today has a window width
calculation problem on Mac OS X when the window left fringe is turned
off. This bug seems similar to #18601 and #16470.

To reproduce, do the following:

1. Start Emacs 25.0.92 (with -Q to avoid loading initialization file).
2. Execute this Elisp: (set-fringe-mode '(0 . 7))
3. Execute M-x ansi-term and select /bin/zsh as your shell.
4. Resize the frame to make it slightly wider (I used the mouse to
make the frame one character wider).
5. Run 'ls' in the shell. Notice the spurious % characters printed
everywhere. This is the bug.

Setting the fringe to '(1 . 7) makes the problem go away.

I noticed that the fringe needs to be set wider in Emacs 25 compared
to 24. I used fringe '(0 . 2) in the past, but that's now too small.
It seems that the fringe window width calculation has changed, and
re-introduced this bug.

In GNU Emacs 25.0.92.1 (x86_64-apple-darwin15.3.0, NS appkit-1404.34
Version 10.11.3 (Build 15D21))
 of 2016-03-02 built on athena.local
Windowing system distributor 'Apple', version 10.3.1404
Configured using:
 'configure --with-ns'

Configured features:
NOTIFY ACL LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS

Important settings:
  value of $LC_COLLATE: C
  value of $LC_CTYPE: en_US.UTF-8
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Term

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Mark set
((left-fringe . 0) (right-fringe . 0))
Making completion list...

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message dired format-spec rfc822 mml
mml-sec epg epg-config gnus-util mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util help-fns help-mode cl-loaddefs pcase cl-lib
mail-prsvr mail-utils term disp-table easymenu ehelp ring time-date
mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel ns-win ucs-normalize term/common-win tool-bar dnd
fontset image regexp-opt fringe tabulated-list newcomment elisp-mode
lisp-mode prog-mode register page menu-bar rfn-eshadow timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame
cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai
tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian
slovak czech european ethiopic indian cyrillic chinese charscript
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer
cl-preloaded nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote kqueue cocoa ns
multi-tty make-network-process emacs)

Memory information:
((conses 16 199926 9804)
 (symbols 48 19902 0)
 (miscs 40 63 188)
 (strings 32 16034 4798)
 (string-bytes 1 462558)
 (vectors 16 33606)
 (vector-slots 8 650873 6522)
 (floats 8 162 177)
 (intervals 56 293 0)
 (buffers 976 13))