bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#54862: 28.1; window-text-pixel-size sometimes fails to report accura


From: Lars Ingebrigtsen
Subject: bug#54862: 28.1; window-text-pixel-size sometimes fails to report accurate pixel-width
Date: Tue, 12 Apr 2022 12:35:01 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]