unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#65899: 30.0.50; window-text-pixel-size sometimes fails to report accurate pixel-width
@ 2023-09-12 22:09 Markus Triska
  2023-09-14  9:53 ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Markus Triska @ 2023-09-12 22:09 UTC (permalink / raw)
  To: 65899


The following slight variation of the previously filed issue #54862 also
yields a wrong result of window-text-pixel-size.

To reproduce the issue, please invoke Emacs with:

    $ emacs -Q

and then evaluate the following form:

    (let ((width 20))
          (= width (let* ((height (line-pixel-height))
                          (data (with-temp-buffer
                                  (insert (format "P1\n%s %s\n" width height))
                                  (dotimes (_ height)
                                    (insert (make-string width ?1) "\n"))
                                  (buffer-string))))
                     (insert "\n")
                     (insert-image `(image :type pbm
                                           :data ,"P1\n1 10\n1111111111"
                                           :ascent center) "t")
                     (let ((from (point)))
                       (insert-image `(image :type pbm :data ,data :ascent center) "t")
                       (car (window-text-pixel-size nil from (point)))))))

The expected result, obtained for example in Emacs 26.1, is: t.

With Emacs 30.0.50, I instead unexpectedly get: nil.

If possible, could you please restore the previous behaviour?

Thank you and all the best,
Markus


In GNU Emacs 30.0.50 (build 1, x86_64-apple-darwin18.2.0, X toolkit,
 cairo version 1.17.6, Xaw scroll bars) of 2023-09-11 built on
 mac
Windowing system distributor 'The X.Org Foundation', version 11.0.11804000
System Description:  Mac OS X 10.14.2

Configured using:
 'configure --prefix=/opt/local --disable-silent-rules --without-ns
 --without-dbus --without-gconf --without-libotf --without-m17n-flt
 --with-libgmp --with-gnutls --with-json --with-xml2 --with-modules
 --with-sqlite3 --with-webp --infodir /opt/local/share/info/emacs
 --with-x-toolkit=lucid --without-xaw3d --without-imagemagick --with-xpm
 --with-jpeg --with-tiff --with-gif --with-png --with-lcms2
 --without-rsvg --with-xft --with-native-compilation=aot
 --with-tree-sitter 'CFLAGS=-pipe -Os -Wno-attributes
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk -arch
 x86_64' 'CPPFLAGS=-I/opt/local/include
 -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk'
 'LDFLAGS=-L/opt/local/lib -Wl,-headerpad_max_install_names -lfreetype
 -lfontconfig -Wl,-rpath /opt/local/lib/gcc12 -Wl,-no_pie
 -Wl,-syslibroot,/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk
 -arch x86_64''

Configured features:
ACL CAIRO FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LCMS2 LIBXML2 MODULES NATIVE_COMP NOTIFY KQUEUE PDUMPER PNG SQLITE3
THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2
XPM LUCID ZLIB






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#65899: 30.0.50; window-text-pixel-size sometimes fails to report accurate pixel-width
  2023-09-12 22:09 bug#65899: 30.0.50; window-text-pixel-size sometimes fails to report accurate pixel-width Markus Triska
@ 2023-09-14  9:53 ` Eli Zaretskii
  2023-09-14 18:27   ` Markus Triska
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2023-09-14  9:53 UTC (permalink / raw)
  To: Markus Triska; +Cc: 65899

> From: Markus Triska <triska@metalevel.at>
> Date: Wed, 13 Sep 2023 00:09:35 +0200
> 
> 
> The following slight variation of the previously filed issue #54862 also
> yields a wrong result of window-text-pixel-size.
> 
> To reproduce the issue, please invoke Emacs with:
> 
>     $ emacs -Q
> 
> and then evaluate the following form:
> 
>     (let ((width 20))
>           (= width (let* ((height (line-pixel-height))
>                           (data (with-temp-buffer
>                                   (insert (format "P1\n%s %s\n" width height))
>                                   (dotimes (_ height)
>                                     (insert (make-string width ?1) "\n"))
>                                   (buffer-string))))
>                      (insert "\n")
>                      (insert-image `(image :type pbm
>                                            :data ,"P1\n1 10\n1111111111"
>                                            :ascent center) "t")
>                      (let ((from (point)))
>                        (insert-image `(image :type pbm :data ,data :ascent center) "t")
>                        (car (window-text-pixel-size nil from (point)))))))
> 
> The expected result, obtained for example in Emacs 26.1, is: t.
> 
> With Emacs 30.0.50, I instead unexpectedly get: nil.

Thanks, should be fixed now on the emacs-29 release branch.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#65899: 30.0.50; window-text-pixel-size sometimes fails to report accurate pixel-width
  2023-09-14  9:53 ` Eli Zaretskii
@ 2023-09-14 18:27   ` Markus Triska
  2023-09-15  6:13     ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Markus Triska @ 2023-09-14 18:27 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 65899

Eli Zaretskii <eliz@gnu.org> writes:

> Thanks, should be fixed now on the emacs-29 release branch.

Yes, it works nicely now, thank you a lot!

All the best,
Markus





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#65899: 30.0.50; window-text-pixel-size sometimes fails to report accurate pixel-width
  2023-09-14 18:27   ` Markus Triska
@ 2023-09-15  6:13     ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2023-09-15  6:13 UTC (permalink / raw)
  To: Markus Triska; +Cc: 65899-done

> From: Markus Triska <triska@metalevel.at>
> Cc: 65899@debbugs.gnu.org
> Date: Thu, 14 Sep 2023 20:27:15 +0200
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Thanks, should be fixed now on the emacs-29 release branch.
> 
> Yes, it works nicely now, thank you a lot!

Thanks for testing, I'm therefore closing this bug.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-09-15  6:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-12 22:09 bug#65899: 30.0.50; window-text-pixel-size sometimes fails to report accurate pixel-width Markus Triska
2023-09-14  9:53 ` Eli Zaretskii
2023-09-14 18:27   ` Markus Triska
2023-09-15  6:13     ` Eli Zaretskii

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).