From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#19194: 24.4.50; `window-body-width' is not dynamic relative to font size changes Date: Fri, 28 Nov 2014 08:27:30 +0100 Message-ID: <547823E2.2070104@gmx.at> References: <87h9xm6plp.fsf@gmail.com> <5476F298.5000205@gmx.at> <87ppc8rk08.fsf@gmail.com> <54776EED.9090303@gmx.at> <87a93cqtob.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1417159712 16082 80.91.229.3 (28 Nov 2014 07:28:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Nov 2014 07:28:32 +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 Fri Nov 28 08:28:23 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 1XuFyY-0007sg-82 for geb-bug-gnu-emacs@m.gmane.org; Fri, 28 Nov 2014 08:28:22 +0100 Original-Received: from localhost ([::1]:42826 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuFyX-0006fm-RK for geb-bug-gnu-emacs@m.gmane.org; Fri, 28 Nov 2014 02:28:21 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40385) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuFyM-0006eT-87 for bug-gnu-emacs@gnu.org; Fri, 28 Nov 2014 02:28:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XuFyE-00024L-Mq for bug-gnu-emacs@gnu.org; Fri, 28 Nov 2014 02:28:10 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:50862) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XuFyE-00024H-Ip for bug-gnu-emacs@gnu.org; Fri, 28 Nov 2014 02:28:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XuFyE-0006Pg-4h for bug-gnu-emacs@gnu.org; Fri, 28 Nov 2014 02:28:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 28 Nov 2014 07:28:02 +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.141715966324615 (code B ref 19194); Fri, 28 Nov 2014 07:28:02 +0000 Original-Received: (at 19194) by debbugs.gnu.org; 28 Nov 2014 07:27:43 +0000 Original-Received: from localhost ([127.0.0.1]:48072 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XuFxv-0006Ox-7w for submit@debbugs.gnu.org; Fri, 28 Nov 2014 02:27:43 -0500 Original-Received: from mout.gmx.net ([212.227.17.20]:64182) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XuFxs-0006Ok-MB for 19194@debbugs.gnu.org; Fri, 28 Nov 2014 02:27:42 -0500 Original-Received: from [88.117.48.182] ([88.117.48.182]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0MDV5t-1XgE8F0hIr-00Gt9D; Fri, 28 Nov 2014 08:27:38 +0100 In-Reply-To: <87a93cqtob.fsf@gmail.com> X-Provags-ID: V03:K0:qXboVjz93IRS5q5BDJ4B7AAjDTYTxQOVByhgCSFrV/iDabqmeHa s5223/4O5boeCM75+GV1lRaYAeQk1yiBEQpzqCE/4j5ze4MlrN5rWlkLACLZnCRjZbEcvk6 1IgRXbWkmLpJuj6kKO21NSDLEDhvYp0DFSoueVla+ernv+pjd4Ah28JIEP1/u/xoMmJmwJL 5au093nnNUksmSjIf/Fpw== X-UI-Out-Filterresults: notjunk:1; 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:96692 Archived-At: >> What is the width of a buffer? What are em-lenght units? > > I mean, the distance (in useful units!) from the left side of the > buffer, =2E.. a buffer has no "left side" unless you mean the value of how many columns the buffer has been scrolled horizontally in some window ... > as displayed within a given window, to the right side of that > window. If the buffer is displayed using *a fixed width font*, then o= ne > useful unit is *columns*, i.e. the number of columns that can be > displayed before line wrap or continuation kicks in. However, if the > buffer is displayed using a variable-width font, then "columns" is *no= t* > necessarily a meaningful unit -- as has been pointed out in the earlie= r > discussion. In this case, see below for "ems." > > To be clear, the width of the *window* calculated in non-buffer-specif= ic > units is not generally "useful" for the purpose of measuring the numbe= r > of characters that can be fit, horizontally, into the buffer. ".., into the window" I presume. Is it that what you want to do: Fit characters into a window? > Nevertheless, if the window is displayed using *the default face* at t= he > default scale (and if the default font happens to be fixed width!) the= n > `window-body-width' does indeed return the number of columns. The number of columns available for displaying the buffer in the window. > =C2=ABAn em is a unit in the field of typography, equal to the curr= ently > specified point size. For example, one em in a 16-point typeface is= 16 > points. Therefore, this unit is the same for all typefaces at a giv= en > point size. [...] The name "em" was originally a reference to the > width of the the capital "M" in the typeface and size being used, > which was often the same as the point size.=C2=BB So you mean the width of a default face "M" in points here? No idea how to get that. IIRC `nlinum-mode' tries to approximate that somehow. >> (3) `text-scale-mode-amount' constitutes a request to the display eng= ine >> to scale a face height. What shall we do when our target machi= ne >> can't display the character with the requested height and uses,= for >> example, the nearest available height instead? > > Presumably the function should fall back to the height (and > corresponding scale factor) that is actually used. This is an edge ca= se > that I hadn't considered! Apparently it's possible to get the face actually used, but I don't understand how. martin