From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vitalie Spinu 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 18:09:02 +0200 Message-ID: <87vbic23j5.fsf@gmail.com> References: <874mpx3gh2.fsf@gmail.com> <83a8zpm92q.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1425744627 9729 80.91.229.3 (7 Mar 2015 16:10:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 7 Mar 2015 16:10:27 +0000 (UTC) Cc: 20022@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 07 17:10:15 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 1YUHIp-00065q-Ql for geb-bug-gnu-emacs@m.gmane.org; Sat, 07 Mar 2015 17:10:11 +0100 Original-Received: from localhost ([::1]:35299 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUHIp-00070h-82 for geb-bug-gnu-emacs@m.gmane.org; Sat, 07 Mar 2015 11:10:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41825) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUHIk-0006uI-SB for bug-gnu-emacs@gnu.org; Sat, 07 Mar 2015 11:10:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YUHIg-0003WR-Rv for bug-gnu-emacs@gnu.org; Sat, 07 Mar 2015 11:10:06 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40277) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUHIg-0003WA-PC for bug-gnu-emacs@gnu.org; Sat, 07 Mar 2015 11:10:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YUHIg-0002CL-8B for bug-gnu-emacs@gnu.org; Sat, 07 Mar 2015 11:10:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Vitalie Spinu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 Mar 2015 16:10:02 +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.14257445578388 (code B ref 20022); Sat, 07 Mar 2015 16:10:02 +0000 Original-Received: (at 20022) by debbugs.gnu.org; 7 Mar 2015 16:09:17 +0000 Original-Received: from localhost ([127.0.0.1]:38843 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YUHHw-0002BD-HD for submit@debbugs.gnu.org; Sat, 07 Mar 2015 11:09:16 -0500 Original-Received: from mail-wg0-f47.google.com ([74.125.82.47]:39184) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YUHHt-0002Az-RG for 20022@debbugs.gnu.org; Sat, 07 Mar 2015 11:09:14 -0500 Original-Received: by wghn12 with SMTP id n12so11803469wgh.6 for <20022@debbugs.gnu.org>; Sat, 07 Mar 2015 08:09:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-type:content-transfer-encoding; bh=nGJnDBdeuHG9E8V85OBIJY/dY2D0NlkmiDWe8kqlKp0=; b=O2yrv4ukHzIkNvEYSqcxq8srHj8aziahGNsGOmfTVOg2B/tdrwUFy901zBTTrVS91H fNZYjsu1DpLavGNQ6ZLyURdzIp6zBPlwgLcAlONHr9XX4s7iuqehZhGuBTJWG0RnI7pd uPDmNtC4d0mxBMAUo0itOA/yFsHIDkW8Qew2j8CmqstN83/y6Ye2W5DP9CCg3fJ8sRzI ha7DA4sFIfrBiXrawiO6hsDkjBbMmfF3EvOTgWHCuxqqCPwU7LVJJeweLUjS++IeszFR ts3Vj06j+WdKHpeGuZYCWgKNuqztP0f4NQnvvoNyGGUF0TJPj+lQzQC7dYSuXeVZMSyd u7pQ== X-Received: by 10.194.60.203 with SMTP id j11mr41520834wjr.5.1425744548263; Sat, 07 Mar 2015 08:09:08 -0800 (PST) Original-Received: from localhost (host-static-86-106-238-197.moldtelecom.md. [86.106.238.197]) by mx.google.com with ESMTPSA id s19sm39097652wik.18.2015.03.07.08.09.05 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Mar 2015 08:09:05 -0800 (PST) In-Reply-To: <83a8zpm92q.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 07 Mar 2015 11:49:01 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.90 (gnu/linux) 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:100241 Archived-At: >>> 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. 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`. > The ELisp manual explicitly says "frame's default character height". Ok, thanks. This one is in the preamble of 27.3 Window Sizes manual page. I have missed that paragraph completely. BTW, the "width of a =E2=80=9Cdefault=E2=80=9D character" is confusing as o= f the conflicting meaning with the `default-font-height`. "Canonical" is a better term IMO. > You want default-font-height, I think. (A similar functionality for > width can be used based on font-info modifications on the master > branch only, but you could approximate that by assuming the same ratio > between the canonical width and the rescaled width as between the > canonical height and rescaled height.) > For the line height, don't forget the line-spacing issue, which is > taken into account by the default-line-height function. Uff. That's rather complicated :( > I suspect that you might be trying to compute something for which > helpful functions already exist, so you are encouraged to tell more > details. I simply need the number of characters that can be fit in a single line in order to set the sub-process output width. 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? Thanks, Vitalie