[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Determining size of a propertised string

From: Elias Mårtenson
Subject: Re: Determining size of a propertised string
Date: Tue, 29 Nov 2016 19:05:30 +0800

On 29 November 2016 at 19:00, martin rudalics <address@hidden> 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
> ‘split-window’. 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 ‘fit-window-to-buffer’?

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?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]