all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Elias Mårtenson" <lokedhs@gmail.com>
To: martin rudalics <rudalics@gmx.at>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: Determining size of a propertised string
Date: Tue, 29 Nov 2016 19:05:30 +0800	[thread overview]
Message-ID: <CADtN0WJPdyvXMXn1Tu5Q1sTB47ceV-se1CAaZjdvde13tcj6=w@mail.gmail.com> (raw)
In-Reply-To: <583D5FCA.2080302@gmx.at>

[-- Attachment #1: Type: text/plain, Size: 1091 bytes --]

On 29 November 2016 at 19:00, martin rudalics <rudalics@gmx.at> 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?

[-- Attachment #2: Type: text/html, Size: 1538 bytes --]

  reply	other threads:[~2016-11-29 11:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-29 10:39 Determining size of a propertised string Elias Mårtenson
2016-11-29 11:00 ` martin rudalics
2016-11-29 11:05   ` Elias Mårtenson [this message]
2016-11-29 14:16     ` martin rudalics

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CADtN0WJPdyvXMXn1Tu5Q1sTB47ceV-se1CAaZjdvde13tcj6=w@mail.gmail.com' \
    --to=lokedhs@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.