GNU bug report logs - #52676
28.0.50; [PATCH] Rationalize window-text-pixel-size

Previous Next

Package: emacs;

Reported by: dick <dick.r.chiang <at> gmail.com>

Date: Mon, 20 Dec 2021 02:33:01 UTC

Severity: normal

Tags: patch

Found in version 28.0.50

Done: Po Lu <luangruo <at> yahoo.com>

Bug is archived. No further changes may be made.

Full log


Message #19 received at 52676 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: dick <dick.r.chiang <at> gmail.com>
Cc: 52676 <at> debbugs.gnu.org
Subject: Re: bug#52676: 28.0.50; [PATCH] Rationalize window-text-pixel-size
Date: Mon, 20 Dec 2021 19:11:45 +0200
> From: dick <dick.r.chiang <at> gmail.com>
> Date: Mon, 20 Dec 2021 00:20:55 -0500
> Cc: 52676-done <at> debbugs.gnu.org
> 
> (defmacro xdisp-tests--visible-buffer (&rest body)
>   (declare (debug t) (indent 0))
>   `(progn
>      (switch-to-buffer "his-fooness")
>      (unwind-protect
>          (progn ,@body)
>        (let (kill-buffer-query-functions)
>          (kill-buffer "his-fooness")))))
> 
> (xdisp-tests--visible-buffer
>   (cl-flet ((test-it
>               (what from to)
>               (erase-buffer)
>               (save-excursion
>                 (insert what))
>               (let ((dims (window-text-pixel-size nil from to nil nil nil t))
>                     (dims* (window-text-pixel-size nil from to)))
>                 (cl-assert
>                  dims
>                  (cons (car dims*)
>                        (- (cdr dims*)
>                           (save-excursion
>                             (goto-char to)
>                             (if (> (line-end-position) (line-beginning-position))
>                                 (line-pixel-height)
>                               0))))))))
>     (let ((text "foo\nbar"))
>       (test-it text 1 (1+ (length text))))
>     (let ((text "foo\nbar\n"))
>       (test-it text 1 (1+ (length text))))
>     (let ((text "foo\nbar\nbaz"))
>       (test-it text 1 (1+ (length text))))
>     (let ((text "foo\nbar\n"))
>       (test-it text 1 (1+ (length "foo\nbar"))))))

This produces no assertions here (with the current master), if that's
what you wanted to hear.




This bug report was last modified 3 years and 149 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.