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#19194: 24.4.50; `window-body-width' is not dynamic relative to font size changes Date: Wed, 26 Nov 2014 18:04:38 +0200 Message-ID: <83tx1mne21.fsf@gnu.org> References: <87h9xm6plp.fsf@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1417017933 6404 80.91.229.3 (26 Nov 2014 16:05:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 26 Nov 2014 16:05:33 +0000 (UTC) Cc: 19194@debbugs.gnu.org To: Joe Corneli Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 26 17:05:26 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 1Xtf5m-0006Sv-Bv for geb-bug-gnu-emacs@m.gmane.org; Wed, 26 Nov 2014 17:05:22 +0100 Original-Received: from localhost ([::1]:34534 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xtf5l-00063X-Un for geb-bug-gnu-emacs@m.gmane.org; Wed, 26 Nov 2014 11:05:21 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43724) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xtf5d-00061a-8d for bug-gnu-emacs@gnu.org; Wed, 26 Nov 2014 11:05:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xtf5T-0003bF-Ge for bug-gnu-emacs@gnu.org; Wed, 26 Nov 2014 11:05:13 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49164) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xtf5T-0003b3-E0 for bug-gnu-emacs@gnu.org; Wed, 26 Nov 2014 11:05:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Xtf5T-0001as-8F for bug-gnu-emacs@gnu.org; Wed, 26 Nov 2014 11:05:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Nov 2014 16:05:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19194 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19194-submit@debbugs.gnu.org id=B19194.14170178676047 (code B ref 19194); Wed, 26 Nov 2014 16:05:03 +0000 Original-Received: (at 19194) by debbugs.gnu.org; 26 Nov 2014 16:04:27 +0000 Original-Received: from localhost ([127.0.0.1]:46373 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xtf4t-0001ZR-0H for submit@debbugs.gnu.org; Wed, 26 Nov 2014 11:04:27 -0500 Original-Received: from mtaout29.012.net.il ([80.179.55.185]:53323) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Xtf4q-0001ZI-FT for 19194@debbugs.gnu.org; Wed, 26 Nov 2014 11:04:25 -0500 Original-Received: from conversion-daemon.mtaout29.012.net.il by mtaout29.012.net.il (HyperSendmail v2007.08) id <0NFN00C00LPBKH00@mtaout29.012.net.il> for 19194@debbugs.gnu.org; Wed, 26 Nov 2014 18:02:21 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout29.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NFN002SQLVXMB90@mtaout29.012.net.il>; Wed, 26 Nov 2014 18:02:21 +0200 (IST) In-reply-to: <87h9xm6plp.fsf@gmail.com> 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:96623 Archived-At: > From: Joe Corneli > Date: Wed, 26 Nov 2014 13:47:14 +0000 > > Adjusting the font size, I would expect that the window's "body width" > would change -- more characters can be fit into the same amount of > screen space. Current behaviour does not match this expectation. > > M-: (window-body-width) RET [Note result.] > C-x C-- > M-: (window-body-width) RET [Result is the same.] > > The function is described: > > "This function returns the width, in columns, of the body of window > window." That's not what it says in Emacs 24.4. It says this: If PIXELWISE is nil, return the largest integer smaller than WINDOW's pixel width divided by the character width of WINDOW's frame. IOW, the function is explicitly documented to measure columns in canonical character units. It functions as designed. > If for some reason the "nominal" number of columns needs to calculated > with reference to the default font, then there should be another > function to return the "actual" number of columns. > > ( I note one practical implication of the underlying issue here: > https://github.com/kiwanami/emacs-calfw/issues/45 ) I've read that, and since I don't know what Calfw is or what it does, it is hard for me to interpret your use case. If you explain it in small words, I'm sure a solution will be found, as Emacs has more than enough functions to give you the width in any units you want, provided that they are uniform (i.e., don't expect that to work when teh window uses variable size fonts). One simple technique is to measure everything in pixels, but I don't know at this point whether this will solve your use case.