From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?UTF-8?Q?Elias_M=C3=A5rtenson?= Newsgroups: gmane.emacs.devel Subject: Determining size of a propertised string Date: Tue, 29 Nov 2016 18:39:12 +0800 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11405858fcb17e05426e3295 X-Trace: blaine.gmane.org 1480416038 28506 195.159.176.226 (29 Nov 2016 10:40:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 29 Nov 2016 10:40:38 +0000 (UTC) To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 29 11:40:34 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cBfpt-0005y7-8e for ged-emacs-devel@m.gmane.org; Tue, 29 Nov 2016 11:40:29 +0100 Original-Received: from localhost ([::1]:35937 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBfpx-0002hO-0f for ged-emacs-devel@m.gmane.org; Tue, 29 Nov 2016 05:40:33 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43470) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBfov-0002fA-9U for emacs-devel@gnu.org; Tue, 29 Nov 2016 05:39:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cBfou-0000Mu-Hn for emacs-devel@gnu.org; Tue, 29 Nov 2016 05:39:29 -0500 Original-Received: from mail-qt0-x231.google.com ([2607:f8b0:400d:c0d::231]:33412) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cBfou-0000MM-Bf for emacs-devel@gnu.org; Tue, 29 Nov 2016 05:39:28 -0500 Original-Received: by mail-qt0-x231.google.com with SMTP id p16so150314022qta.0 for ; Tue, 29 Nov 2016 02:39:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=WpQeJmJg4M2XMfsw2p1CxllC3CbGcglwTisdNFwviIE=; b=USZzSnGYaiLesxXuX4PQs5JdEWL+hLyUmqAByuuTMswqKomB7bEJKVhZV5t/zdBD35 SDbkv6wlPJElL/XDBGXv08AkPG00FB1U92KoCV1XAVDW0aMpVARzVVVKsVkU8ZB+8YVX O7R8CL+cq7ttFI2RDsuEiBU6y8472K0OmkfwdFl/vRzffbtiEu8U/lRFOXXfw3rKjWFB NHHHv8+j58vjXe1o213lbyTWApIE6p/pH2qBjtrAZZA1JjupNnuuZsOffSI+oCChsVpc M+MJ7vUs35vjKeb/QDnweGh7K8oGZckQudTKiaHPT/M04GjBjMEt/4221ts/9IcmTjjT VaiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=WpQeJmJg4M2XMfsw2p1CxllC3CbGcglwTisdNFwviIE=; b=kWNbciBi8Witede/ZdOaOLxDPGO9lR+GFIddWz9Hzb2w6stdN1/lmZ9WRf09OMZPWr HT0BtZPZ39AS9YvNTMBoP11aSdWxV1Y6ieTHf/o2OCBnVd7yDm11Gy90lVVaD0N5Apem +hA3GhK85+9M08jsjg0oqp+++Fib24+q26p6egGh945AIrNQ1nMWow0KaFAxlgmPv/dB oeENlB+yd1cBMl/94YjfX1jQdXyuOEcI7VJ8Oo++FWAjtUBKFmvmv30O4KWHm2n1OBz/ c5uNynjd9DOvRoAlWSjG8aHUiJ3bYOLhTtHNOmlCGgj2Q4po7WZREYTBXMLMPwxan2q5 9pbw== X-Gm-Message-State: AKaTC03HdvOi/a0/NUGNXX+4iyRgdnaXVFrYsVqbY+lnST9OZ7N6sIlHuTNKaUJKpB6vArhnpRdkzS+gNnNzgQ== X-Received: by 10.200.53.69 with SMTP id z5mr22673061qtb.64.1480415952805; Tue, 29 Nov 2016 02:39:12 -0800 (PST) Original-Received: by 10.55.110.5 with HTTP; Tue, 29 Nov 2016 02:39:12 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400d:c0d::231 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:209715 Archived-At: --001a11405858fcb17e05426e3295 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable I have a string with a buch of properties applied (the main one: It uses a different font). I now need to split the window, making the size of the window just large enough to contain this text. If the string is not propertised, I can simply count the number of lines in the text I'll be inserting into the buffer and pass that as the HEIGHT parameter to =E2=80=98split-window=E2=80=99. But since the font used in this text is lar= ger than the default font, the window becomes slightly too small. As far as I can tell, there seems to be no standard way of determining what height to use in order to fit a given string. Is there a correct way to handle this? The context of this is the C-c C-k feature in gnu-apl-mode. It is used to open a window that displays the APL keymap. It's common to use a slightly larger font for APL since each character is important, and that makes this problem immediately visible. --001a11405858fcb17e05426e3295 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I have a string with a buch of properties applied (th= e main one: It uses a different font). I now need to split the window, maki= ng the size of the window just large enough to contain this text. If the st= ring is not propertised, I can simply count the number of lines in the text= I'll be inserting into the buffer and pass that as the HEIGHT paramete= r to =E2=80=98split-window=E2=80=99. But since the font used in this text i= s larger than the default font, the window becomes slightly too small.

As far as I can tell, there seems to be no standard wa= y of determining what height to use in order to fit a given string. Is ther= e a correct way to handle this?

The context of thi= s is the C-c C-k feature in gnu-apl-mode. It is used to open a window that = displays the APL keymap. It's common to use a slightly larger font for = APL since each character is important, and that makes this problem immediat= ely visible.
--001a11405858fcb17e05426e3295--