Subject: bug#9949: 24.0.91; window-width function does not take text-scale-mode-amount into account

From: martin rudalics <[email-masked]>
Date: Fri, 04 Nov 2011 20:58:44 +0100

> window-width already returns incorrect results for the exceptions you
 > mentioned.  A variant that accounts for text scaling would be correct in
 > all the cases window-width is correct, plus the case where text scaling has
 > been applied to a fixed width font.  All that is needed is for someone to
 > expose the pixel width of a face and my scaled-window-width function above
 > will work.

You really should leave this job to the display-engine.  Doing your
calculations based on window-width means you'd have to add a function to
`window-configuration-change-hook' and/or `window-size-change-functions'
and recalculate the position of your stamps when a window changes size.
Moreover, a solution based on window-width will fail when you display
the same buffer in two windows of different width.  And another benefit
of using :align-to would be the additional experience whether it does
its job as expected.

martin