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#20022: 24.4.90; window-body-height, window-body-width wrong value after text-scale-adjust Date: Sat, 07 Mar 2015 20:12:34 +0200 Message-ID: <83pp8kllrh.fsf@gnu.org> References: <874mpx3gh2.fsf@gmail.com> <83a8zpm92q.fsf@gnu.org> <87vbic23j5.fsf@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Trace: ger.gmane.org 1425752002 29620 80.91.229.3 (7 Mar 2015 18:13:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 7 Mar 2015 18:13:22 +0000 (UTC) Cc: 20022@debbugs.gnu.org To: Vitalie Spinu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 07 19:13:11 2015 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 1YUJDq-00076t-Tg for geb-bug-gnu-emacs@m.gmane.org; Sat, 07 Mar 2015 19:13:11 +0100 Original-Received: from localhost ([::1]:35914 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUJDp-0008Vi-WA for geb-bug-gnu-emacs@m.gmane.org; Sat, 07 Mar 2015 13:13:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:32979) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUJDl-0008Sd-Ci for bug-gnu-emacs@gnu.org; Sat, 07 Mar 2015 13:13:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YUJDi-0000tl-6R for bug-gnu-emacs@gnu.org; Sat, 07 Mar 2015 13:13:05 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40310) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUJDi-0000tf-35 for bug-gnu-emacs@gnu.org; Sat, 07 Mar 2015 13:13:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YUJDh-00059j-Oh for bug-gnu-emacs@gnu.org; Sat, 07 Mar 2015 13:13:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 Mar 2015 18:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20022 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20022-submit@debbugs.gnu.org id=B20022.142575198119812 (code B ref 20022); Sat, 07 Mar 2015 18:13:01 +0000 Original-Received: (at 20022) by debbugs.gnu.org; 7 Mar 2015 18:13:01 +0000 Original-Received: from localhost ([127.0.0.1]:38878 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YUJDg-00059U-DQ for submit@debbugs.gnu.org; Sat, 07 Mar 2015 13:13:00 -0500 Original-Received: from mtaout20.012.net.il ([80.179.55.166]:42848) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YUJDd-00059E-Gc for 20022@debbugs.gnu.org; Sat, 07 Mar 2015 13:12:59 -0500 Original-Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NKU00F00SXHA800@a-mtaout20.012.net.il> for 20022@debbugs.gnu.org; Sat, 07 Mar 2015 20:12:50 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NKU00FTOT98CE00@a-mtaout20.012.net.il>; Sat, 07 Mar 2015 20:12:45 +0200 (IST) In-reply-to: <87vbic23j5.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:100243 Archived-At: > From: Vitalie Spinu > Cc: 20022@debbugs.gnu.org > Date: Sat, 07 Mar 2015 18:09:02 +0200 > > >>> Eli Zaretskii on Sat, 07 Mar 2015 11:49:01 +0200 wrote: > > >> After text-scale-adjust [C-x C-] window-height and window-width return > >> the old (original) value. > > > As designed: the value is measured in canonical character units. > > The doc string of of `window-body-width` and `window-body-height` don't > even mention the measurement unit. It says "divided by the character width". > The docs can easel be more > explicit. Something along the following lines: > > Return the height of WINDOW's text area in canonical lines. The height > of a canonical line is given by `frame-char-height`. If there's agreement that mentioning canonical lines will make this clear (personally, I'm not sure), I'm fine with that. But adding the sentence about frame-char-height IMO just muddies the water: having a term that needs to be explained by telling how to compute it sends a confusing message. > BTW, the "width of a “default” character" is confusing as of the > conflicting meaning with the `default-font-height`. "Canonical" is a > better term IMO. They are both vague, and need a lot of explanations to fully understand. Luckily, most people don't need to. > I simply need the number of characters that can be fit in a single line > in order to set the sub-process output width. This can only be meaningfully computed if the text emitted by the subprocess will be rendered in its entirety using the default face. If that's what you need, it should be easy to provide such a function, but I don't think we have it now. Martin might have some tricks up his sleeve, though. > Building on your "approximation" trick, I can get an approximate width > in pixels of the character, then divide the width of the window in > pixels by this width to get the approximate number of characters. Is > there an easier way? Not that I know of. We could provide a function for that, if this functionality is deemed important enough.