From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Drew Adams" <drew.adams@oracle.com>
Cc: emacs-devel@gnu.org
Subject: Re: `fit-window-to-buffer-as-displayed'?
Date: Mon, 10 Jan 2011 18:51:09 -0500 [thread overview]
Message-ID: <jwvy66siaov.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <F6F5819E415C4203A9B55E561A0D4168@us.oracle.com> (Drew Adams's message of "Mon, 10 Jan 2011 13:46:09 -0800")
> In this it seems to be trying, at least somewhat, to fit the window
> not simply to the buffer content (plain text, fixed-char size) but to
> the buffer as actually displayed.
Yes, it tries as best it can. It's not flawless, tho, largely for lack
of better primitive functions.
> 1. Am I missing something - is there something that would help with this?
> Something that would give me the actual height and width of a buffer as
> currently displayed (e.g. in pixels)?
At the time fit-window-to-buffer-as-displayed is called, the text might
not be completely displayed yet.
> 2. If not, could that please be added to Emacs? (I'll file an enhancement
Agreed, please.
> request if it makes sense.) Either a new function,
> `fit-window-to-buffer-as-displayed' or (better, IMO) an enhancement to
> `fit-window-to-buffer' that adds an optional parameter AS-DISPLAYED.
No need for a new parameter: it's a bug-fix.
It's not trivial to fix, tho, and it's not clear which kind of primitive
the C code could/should provide in order to make it possible.
Maybe we could simply do something like a binary search, where each loop
iteration forces redisplay, then checks with posn-point if EOB is right
at the end of the window.
Stefan
next prev parent reply other threads:[~2011-01-10 23:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-10 21:46 `fit-window-to-buffer-as-displayed'? Drew Adams
2011-01-10 23:51 ` Stefan Monnier [this message]
2011-01-11 0:35 ` `fit-window-to-buffer-as-displayed'? Drew Adams
2011-01-11 5:30 ` `fit-window-to-buffer-as-displayed'? Stefan Monnier
-- strict thread matches above, loose matches on Subject: below --
2011-01-11 17:47 `fit-window-to-buffer-as-displayed'? Drew Adams
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=jwvy66siaov.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=drew.adams@oracle.com \
--cc=emacs-devel@gnu.org \
/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.