unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Joe Corneli <holtzermann17@gmail.com>
Cc: 19194@debbugs.gnu.org
Subject: bug#19194: 24.4.50; `window-body-width' is not dynamic relative to font size changes
Date: Fri, 28 Nov 2014 08:27:30 +0100	[thread overview]
Message-ID: <547823E2.2070104@gmx.at> (raw)
In-Reply-To: <87a93cqtob.fsf@gmail.com>

 >> What is the width of a buffer?  What are em-lenght units?
 >
 > I mean, the distance (in useful units!) from the left side of the
 > buffer,

... a buffer has no "left side" unless you mean the value of how many
columns the buffer has been scrolled horizontally in some window ...

 > as displayed within a given window, to the right side of that
 > window.  If the buffer is displayed using *a fixed width font*, then one
 > useful unit is *columns*, i.e. the number of columns that can be
 > displayed before line wrap or continuation kicks in.  However, if the
 > buffer is displayed using a variable-width font, then "columns" is *not*
 > necessarily a meaningful unit -- as has been pointed out in the earlier
 > discussion.  In this case, see below for "ems."
 >
 > To be clear, the width of the *window* calculated in non-buffer-specific
 > units is not generally "useful" for the purpose of measuring the number
 > of characters that can be fit, horizontally, into the buffer.

".., into the window" I presume.  Is it that what you want to do: Fit
characters into a window?

 > Nevertheless, if the window is displayed using *the default face* at the
 > default scale (and if the default font happens to be fixed width!) then
 > `window-body-width' does indeed return the number of columns.

The number of columns available for displaying the buffer in the window.

 >    «An em is a unit in the field of typography, equal to the currently
 >    specified point size. For example, one em in a 16-point typeface is 16
 >    points. Therefore, this unit is the same for all typefaces at a given
 >    point size. [...] The name "em" was originally a reference to the
 >    width of the the capital "M" in the typeface and size being used,
 >    which was often the same as the point size.»

So you mean the width of a default face "M" in points here?  No idea how
to get that.  IIRC `nlinum-mode' tries to approximate that somehow.

 >> (3) `text-scale-mode-amount' constitutes a request to the display engine
 >>       to scale a face height.  What shall we do when our target machine
 >>       can't display the character with the requested height and uses, for
 >>       example, the nearest available height instead?
 >
 > Presumably the function should fall back to the height (and
 > corresponding scale factor) that is actually used.  This is an edge case
 > that I hadn't considered!

Apparently it's possible to get the face actually used, but I don't
understand how.

martin






  reply	other threads:[~2014-11-28  7:27 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-26 13:47 bug#19194: 24.4.50; `window-body-width' is not dynamic relative to font size changes Joe Corneli
2014-11-26 15:55 ` Stefan Monnier
2014-11-26 16:34   ` Joe Corneli
2014-11-26 17:06     ` Eli Zaretskii
2014-11-26 16:04 ` Eli Zaretskii
2014-11-27  9:44 ` martin rudalics
2014-11-27 10:54   ` Joe Corneli
2014-11-27 18:35     ` martin rudalics
2014-11-27 18:52       ` Eli Zaretskii
2014-11-27 19:58         ` martin rudalics
2014-11-27 20:43           ` Eli Zaretskii
2014-11-28  7:29             ` martin rudalics
2014-11-28  8:49               ` Eli Zaretskii
2014-11-28 18:38                 ` martin rudalics
2014-11-28 19:20                   ` Eli Zaretskii
2014-12-19 19:40                   ` Eli Zaretskii
2014-12-20 10:10                     ` martin rudalics
2014-12-20 11:52                       ` Joe Corneli
2014-12-20 14:49                         ` martin rudalics
2014-12-20 16:18                           ` Eli Zaretskii
2014-12-20 16:31                             ` martin rudalics
2014-12-20 16:47                               ` Eli Zaretskii
2014-12-20 17:51                                 ` martin rudalics
2014-12-20 18:29                                   ` Eli Zaretskii
2014-11-27 20:23       ` Joe Corneli
2014-11-28  7:27         ` martin rudalics [this message]
2014-11-27 16:17   ` Eli Zaretskii
2014-11-27 18:35     ` martin rudalics
2014-11-27 18:46       ` Eli Zaretskii
2014-11-27 19:58         ` martin rudalics
2014-11-27 20:37           ` Eli Zaretskii
2014-11-28  7:27             ` martin rudalics
2014-11-28  8:42               ` Eli Zaretskii
2022-02-10  8:16 ` bug#19194: bug#20022: 24.4.90; window-body-height, window-body-width wrong value after text-scale-adjust Lars Ingebrigtsen
2022-02-10 17:39   ` bug#19194: [External] : " 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

  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=547823E2.2070104@gmx.at \
    --to=rudalics@gmx.at \
    --cc=19194@debbugs.gnu.org \
    --cc=holtzermann17@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 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).