From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Anders Lindgren Newsgroups: gmane.emacs.bugs Subject: bug#22891: 25.0.92; set-fringe-mode with left fringe 0 breaks window width calculations on Mac OS (again) Date: Thu, 14 Apr 2016 20:19:36 +0200 Message-ID: References: <83y48gdxsy.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a114406eadb40de053075ef3c X-Trace: ger.gmane.org 1460658025 25008 80.91.229.3 (14 Apr 2016 18:20:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 14 Apr 2016 18:20:25 +0000 (UTC) Cc: 22891@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Apr 14 20:20:15 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aqlsF-0003gU-AS for geb-bug-gnu-emacs@m.gmane.org; Thu, 14 Apr 2016 20:20:15 +0200 Original-Received: from localhost ([::1]:44403 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqlsE-00055R-MD for geb-bug-gnu-emacs@m.gmane.org; Thu, 14 Apr 2016 14:20:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqls7-0004wn-VN for bug-gnu-emacs@gnu.org; Thu, 14 Apr 2016 14:20:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aqls2-00022j-Pl for bug-gnu-emacs@gnu.org; Thu, 14 Apr 2016 14:20:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:51507) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aqls2-00022T-N3 for bug-gnu-emacs@gnu.org; Thu, 14 Apr 2016 14:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1aqls2-0003KD-DJ for bug-gnu-emacs@gnu.org; Thu, 14 Apr 2016 14:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Anders Lindgren Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Apr 2016 18:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22891 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 22891-submit@debbugs.gnu.org id=B22891.146065798312752 (code B ref 22891); Thu, 14 Apr 2016 18:20:02 +0000 Original-Received: (at 22891) by debbugs.gnu.org; 14 Apr 2016 18:19:43 +0000 Original-Received: from localhost ([127.0.0.1]:35611 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aqlrj-0003Jc-4T for submit@debbugs.gnu.org; Thu, 14 Apr 2016 14:19:43 -0400 Original-Received: from mail-vk0-f45.google.com ([209.85.213.45]:33984) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1aqlri-0003JR-D0 for 22891@debbugs.gnu.org; Thu, 14 Apr 2016 14:19:42 -0400 Original-Received: by mail-vk0-f45.google.com with SMTP id e185so119644628vkb.1 for <22891@debbugs.gnu.org>; Thu, 14 Apr 2016 11:19:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=tZ8xEFfqjr/elC/Z/tGMdPXlm8QCti8tuGWxsITqAXw=; b=CDthVs6aak+u9cTzi2x4p54cgyHEvTYPjIuT26rXhcXbHs40njRn9+WpxM+TIk2zJ6 Mtw56EZYW/v/keMMkEyk1t1aytf6HGqEzmX46u53pUgX4PC0sFhLhbOA5Hk2PMReVCyk N+n0NTcF8axMYPnOBEl2PiIqnWHapjeEDPrNfWc4zTgYupLx9RABpcCBiCjIkZpqp9rg +5xQWnEhmNpm5Mmw+0Z2Q+zTvW3T7V3kuylzAWoYXJbjW+qlsRlOieWWd9RIX3cmCqoJ EuwjQObiFpyPfcuxvNQAHILYBUc4Q7YzsbmApgQGOSK0a+/8nrZj6WPpkPiWbMlPE0c5 saPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=tZ8xEFfqjr/elC/Z/tGMdPXlm8QCti8tuGWxsITqAXw=; b=UGG9AknJ39XorG+9MVs5oAIQjIqHPv/PIATdoRRcZFn+B+nUxITKN9WraG2BTUtcz3 EfuhxPVMZVe/R55NhJIjWKSgDNxzt1PWc9SbGg4vncitGNI4Zh7CeznG22zH8Bd5nN2I nfNAwretzQiMcSzsV4upGX+nv/RToMDlsoLvXcXYMrnh0o4Z2kNVvH/U0cVdgYpg6gB8 gJ0M65EWEeEho6OjojUjqiPpUw3MwGRWrtFC7ArIkvRIYQZkdu8T5TRXNxAz/7I4zqZR azTW/bHWs7XPlSSLxjz0e9saaGXniLjuuI954K34BPaLweD9bftyEwzjZxHouTmWe07M uh2w== X-Gm-Message-State: AOPr4FXF6MRzNLErteyR2TavFYVFAFvU8C+u9Wzmr6B5jNTJ+JVpmGxhOzv5hB94ik3+PMdBrkIrtfI7eZJtlg== X-Received: by 10.31.162.3 with SMTP id l3mr8248136vke.68.1460657976981; Thu, 14 Apr 2016 11:19:36 -0700 (PDT) Original-Received: by 10.31.214.131 with HTTP; Thu, 14 Apr 2016 11:19:36 -0700 (PDT) In-Reply-To: <83y48gdxsy.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:116469 Archived-At: --001a114406eadb40de053075ef3c Content-Type: text/plain; charset=UTF-8 Hi! > > Setting the `left-frame' frame parameter to any from 1 and up change the > width of the fringe, while retaining > > the width of the text area (80 characters). However, setting it to 0 > makes the text area wrap on 79 characters > > (despite there being space for the 80:th character) while `window-width' > still returns 80. > > This is all as expected: setting any of the fringes to zero requires > displaying a continuation glyph in the text area, and since Emacs > supports bidirectional display, we need to usurp one character cell > from the other edge of the window as well, to make the geometry of L2R > and R2L screen lines symmetrical. > Oh, this was a bit unexpected... However, I don't understand why you need it. If the right fringe is visible, it can hold the continuation character. In fact, I just tried this with the left fringe set to 0 with a bidirectional text stretching multiple lines, and the last text column didn't appear to be used at all. Furthermore, I don't think this is what people want -- some people would surely like to hide the fringes (especially the left) without losing one text column. (Most Emacs users don't use bidirectional text anyway.) When it comes to documentation, there is very little, if any, information about this. For example, this is the description of the fringe frame properties, it doesn't mention that setting either to zero would make Emacs reserve a column for the continuation glyph: `left-fringe' `right-fringe' The default width of the left and right fringes of windows in this frame (*note Fringes::). If either of these is zero, that effectively removes the corresponding fringe. In the documentation of `window-width' (a.k.a. `window-body-width') it is mentioned that the width includes the continuation glyph. However, in `window-text-width' it is not. It took some time to find the function `window-max-chars-per-line', which seems to be the only way to check if there is a column reserved for the continuation character. (term.el has replicated the logic in `term-window-width'.) Anyway, I think I found the real problem this time. ansi-term picks the window size from both `term-window-width' (which correctly returns 79) and `window-adjust-process-window-size-smallest' which doesn't take the continuation glyph into account and says that the width is 80. Again, I'l leaving it to others to fix it, as this is code I'm not at all familiar with. -- Anders --001a114406eadb40de053075ef3c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi!
=C2=A0
> Setting the `left-frame= 9; frame parameter to any from 1 and up change the width of the fringe, whi= le retaining
> the width of the text area (80 characters). However, setting it to 0 m= akes the text area wrap on 79 characters
> (despite there being space for the 80:th character) while `window-widt= h' still returns 80.

This is all as expected: setting any of the fringes to zero requires
displaying a continuation glyph in the text area, and since Emacs
supports bidirectional display, we need to usurp one character cell
from the other edge of the window as well, to make the geometry of L2R
and R2L screen lines symmetrical.

Oh, t= his was a bit unexpected...

However, I don't u= nderstand why you need it. If the right fringe is visible, it can hold the = continuation character. In fact, I just tried this with the left fringe set= to 0 with a bidirectional text stretching multiple lines, and the last tex= t column didn't appear to be used at all.

Furt= hermore, I don't think this is what people want -- some people would su= rely like to hide the fringes (especially the left) without losing one text= column. (Most Emacs users don't use bidirectional text anyway.)
<= div>
When it comes to documentation, there is very little, if= any, information about this. For example, this is the description of the f= ringe frame properties, it doesn't mention that setting either to zero = would make Emacs reserve a column for the continuation glyph:
=C2=A0 =C2=A0 `left-fringe'
=C2=A0 =C2=A0 `ri= ght-fringe'
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0The default wid= th of the left and right fringes of windows in this
=C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0frame (*note Fringes::).=C2=A0 If either of these is z= ero, that
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0effectively removes t= he corresponding fringe.

In the documentation of `= window-width' (a.k.a. `window-body-width') it is mentioned that the= width includes the continuation glyph. However, in `window-text-width'= it is not.

It took some time to find the function= `window-max-chars-per-line', which seems to be the only way to check i= f there is a column reserved for the continuation character. (term.el has r= eplicated the logic in `term-window-width'.)

<= br>
Anyway, I think I found the real problem this time. ansi-term= picks the window size from both `term-window-width' (which correctly r= eturns 79) and `window-adjust-process-window-size-smallest' which doesn= 't take the continuation glyph into account and says that the width is = 80.

Again, I'l leaving it to others to fix it,= as this is code I'm not at all familiar with.

=C2=A0 =C2=A0 -- Anders

--001a114406eadb40de053075ef3c--