[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#51995: 29.0.50; `string-pixel-width' depends on the current window w
From: |
martin rudalics |
Subject: |
bug#51995: 29.0.50; `string-pixel-width' depends on the current window width |
Date: |
Sun, 21 Nov 2021 10:12:40 +0100 |
> I saw the warnings, but I'm unsure of their validity.
> Here are some benchmarks that I did. Each form was run on a fresh emacs -Q.
> Apologies in advance if there is something wrong about them:
[...]
> (benchmark-run 100000
> (with-temp-buffer
> (insert "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
eiusmod tempor incididunt ut labore et dolore")
> (car (window-text-pixel-size
> (current-buffer) (point-min) (point) 1000000))))
> ;; (8.006855 167 2.318854)
>
> It's a lot more efficient to use a buffer, but the difference
> between the limits themselves continue to be insignificant.
These examples are harmless. Please try to test (1) with a large buffer
that has no newline characters and (2) with 'truncate-lines' non-nil.
'window-text-pixel-size' must be able to handle these cases gracefully
even if it's not geared to them.
Any clients of 'window-text-pixel-size' like 'string-pixel-width' can
easily set X-LIMIT to some sufficiently large value without affecting
the basic functionality of 'window-text-pixel-size'.
>> I hopefully fixed most of the issues here but cannot send you a patch at
>> the moment to test because my local copy is completely out of synch with
>> master. So please bear with me.
Please try the attached patch (if it doesn't apply, I'll send you the
affected functions separately so you can apply the changes manually).
Thanks, martin
buffer-text-pixel-size.diff
Description: Text Data
- bug#51995: 29.0.50; `string-pixel-width' depends on the current window width, Brahimi Saifullah, 2021/11/20
- bug#51995: 29.0.50; `string-pixel-width' depends on the current window width, Eli Zaretskii, 2021/11/20
- bug#51995: 29.0.50; `string-pixel-width' depends on the current window width, martin rudalics, 2021/11/20
- bug#51995: 29.0.50; `string-pixel-width' depends on the current window width, Brahimi Saifullah, 2021/11/20
- bug#51995: 29.0.50; `string-pixel-width' depends on the current window width, Brahimi Saifullah, 2021/11/20
- bug#51995: 29.0.50; `string-pixel-width' depends on the current window width, Brahimi Saifullah, 2021/11/21
- bug#51995: 29.0.50; `string-pixel-width' depends on the current window width, Brahimi Saifullah, 2021/11/21