From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#52676: 28.0.50; [PATCH] Rationalize window-text-pixel-size Date: Mon, 20 Dec 2021 19:11:45 +0200 Message-ID: <83pmpr19ri.fsf@gnu.org> References: <87wnk0xaz4.fsf@dick> <87h7b43qjb.fsf@yahoo.com> <87o85byhqg.fsf@dick> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27893"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 52676@debbugs.gnu.org To: dick Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 20 19:39:55 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mzNZj-0006y2-Lp for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 20 Dec 2021 19:39:55 +0100 Original-Received: from localhost ([::1]:57738 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mzNZh-0005J4-VM for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 20 Dec 2021 13:39:53 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:45856) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzMCn-00084j-Br for bug-gnu-emacs@gnu.org; Mon, 20 Dec 2021 12:12:09 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39779) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mzMCg-0000oq-1r for bug-gnu-emacs@gnu.org; Mon, 20 Dec 2021 12:12:07 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mzMCf-0006Tj-Tu for bug-gnu-emacs@gnu.org; Mon, 20 Dec 2021 12:12:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 20 Dec 2021 17:12:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 52676 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 52676-submit@debbugs.gnu.org id=B52676.164002031424887 (code B ref 52676); Mon, 20 Dec 2021 17:12:01 +0000 Original-Received: (at 52676) by debbugs.gnu.org; 20 Dec 2021 17:11:54 +0000 Original-Received: from localhost ([127.0.0.1]:51324 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzMCY-0006TJ-HD for submit@debbugs.gnu.org; Mon, 20 Dec 2021 12:11:54 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:45020) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzMCX-0006Sr-07 for 52676@debbugs.gnu.org; Mon, 20 Dec 2021 12:11:53 -0500 Original-Received: from [2001:470:142:3::e] (port=46498 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzMCR-0000nC-QZ; Mon, 20 Dec 2021 12:11:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=FT3VTpTMQrPPDXBWTN/2QvTiH4tawlBZbwCGF6KUB7A=; b=InKXH2iUYRQt 0YpxSL3pxVcuZPvq9lvWAlIwDEmhCge4meUgufdnxkqQXUoL5/6sRt0k/3gEV2cxP+GaXMWB/5SRf mu/j+ThCZZoKaT97b9KEBEoEEQ32h6yvlbBNoPMM1q4eZLQi4IsF6ZxFBbmiI3eCGAW2Z+saI1I3A zkBBX4hbwB6HbOwwQxd4tIW6oXUAmGUOn5InTeTC8JtmMj5GPtIESgTZQkpoHEHTb4CD9SCLf5hVT jCMRSb+PwQjqjuWcYb7IJbIZ6/KEOOkoTo+aOw6zefkCxK8Tie/V70bzS3ZV3AbJcPScFAz8QJTLX r5axJjvUXknDrO1cd5TuJA==; Original-Received: from [87.69.77.57] (port=1957 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzMCR-0006pp-Ku; Mon, 20 Dec 2021 12:11:48 -0500 In-Reply-To: <87o85byhqg.fsf@dick> (message from dick on Mon, 20 Dec 2021 00:20:55 -0500) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:222795 Archived-At: > From: dick > Date: Mon, 20 Dec 2021 00:20:55 -0500 > Cc: 52676-done@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.