From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#17303: On tty or -nw, (window-body-width) is one column too big. Date: Sun, 20 Apr 2014 23:05:46 +0300 Message-ID: <83d2gbepgl.fsf@gnu.org> References: <20140420170343.GA4058@acm.acm> <83ha5neqv7.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1398024445 2819 80.91.229.3 (20 Apr 2014 20:07:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 20 Apr 2014 20:07:25 +0000 (UTC) Cc: 17303@debbugs.gnu.org To: acm@muc.de Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Apr 20 22:07:17 2014 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 1Wby1E-0001hx-T9 for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Apr 2014 22:07:17 +0200 Original-Received: from localhost ([::1]:46526 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wby1E-0004Ed-9b for geb-bug-gnu-emacs@m.gmane.org; Sun, 20 Apr 2014 16:07:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45113) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wby16-0004EP-1K for bug-gnu-emacs@gnu.org; Sun, 20 Apr 2014 16:07:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wby10-0002gq-Uj for bug-gnu-emacs@gnu.org; Sun, 20 Apr 2014 16:07:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45401) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wby10-0002gf-Qo for bug-gnu-emacs@gnu.org; Sun, 20 Apr 2014 16:07:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Wby10-0007cu-6N for bug-gnu-emacs@gnu.org; Sun, 20 Apr 2014 16:07:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 20 Apr 2014 20:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17303 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 17303-submit@debbugs.gnu.org id=B17303.139802436429151 (code B ref 17303); Sun, 20 Apr 2014 20:07:02 +0000 Original-Received: (at 17303) by debbugs.gnu.org; 20 Apr 2014 20:06:04 +0000 Original-Received: from localhost ([127.0.0.1]:53558 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wby03-0007a1-6F for submit@debbugs.gnu.org; Sun, 20 Apr 2014 16:06:03 -0400 Original-Received: from mtaout24.012.net.il ([80.179.55.180]:58566) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Wbxzz-0007ZR-IW for 17303@debbugs.gnu.org; Sun, 20 Apr 2014 16:06:01 -0400 Original-Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0N4C00G00HPW3L00@mtaout24.012.net.il> for 17303@debbugs.gnu.org; Sun, 20 Apr 2014 23:04:10 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N4C00CZNIEYA650@mtaout24.012.net.il>; Sun, 20 Apr 2014 23:04:10 +0300 (IDT) In-reply-to: <83ha5neqv7.fsf@gnu.org> X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:88172 Archived-At: > Date: Sun, 20 Apr 2014 22:35:24 +0300 > From: Eli Zaretskii > Cc: 17303@debbugs.gnu.org > > > Date: Sun, 20 Apr 2014 17:03:43 +0000 > > From: Alan Mackenzie > > > > I'm doing something at the moment involving scrolling of windows, and I > > need to know at what "visual" column point is in. So, naturally, I do > > > > (% (current-column) (window-body-width)) > > > > . At the start of the first continuation line, this formula (correctly) > > returns 0 on a GUI, but (e.g.) 79 on a tty or in emacs -nw. > > You mean, it says 80 in a GUI session, not 0, right? Wait, perhaps I misunderstood your complain. Is the problem with window-body-width, rather than with current-column? (You seemed to ask about current-column, not window-body-width.) If so, then you should know that the continuation character does not have to take one column, it can be customized via the buffer display table. So the effective window width on a TTY is not always 1 column less than on GUI frames. Also, if there's a truncation glyph at the left, you'd probably want us to subtract its length as well, right? Moreover, when there are no fringes on a GUI frame, we also use "\" there to indicate a continued line, but we still return from window-body-width a value that counts the continuation character. So this is not an easy thing to change. And the question is of course: why do it? What is the use case where you bumped into this issue, and why window-body-width was important to you?