all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Vitalie Spinu <spinuvit@gmail.com>
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 11:49:01 +0200	[thread overview]
Message-ID: <83a8zpm92q.fsf@gnu.org> (raw)
In-Reply-To: <874mpx3gh2.fsf@gmail.com>

> From: Vitalie Spinu <spinuvit@gmail.com>
> Date: Sat, 07 Mar 2015 00:31:53 +0200
> 
> 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 says:
> 
>  This function returns the height, in lines, of the body of window
>  WINDOW.

It says much more than that.  In particular, it mentions "the
character height of WINDOW's frame", which should be a hint.  The
ELisp manual explicitly says "frame's default character height".

> So at least the docs are imprecise or incomplete.

Suggestions to how to make them more complete without confusing users
(who might not even know that the size of the default face's font can
be changed, or that text-scale-adjust exists at all) are welcome.

IOW, there's a problem here: we need to provide a description that
will make sense both to relative newbies and to sophisticated Lisp
programmers alike.  The current doc string is an attempt to do so.  If
you (or someone else) can suggest a better wording for that, it will
be most welcome.

> Relatedly, there seems to be no way to determine the height/width of a
> character in pixels after rescaling. `frame-char-width` returns the
> original size.

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.

(Btw, I'm not sure how you get from window-width/height to
width/height of a character; I suspect that you might be trying to
compute something for which helpful functions already exist, so you
are encouraged to tell more details.)





  parent reply	other threads:[~2015-03-07  9:49 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 [this message]
2015-03-07 16:09   ` Vitalie Spinu
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

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

  git send-email \
    --in-reply-to=83a8zpm92q.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=20022@debbugs.gnu.org \
    --cc=spinuvit@gmail.com \
    /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.