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#43469: 28.0.50; window-text-pixel-size returns incorrect value when line-prefix is set Date: Fri, 18 Sep 2020 22:22:17 +0300 Message-ID: <835z8a51qu.fsf@gnu.org> References: <83r1r05mxk.fsf@gnu.org> <97950C21-6F10-4E4C-8854-BA64C023B9D6@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15469"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 43469@debbugs.gnu.org To: Yuan Fu Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 18 22:17:57 2020 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 1kJMpQ-0003tl-PA for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Sep 2020 22:17:56 +0200 Original-Received: from localhost ([::1]:39350 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJMpP-0000CJ-P9 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 18 Sep 2020 16:17:55 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57826) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJLyI-0005vx-Ka for bug-gnu-emacs@gnu.org; Fri, 18 Sep 2020 15:23:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:32891) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kJLyI-0003wu-A0 for bug-gnu-emacs@gnu.org; Fri, 18 Sep 2020 15:23:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kJLyI-0004Q1-4l for bug-gnu-emacs@gnu.org; Fri, 18 Sep 2020 15:23:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 18 Sep 2020 19:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43469 X-GNU-PR-Package: emacs Original-Received: via spool by 43469-submit@debbugs.gnu.org id=B43469.160045693116922 (code B ref 43469); Fri, 18 Sep 2020 19:23:02 +0000 Original-Received: (at 43469) by debbugs.gnu.org; 18 Sep 2020 19:22:11 +0000 Original-Received: from localhost ([127.0.0.1]:44436 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kJLxS-0004Os-U8 for submit@debbugs.gnu.org; Fri, 18 Sep 2020 15:22:11 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:50766) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kJLxQ-0004Oc-M6 for 43469@debbugs.gnu.org; Fri, 18 Sep 2020 15:22:09 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:55092) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJLxL-0003sU-Ao; Fri, 18 Sep 2020 15:22:03 -0400 Original-Received: from [176.228.60.248] (port=1953 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kJLxK-00082Q-Ed; Fri, 18 Sep 2020 15:22:03 -0400 In-Reply-To: <97950C21-6F10-4E4C-8854-BA64C023B9D6@gmail.com> (message from Yuan Fu on Fri, 18 Sep 2020 13:05:15 -0400) 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:188351 Archived-At: > From: Yuan Fu > Date: Fri, 18 Sep 2020 13:05:15 -0400 > Cc: 43469@debbugs.gnu.org > > >> (progn (insert "xxxxxxxxxxxxxx") > >> (print (car (window-text-pixel-size > >> nil (line-beginning-position) (line-end-position)))) > >> (put-text-property (line-beginning-position) (line-end-position) > >> 'line-prefix " ") > >> (print (car (window-text-pixel-size > >> nil (line-beginning-position) (line-end-position))))) > >> > >> Prints first 98, then 119 > > > > Why do you think this is a bug? > > I thought the pixel width shouldn’t include the line-prefix? It should. From the function's doc string: This function exists to allow Lisp programs to adjust the dimensions of WINDOW to the buffer text it needs to display. When you want to know how wide a window you need for displaying some text, you do want the line-prefix part accounted for.