From: Vitalie Spinu <spinuvit@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 20022@debbugs.gnu.org
Subject: bug#20022: 24.4.90; window-body-height, window-body-width wrong value after text-scale-adjust
Date: Sat, 07 Mar 2015 18:09:02 +0200 [thread overview]
Message-ID: <87vbic23j5.fsf@gmail.com> (raw)
In-Reply-To: <83a8zpm92q.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 07 Mar 2015 11:49:01 +0200")
>>> Eli Zaretskii on Sat, 07 Mar 2015 11:49:01 +0200 wrote:
>> After text-scale-adjust [C-x C-] window-height and window-width return
>> the old (original) value.
> As designed: the value is measured in canonical character units.
The doc string of of `window-body-width` and `window-body-height` don't
even mention the measurement unit. The docs can easel be more
explicit. Something along the following lines:
Return the height of WINDOW's text area in canonical lines. The height
of a canonical line is given by `frame-char-height`.
> The ELisp manual explicitly says "frame's default character height".
Ok, thanks. This one is in the preamble of 27.3 Window Sizes manual page. I
have missed that paragraph completely.
BTW, the "width of a “default” character" is confusing as of the
conflicting meaning with the `default-font-height`. "Canonical" is a
better term IMO.
> You want default-font-height, I think. (A similar functionality for
> width can be used based on font-info modifications on the master
> branch only, but you could approximate that by assuming the same ratio
> between the canonical width and the rescaled width as between the
> canonical height and rescaled height.)
> For the line height, don't forget the line-spacing issue, which is
> taken into account by the default-line-height function.
Uff. That's rather complicated :(
> I suspect that you might be trying to compute something for which
> helpful functions already exist, so you are encouraged to tell more
> details.
I simply need the number of characters that can be fit in a single line
in order to set the sub-process output width.
Building on your "approximation" trick, I can get an approximate width
in pixels of the character, then divide the width of the window in
pixels by this width to get the approximate number of characters. Is
there an easier way?
Thanks,
Vitalie
next prev parent reply other threads:[~2015-03-07 16:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-06 22:31 bug#20022: 24.4.90; window-body-height, window-body-width wrong value after text-scale-adjust Vitalie Spinu
2015-03-07 9:41 ` martin rudalics
2015-03-07 9:49 ` Eli Zaretskii
2015-03-07 16:09 ` Vitalie Spinu [this message]
2015-03-07 17:58 ` martin rudalics
2015-03-07 20:49 ` Vitalie Spinu
2015-03-07 18:12 ` Eli Zaretskii
2015-03-07 20:46 ` Vitalie Spinu
2015-03-08 3:47 ` Eli Zaretskii
2015-03-08 10:03 ` 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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87vbic23j5.fsf@gmail.com \
--to=spinuvit@gmail.com \
--cc=20022@debbugs.gnu.org \
--cc=eliz@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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).