unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#54862: 28.1; window-text-pixel-size sometimes fails to report accurate pixel-width
@ 2022-04-11 18:48 Markus Triska
  2022-04-12 10:35 ` Lars Ingebrigtsen
  2022-04-12 14:21 ` Eli Zaretskii
  0 siblings, 2 replies; 4+ messages in thread
From: Markus Triska @ 2022-04-11 18:48 UTC (permalink / raw)
  To: 54862


To reproduce this regression, 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 " ")
                 (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 and 27.1, is: t.

Whereas with Emacs 28.1, evaluating the form unexpectedly yields: nil.

If possible, could you please restore the previous behaviour?

Thank you and all the best,
Markus

In GNU Emacs 28.1 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw scroll bars)
 of 2022-04-11 built on debian
Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
System Description: Debian

Configured using:
 'configure --with-gif=ifavailable --with-tiff=ifavailable
 --with-gnutls=ifavailable'

Configured features:
CAIRO FREETYPE GLIB GMP GSETTINGS JPEG LIBSELINUX LIBXML2 MODULES NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TOOLKIT_SCROLL_BARS X11
XDBE XIM XPM LUCID ZLIB






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

* bug#54862: 28.1; window-text-pixel-size sometimes fails to report accurate pixel-width
  2022-04-11 18:48 bug#54862: 28.1; window-text-pixel-size sometimes fails to report accurate pixel-width Markus Triska
@ 2022-04-12 10:35 ` Lars Ingebrigtsen
  2022-04-12 14:21 ` Eli Zaretskii
  1 sibling, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2022-04-12 10:35 UTC (permalink / raw)
  To: Markus Triska; +Cc: 54862

Markus Triska <triska@metalevel.at> writes:

> The expected result, obtained for example in Emacs 26.1 and 27.1, is: t.
>
> Whereas with Emacs 28.1, evaluating the form unexpectedly yields: nil.

Doing 

M-: (window-text-pixel-size nil (line-beginning-position) (point))

after inserting the image into the buffer does give the correct results,
which might mean that this is display related?  But putting in a sit-for
before the window-text-pixel-size still gives 0:

(let ((width 20))
  (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 " ")
    (let ((from (point)))
      (insert-image `(image :type pbm :data ,data :ascent center) "t")
      (sit-for 1)
      (car (window-text-pixel-size (selected-window) from (point))))))

Very odd.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#54862: 28.1; window-text-pixel-size sometimes fails to report accurate pixel-width
  2022-04-11 18:48 bug#54862: 28.1; window-text-pixel-size sometimes fails to report accurate pixel-width Markus Triska
  2022-04-12 10:35 ` Lars Ingebrigtsen
@ 2022-04-12 14:21 ` Eli Zaretskii
  2022-04-26 12:04   ` Eli Zaretskii
  1 sibling, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2022-04-12 14:21 UTC (permalink / raw)
  To: Markus Triska; +Cc: 54862

> From: Markus Triska <triska@metalevel.at>
> Date: Mon, 11 Apr 2022 20:48:03 +0200
> 
> 
> To reproduce this regression, 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 " ")
>                  (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 and 27.1, is: t.
> 
> Whereas with Emacs 28.1, evaluating the form unexpectedly yields: nil.

Thanks, should be fixed now on the release branch and on master.





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

* bug#54862: 28.1; window-text-pixel-size sometimes fails to report accurate pixel-width
  2022-04-12 14:21 ` Eli Zaretskii
@ 2022-04-26 12:04   ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2022-04-26 12:04 UTC (permalink / raw)
  To: triska; +Cc: 54862-done

> Date: Tue, 12 Apr 2022 17:21:32 +0300
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: 54862@debbugs.gnu.org
> 
> > From: Markus Triska <triska@metalevel.at>
> > Date: Mon, 11 Apr 2022 20:48:03 +0200
> > 
> > 
> > To reproduce this regression, 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 " ")
> >                  (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 and 27.1, is: t.
> > 
> > Whereas with Emacs 28.1, evaluating the form unexpectedly yields: nil.
> 
> Thanks, should be fixed now on the release branch and on master.

No further comments for 2 weeks, so I'm boldly marking this bug done.





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

end of thread, other threads:[~2022-04-26 12:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-04-11 18:48 bug#54862: 28.1; window-text-pixel-size sometimes fails to report accurate pixel-width Markus Triska
2022-04-12 10:35 ` Lars Ingebrigtsen
2022-04-12 14:21 ` Eli Zaretskii
2022-04-26 12:04   ` 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).