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 11:49:01 +0200 Message-ID: <83a8zpm92q.fsf@gnu.org> References: <874mpx3gh2.fsf@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1425721821 26589 80.91.229.3 (7 Mar 2015 09:50:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 7 Mar 2015 09:50:21 +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 10:50:10 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 1YUBN4-0003VR-I3 for geb-bug-gnu-emacs@m.gmane.org; Sat, 07 Mar 2015 10:50:10 +0100 Original-Received: from localhost ([::1]:33911 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUBN3-0003km-Rg for geb-bug-gnu-emacs@m.gmane.org; Sat, 07 Mar 2015 04:50:09 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40495) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUBN0-0003h2-0l for bug-gnu-emacs@gnu.org; Sat, 07 Mar 2015 04:50:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YUBMw-00070L-Ms for bug-gnu-emacs@gnu.org; Sat, 07 Mar 2015 04:50:05 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:39554) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YUBMw-0006zl-Js for bug-gnu-emacs@gnu.org; Sat, 07 Mar 2015 04:50:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YUBMw-0006cz-50 for bug-gnu-emacs@gnu.org; Sat, 07 Mar 2015 04:50:02 -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 09:50: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.142572174525404 (code B ref 20022); Sat, 07 Mar 2015 09:50:02 +0000 Original-Received: (at 20022) by debbugs.gnu.org; 7 Mar 2015 09:49:05 +0000 Original-Received: from localhost ([127.0.0.1]:38122 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YUBM1-0006bf-9s for submit@debbugs.gnu.org; Sat, 07 Mar 2015 04:49:05 -0500 Original-Received: from mtaout23.012.net.il ([80.179.55.175]:38812) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YUBLz-0006bA-BI for 20022@debbugs.gnu.org; Sat, 07 Mar 2015 04:49:04 -0500 Original-Received: from conversion-daemon.a-mtaout23.012.net.il by a-mtaout23.012.net.il (HyperSendmail v2007.08) id <0NKU000005LF1C00@a-mtaout23.012.net.il> for 20022@debbugs.gnu.org; Sat, 07 Mar 2015 11:48:56 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout23.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NKU00NRZ5XK1FB0@a-mtaout23.012.net.il>; Sat, 07 Mar 2015 11:48:56 +0200 (IST) In-reply-to: <874mpx3gh2.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:100229 Archived-At: > From: Vitalie Spinu > Date: Sat, 07 Mar 2015 00:31:53 +0200 > > 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 says: > > This function returns the height, in lines, of the body of window > WINDOW. It says much more than that. In particular, it mentions "the character height of WINDOW's frame", which should be a hint. The ELisp manual explicitly says "frame's default character height". > So at least the docs are imprecise or incomplete. Suggestions to how to make them more complete without confusing users (who might not even know that the size of the default face's font can be changed, or that text-scale-adjust exists at all) are welcome. IOW, there's a problem here: we need to provide a description that will make sense both to relative newbies and to sophisticated Lisp programmers alike. The current doc string is an attempt to do so. If you (or someone else) can suggest a better wording for that, it will be most welcome. > Relatedly, there seems to be no way to determine the height/width of a > character in pixels after rescaling. `frame-char-width` returns the > original size. 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. (Btw, I'm not sure how you get from window-width/height to width/height of a character; I suspect that you might be trying to compute something for which helpful functions already exist, so you are encouraged to tell more details.)