all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Clément Pit-Claudel" <clement.pitclaudel@live.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 30746@debbugs.gnu.org
Subject: bug#30746: window-text-pixel-width includes width of following propertized space
Date: Fri, 16 Mar 2018 10:09:40 -0400	[thread overview]
Message-ID: <c6d074c8-7127-5bfe-d538-c643d81a989b@live.com> (raw)
In-Reply-To: <83fu5apu7w.fsf@gnu.org>


[-- Attachment #1.1: Type: text/plain, Size: 1063 bytes --]



On 2018-03-08 08:33, Eli Zaretskii wrote:
>> From: Clément Pit-Claudel <clement.pitclaudel@live.com>
>> Date: Wed, 7 Mar 2018 17:13:32 -0500
>>
>> (progn
>>   (save-excursion
>>     (insert #("s " 1 2 (display (space :width (50))))))
>>   (window-text-pixel-size nil (point) (1+ (point))))
>>
>> On my machine a single 's' is 8 pixels wide, but this snippet returns 58.  
>>
>> The following snippet, however, returns 8 as expected:
>>
>> (progn
>>   (save-excursion
>>     (insert "s "))
>>   (window-text-pixel-size nil (point) (1+ (point))))
>>
>> It seems that adding a display property on the space changes the return value of window-text-pixel-size; is that expected?
> 
> It's expected given the relatively naïve implementation, which didn't
> expect such calamities.  Hopefully now fixed on the master branch.

Thanks a lot; the width is indeed fixed.  However, the fix seems to have broken the height calculation: the first snippet above now returns (8 . 0), whereas the second one returns (8 . 16).

Cheers,
Clément.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2018-03-16 14:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-07 22:13 bug#30746: window-text-pixel-width includes width of following propertized space Clément Pit-Claudel
2018-03-08 13:33 ` Eli Zaretskii
2018-03-16 14:09   ` Clément Pit-Claudel [this message]
2018-03-16 16:13     ` Eli Zaretskii
2018-03-16 20:49       ` Clément Pit-Claudel
2019-09-28 21:51 ` Stefan Kangas

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=c6d074c8-7127-5bfe-d538-c643d81a989b@live.com \
    --to=clement.pitclaudel@live.com \
    --cc=30746@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 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.