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: Re: Determining size of a propertised string Date: Tue, 29 Nov 2016 19:05:30 +0800 Message-ID: References: <583D5FCA.2080302@gmx.at> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=94eb2c084b70072d8f05426e911c X-Trace: blaine.gmane.org 1480417584 972 195.159.176.226 (29 Nov 2016 11:06:24 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 29 Nov 2016 11:06:24 +0000 (UTC) Cc: emacs-devel To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 29 12:06:16 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 1cBgEn-00078R-OR for ged-emacs-devel@m.gmane.org; Tue, 29 Nov 2016 12:06:13 +0100 Original-Received: from localhost ([::1]:36076 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBgEq-0008WV-4D for ged-emacs-devel@m.gmane.org; Tue, 29 Nov 2016 06:06:16 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52626) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cBgE9-0008TI-GX for emacs-devel@gnu.org; Tue, 29 Nov 2016 06:05:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cBgE8-0000bt-Gj for emacs-devel@gnu.org; Tue, 29 Nov 2016 06:05:33 -0500 Original-Received: from mail-qk0-x234.google.com ([2607:f8b0:400d:c09::234]:34009) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cBgE8-0000YG-8h for emacs-devel@gnu.org; Tue, 29 Nov 2016 06:05:32 -0500 Original-Received: by mail-qk0-x234.google.com with SMTP id q130so170309285qke.1 for ; Tue, 29 Nov 2016 03:05:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=lF4JFydHLgU/KwJ80zX9Em0TdLEitWXq3PfZ4HhDSng=; b=hTei+X2fYrUdREUK9i9JzAsRZw8k92ffgTYzwo0cySxJKEtUi4ZTseF1vHxaOtMDya D1TvuA2d2kkl4iaa6f63VZR5E8tqMS9pwIw7KawuwHa29tW0v9s5vhiYU3tB2LlK3Edp gHI9e6zJ5nBJW2R4xLXlqtlqDZfF66pADkRS/JcI/PneVOuLMnZe3AY124SYVHy8pd/P lTqnglBZylyBhuQPvo4BTi8f2SLVc+dFrhhYG8dBRUOT0vVlDvcZ7sAm1NOePfxprUtl IQ5RbgZRURjt2msklNDi68Bm9+Pqg+9yME/MTbNNQeMtsmUKaXjY4+iFkIr5dJoPepGt 4XtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=lF4JFydHLgU/KwJ80zX9Em0TdLEitWXq3PfZ4HhDSng=; b=LXsi4q18HxmO9EXiNVns6/BmobMKbuOGf5I+TEgpW2E3k5l+h2pHOiZRGAMjKO0ixd 0R6v7SlQstTsjxxciF1P5ph/o2N1fN7QkRfIZnUcs4D6NZcRbpzv/3GYKUr/4LzRjLTt dgoF/ybEiBkZzbkBIzUDU3xtbQJWYMIfYWvD6TaZ+uvPMvpxqKx1rW1aj0VWVou+9YJL k87k6WwAIyMFvBe1Ix/ElYmPInhJ/zFgqKdewdxrEtiekd1EoYvBCg+KmjqgwMVBYfKw XmSVuh6MelJTCSteI75iMz9f6jP1oQjCDTIBBV3vMOoWYVP1VUZZyDqJFs4GaK5S3+Kw kyfw== X-Gm-Message-State: AKaTC00OpVx6BmreGOgGG/bgacZ5bUrr/UwndJnd4QRR0NdlEnEdiFsqrmIehLgYe7IDQKGi3rSxgTSTSfgxAA== X-Received: by 10.55.143.199 with SMTP id r190mr25764936qkd.72.1480417530553; Tue, 29 Nov 2016 03:05:30 -0800 (PST) Original-Received: by 10.55.110.5 with HTTP; Tue, 29 Nov 2016 03:05:30 -0800 (PST) In-Reply-To: <583D5FCA.2080302@gmx.at> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400d:c09::234 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:209725 Archived-At: --94eb2c084b70072d8f05426e911c Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 29 November 2016 at 19:00, martin rudalics wrote: > 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= larger than the > > default font, the window becomes slightly too small. > > Why can't you use =E2=80=98fit-window-to-buffer=E2=80=99? The short answer is that I didn't know about its existence. Thank you so much for directing my attention to it. The longer answer is that while this does indeed solve the problem at hand (and I've already pushed it to gnu-apl-mode), there may be more complicated cases where an answer to the original question may be needed. So in the interest of satisfying my own curiosity, is there a way to determine the height of a given string? --94eb2c084b70072d8f05426e911c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On 2= 9 November 2016 at 19:00, martin rudalics <rudalics@gmx.at> wr= ote:

> I have a string with a buch of properties applied (the m= ain one: It uses a
> different font). I now need to split the window, making the size of th= e
> 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 i= s larger than the
> default font, the window becomes slightly too small.

Why can't you use =E2=80=98fit-window-to-buffer=E2=80=99?
<= div>
The short answer is that I didn't know about its exi= stence. Thank you so much for directing my attention to it.

<= /div>
The longer answer is that while this does indeed solve the proble= m at hand (and I've already pushed it to gnu-apl-mode), there may be mo= re complicated cases where an answer to the original question may be needed= .

So in the interest of satisfying my own curiosit= y, is there a way to determine the height of a given string?
--94eb2c084b70072d8f05426e911c--