From unknown Fri Jun 20 18:20:22 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#43469 <43469@debbugs.gnu.org> To: bug#43469 <43469@debbugs.gnu.org> Subject: Status: 28.0.50; window-text-pixel-size returns incorrect value when line-prefix is set Reply-To: bug#43469 <43469@debbugs.gnu.org> Date: Sat, 21 Jun 2025 01:20:22 +0000 retitle 43469 28.0.50; window-text-pixel-size returns incorrect value when = line-prefix is set reassign 43469 emacs submitter 43469 Yuan Fu severity 43469 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 17 12:03:43 2020 Received: (at submit) by debbugs.gnu.org; 17 Sep 2020 16:03:43 +0000 Received: from localhost ([127.0.0.1]:38756 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kIwNr-00036A-F9 for submit@debbugs.gnu.org; Thu, 17 Sep 2020 12:03:43 -0400 Received: from lists.gnu.org ([209.51.188.17]:58942) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kIwNo-00035y-M4 for submit@debbugs.gnu.org; Thu, 17 Sep 2020 12:03:40 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44700) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kIwNo-0008UF-B8 for bug-gnu-emacs@gnu.org; Thu, 17 Sep 2020 12:03:40 -0400 Received: from mail-qv1-xf36.google.com ([2607:f8b0:4864:20::f36]:45765) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kIwNm-0004Sd-9Y for bug-gnu-emacs@gnu.org; Thu, 17 Sep 2020 12:03:39 -0400 Received: by mail-qv1-xf36.google.com with SMTP id cv8so1220263qvb.12 for ; Thu, 17 Sep 2020 09:03:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=dU/J8JIULny60EKHLSBSRttogWGR9WadvJcZj81HCDQ=; b=s5Jsz+2+/ihE2OocC6u0hcxWgMkpq3Qml6wRTWLxbc3xdDEw4OY0MiHbr9dUrUkyMJ Tu4ssWESYEOV4iZHCuH2U1LMYfu89Sn6x8u16+HpagtTuB2Ggo5eaRSY0aX7UrJTzkYr NlddT2alTGpKwaMcyoIQRqps7aj8bigg9mB8cpPFaIzxUwd736j6tEKFFgIEXuvx4EOq LXfSItfPQJxBnBpu7kEkF4O3JWwAWOkRpfjnRGZ4kL6B9gbDKAqVIpfH6C+vmVtJhLPd Dm/PTCOTKZouLz/K4XCBnoaIJ51EPf2xMuKb61CrfEU1NhgxL7W363CHpKITGC2XD9qd dLTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:to; bh=dU/J8JIULny60EKHLSBSRttogWGR9WadvJcZj81HCDQ=; b=g3yc1zIDBJCinKS21kza06sC4odaqkcQc5IS1HtuxojtvWiTGb+T2yRKFHWSppBXLP uXP/TslUQplXuVWSLl9ZqvgXqG2EZOyds25KPdU52zCwrNBaaFHtJCf/Eh2TCytN+fIp opdHrclDX79/8kmQ6WN2KlNb121C9/4xJWuAyuWp1X/c+aaXYcXQMZqP4vxxTAKKskIG 3yZe7FBrtWlrUAPFJC17Q9LeuKJYUaZDLSNkwYGz2tTiN+486gxHCWwaXIvo+DXMdJOs qddnZoDXUK9dSmv8xLEDj+pAi5XaYRxqv9W48X3b5nrQkonyU15jSJwqo88cdpjZF2ma A+Kg== X-Gm-Message-State: AOAM532IBpKoLa0mwGkCiJKjk0eehkgHWCNcmGyqRVs7LpEsCUDpFFGh oF1mWVorF7hZHYseZKynDMwQNB6DLz2j741L X-Google-Smtp-Source: ABdhPJyJC9WWqFpG1sdovjK8iN3uBDcB9E1413q02oQ4tUrDqKMDXqwgcdIDISU5TEiIyHtmTU3DYA== X-Received: by 2002:a0c:ee86:: with SMTP id u6mr12990212qvr.56.1600358616680; Thu, 17 Sep 2020 09:03:36 -0700 (PDT) Received: from ?IPv6:2601:98a:4200:9210:d9f6:8d22:812e:482b? ([2601:98a:4200:9210:d9f6:8d22:812e:482b]) by smtp.gmail.com with ESMTPSA id n136sm147652qkn.14.2020.09.17.09.03.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Sep 2020 09:03:36 -0700 (PDT) From: Yuan Fu Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: 28.0.50; window-text-pixel-size returns incorrect value when line-prefix is set Message-Id: Date: Thu, 17 Sep 2020 12:03:35 -0400 To: Bug Report Emacs X-Mailer: Apple Mail (2.3608.120.23.2.1) Received-SPF: pass client-ip=2607:f8b0:4864:20::f36; envelope-from=casouri@gmail.com; helo=mail-qv1-xf36.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) To reproduce: In scratch buffer: (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 In GNU Emacs 28.0.50 (build 8, x86_64-apple-darwin19.6.0, NS = appkit-1894.60 Version 10.15.6 (Build 19G2021)) of 2020-08-23 built on Brown Repository revision: 4aff89ece6d9ceee882375879518b71ca6a89a70 Repository branch: master Windowing system distributor 'Apple', version 10.3.1894 System Description: Mac OS X 10.15.6 Configured using: 'configure --with-modules --with-pdumper=3Dyes = --oldincludedir=3D/Applications/Xcode.app/Contents/Developer/Platforms/Mac= OSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/libxml2/ --with-ns = PKG_CONFIG_PATH=3D/usr/local/Cellar/zlib/1.2.8/lib/pkgconfig:/usr/local/li= b/pkgconfig:/opt/X11/lib/pkgconfig' Configured features: PNG RSVG DBUS GLIB NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS XIM NS MODULES THREADS JSON PDUMPER LCMS2 Important settings: value of $LC_CTYPE: UTF-8 value of $LANG: en_CN.UTF-8 locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs rfc822 mml easymenu mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs text-property-search time-date subr-x seq byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/ns-win ns-win ucs-normalize mule-util term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind kqueue cocoa ns lcms2 multi-tty make-network-process emacs) Memory information: ((conses 16 44330 5709) (symbols 48 5924 1) (strings 32 15276 1588) (string-bytes 1 500116) (vectors 16 9923) (vector-slots 8 142976 7765) (floats 8 20 42) (intervals 56 192 0) (buffers 992 10)) From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 17 13:32:24 2020 Received: (at 43469) by debbugs.gnu.org; 17 Sep 2020 17:32:24 +0000 Received: from localhost ([127.0.0.1]:38893 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kIxlf-0007WN-UV for submit@debbugs.gnu.org; Thu, 17 Sep 2020 13:32:24 -0400 Received: from eggs.gnu.org ([209.51.188.92]:33676) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kIxlf-0007WC-62 for 43469@debbugs.gnu.org; Thu, 17 Sep 2020 13:32:23 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:41736) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kIxlW-00011T-Dr; Thu, 17 Sep 2020 13:32:17 -0400 Received: from [176.228.60.248] (port=2116 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kIxlV-0004l9-Ia; Thu, 17 Sep 2020 13:32:14 -0400 Date: Thu, 17 Sep 2020 20:32:23 +0300 Message-Id: <83r1r05mxk.fsf@gnu.org> From: Eli Zaretskii To: Yuan Fu In-Reply-To: (message from Yuan Fu on Thu, 17 Sep 2020 12:03:35 -0400) Subject: Re: bug#43469: 28.0.50; window-text-pixel-size returns incorrect value when line-prefix is set References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 43469 Cc: 43469@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Yuan Fu > Date: Thu, 17 Sep 2020 12:03:35 -0400 > > (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? From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 18 13:05:24 2020 Received: (at 43469) by debbugs.gnu.org; 18 Sep 2020 17:05:24 +0000 Received: from localhost ([127.0.0.1]:44303 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kJJp6-00018J-BG for submit@debbugs.gnu.org; Fri, 18 Sep 2020 13:05:24 -0400 Received: from mail-qv1-f42.google.com ([209.85.219.42]:42818) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kJJp4-000183-OW for 43469@debbugs.gnu.org; Fri, 18 Sep 2020 13:05:23 -0400 Received: by mail-qv1-f42.google.com with SMTP id h1so3285025qvo.9 for <43469@debbugs.gnu.org>; Fri, 18 Sep 2020 10:05:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=6IrW1XvzYdCTIemISL2TyZPf8eF6VzVBASeQ21z+it0=; b=bA9wBJuGd2I7c9NRibe7pxbsxE8Dhs06g7qFM259Nj+xYEN1qLcggS0KIgormHIvOU DWM6MPnavc+jn9J8IPELWdiEuvQ3J20o66niQXbId4WMHD8pWJmYbdzwXoDJg74WDIS0 RCLJIROodezXZ6cXt3utHpM6r2QVA6/QO35z/aD4XZxUG7Cx34aZWviXK0ezhxPw+FhZ sJEONBfAkpyop5Ys3iZhW2ZiCjugm5Qc/WLmvkBntZbL9Ddx6HR+7ktMA4qSzmwC/VJ9 MwG6eA9xP1XVbP2Ek3YhoemdMrZBSQxVw5wzKLlV/SMD8olgux808CZF/ra5LiMGaitY h/qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=6IrW1XvzYdCTIemISL2TyZPf8eF6VzVBASeQ21z+it0=; b=es9Bn8wAYRCt59l7wVcE+bcnNqVH7RD5wLV9JJRgz8Wrsw9h0+5gncMD0yNBJMYk3K fonihOkSTynZ3wq530fYgMF9SJBJXfBqMlBNPI/zyouUlm+j1tymvjRO5wHNDL8u5LE7 vc7SPAgarNZmN9SaxRcW+bqEoWvoPGpNIZ2Dfz/6a9ouIG0KkK/r4FwZsDGu+HajsWuq GZpDEcBpJO9D2JL5ksq3v2eDvDeXZ4uSZCrJV9HjPctE67cXFWRc2Yh08e6BKh3McyvF 8PcXNZ05xtaF8cdi6oLC52eyq+I9m+W2sgKLuLh5FZnr6I/U2nGE6XrVXZhbPvqKqrFl 4TUA== X-Gm-Message-State: AOAM531WEqPwwbAsHPgmezL5EWHF3+eDmLluth4W0+Ev99AvDFl9FJy/ Z1WwKagVo/U+wujkPKrP7XE= X-Google-Smtp-Source: ABdhPJz8sx07CcmrE+NPK33O6cdZ2kxRBOP0U+nRoyXuNuijkRc03s69YPTx6aVHHnhldcAFNr5MPQ== X-Received: by 2002:a0c:8ecb:: with SMTP id y11mr18033063qvb.51.1600448717196; Fri, 18 Sep 2020 10:05:17 -0700 (PDT) Received: from ?IPv6:2601:98a:4200:9210:698f:d3dd:778f:8619? ([2601:98a:4200:9210:698f:d3dd:778f:8619]) by smtp.gmail.com with ESMTPSA id u66sm2492269qka.136.2020.09.18.10.05.15 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Sep 2020 10:05:16 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: bug#43469: 28.0.50; window-text-pixel-size returns incorrect value when line-prefix is set From: Yuan Fu In-Reply-To: <83r1r05mxk.fsf@gnu.org> Date: Fri, 18 Sep 2020 13:05:15 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: <97950C21-6F10-4E4C-8854-BA64C023B9D6@gmail.com> References: <83r1r05mxk.fsf@gnu.org> To: Eli Zaretskii X-Mailer: Apple Mail (2.3608.120.23.2.1) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 43469 Cc: 43469@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > On Sep 17, 2020, at 1:32 PM, Eli Zaretskii wrote: >=20 >> From: Yuan Fu >> Date: Thu, 17 Sep 2020 12:03:35 -0400 >>=20 >> (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))))) >>=20 >> Prints first 98, then 119 >=20 > Why do you think this is a bug? I thought the pixel width shouldn=E2=80=99t include the line-prefix? Yuan= From debbugs-submit-bounces@debbugs.gnu.org Fri Sep 18 15:22:11 2020 Received: (at 43469) by debbugs.gnu.org; 18 Sep 2020 19:22:11 +0000 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 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 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 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 Date: Fri, 18 Sep 2020 22:22:17 +0300 Message-Id: <835z8a51qu.fsf@gnu.org> From: Eli Zaretskii To: Yuan Fu In-Reply-To: <97950C21-6F10-4E4C-8854-BA64C023B9D6@gmail.com> (message from Yuan Fu on Fri, 18 Sep 2020 13:05:15 -0400) Subject: Re: bug#43469: 28.0.50; window-text-pixel-size returns incorrect value when line-prefix is set 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 X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 43469 Cc: 43469@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > 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. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 19 14:33:17 2020 Received: (at 43469) by debbugs.gnu.org; 19 Sep 2020 18:33:17 +0000 Received: from localhost ([127.0.0.1]:48099 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kJhfh-0005cR-Bu for submit@debbugs.gnu.org; Sat, 19 Sep 2020 14:33:17 -0400 Received: from mail-qv1-f46.google.com ([209.85.219.46]:35922) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kJhfa-0005c9-9g for 43469@debbugs.gnu.org; Sat, 19 Sep 2020 14:33:16 -0400 Received: by mail-qv1-f46.google.com with SMTP id f11so5009755qvw.3 for <43469@debbugs.gnu.org>; Sat, 19 Sep 2020 11:33:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=HzFKwvm+YGlZdEox86EgfZ7wnVIJreW5aky36RFzT6A=; b=fPvXs55/I+Gdi7wjm2fzxYXFXxm/9cGYl4Kx2sbHLjNS2rgy8Fsy/zQqj923tRH4E0 jBARKeY8KzH/m/o7oULmU9y3OSLfMJem8NXkVtwGWA3NPyp7gxp+beQJs53sMV9miDZT rhvgC+lm9rTlXv6QW2CT91X2I1ecG62wSfaqBQPRqe+pm3A3yFlgDxOr5qVG7GGatT0b oUrriEwncctDUEqmetVu01OMgEGR4+j2FeerzVNz65etwma81iidxNLh5qmUzvB89eaY Zr+PO2qo4EIQdnXdi2K2+SPvTx5VjppFdFkJwv28LAiMLbmr1t8UDBuQsfd12V93kMCn jkEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=HzFKwvm+YGlZdEox86EgfZ7wnVIJreW5aky36RFzT6A=; b=GpxT0i2WG/wR0LLbCERhyPaz+XK6/4JL9X6u8KQ7O67zC0We2ClDm9DiWkxa9NPf/E m2Om4TKiHtvLwN/EJ/3o23g0Imlz97TRpeVX7FEn1hM+ZNbHqoX1R24KAALIvrpf6vve FoaVovxQ9dOaoNkNTKdtXiWjcXtCNltphT4aCLkLCCHofMwYEQF1xMgIRdo20ergjtEj p/689amhA8Qr4sijIfapR4qy9gPAikpMPDGWVX/KJtVO+hdxMKkeFX8bslgYXJo8h8di WdBvr60vliOGe5oZU5X1axVxslhatNk2oBHxCNq6YnIg/MgY0Yfh9EOh3LCEy336y1ju IJ5w== X-Gm-Message-State: AOAM532sbAYCbMkuo+n2S3XGt8z8Ydvld/FZxGpStaTulX9J5n3OFaUe +VDR0O+YFKtBBSVXj68Of4KRmivgu7dkE+j/ X-Google-Smtp-Source: ABdhPJx8JeELZbNTolHsqj6HyMQN/TrZJz+5gozGgExSVcjDveNtgAvlnaEe+XKaoqVxjn5/hpjVSw== X-Received: by 2002:ad4:4891:: with SMTP id bv17mr39651485qvb.23.1600540384696; Sat, 19 Sep 2020 11:33:04 -0700 (PDT) Received: from ?IPv6:2601:98a:4200:9210:6549:b792:5f47:6486? ([2601:98a:4200:9210:6549:b792:5f47:6486]) by smtp.gmail.com with ESMTPSA id m196sm5026150qke.87.2020.09.19.11.33.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 19 Sep 2020 11:33:04 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Re: bug#43469: 28.0.50; window-text-pixel-size returns incorrect value when line-prefix is set From: Yuan Fu In-Reply-To: <835z8a51qu.fsf@gnu.org> Date: Sat, 19 Sep 2020 14:33:03 -0400 Content-Transfer-Encoding: quoted-printable Message-Id: <8EBE71CC-3AA0-4680-92FE-6B91F4E0773A@gmail.com> References: <83r1r05mxk.fsf@gnu.org> <97950C21-6F10-4E4C-8854-BA64C023B9D6@gmail.com> <835z8a51qu.fsf@gnu.org> To: Eli Zaretskii X-Mailer: Apple Mail (2.3608.120.23.2.1) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 43469 Cc: 43469@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) > On Sep 18, 2020, at 3:22 PM, Eli Zaretskii wrote: >=20 >> From: Yuan Fu >> Date: Fri, 18 Sep 2020 13:05:15 -0400 >> Cc: 43469@debbugs.gnu.org >>=20 >>>> (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))))) >>>>=20 >>>> Prints first 98, then 119 >>>=20 >>> Why do you think this is a bug? >>=20 >> I thought the pixel width shouldn=E2=80=99t include the line-prefix? >=20 > It should. =46rom the function's doc string: >=20 > This function exists to allow Lisp programs to adjust the dimensions > of WINDOW to the buffer text it needs to display. >=20 > When you want to know how wide a window you need for displaying some > text, you do want the line-prefix part accounted for. I see. I managed to use (window-text-pixel-size nil (point) (point)) to = calculate the prefix width and subtract it out. Thanks. Yuan From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 19 14:33:46 2020 Received: (at 43469-done) by debbugs.gnu.org; 19 Sep 2020 18:33:46 +0000 Received: from localhost ([127.0.0.1]:48102 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kJhg9-0005d8-Md for submit@debbugs.gnu.org; Sat, 19 Sep 2020 14:33:46 -0400 Received: from mail-qt1-f169.google.com ([209.85.160.169]:44092) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kJhg8-0005cu-7B for 43469-done@debbugs.gnu.org; Sat, 19 Sep 2020 14:33:44 -0400 Received: by mail-qt1-f169.google.com with SMTP id e7so8433317qtj.11 for <43469-done@debbugs.gnu.org>; Sat, 19 Sep 2020 11:33:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:mime-version:subject:message-id:references:to:date; bh=KGoiJ8cNgCFg7oLWOFJ8Fqj4DIYX/fd8taZxiBpB9bE=; b=pEiimS9jiN/wHXmBPFVB2NBnFmimDPuHfLs0R6AH0591Jo6jsdqa1dhHj21Y/mBYfk KBUHbBLsaXZnbtsqTgM3weouqZO+dKsocrxGWgPo8tRkqPvN2Cx+YOoHBIKUA+sAYSDE h+VaM8OqyF5DaKrKsdB6SxP66Kfs8JOSAqjgPPLb1t5Zc1hJOJ5sPRCC+/3kaFjRf2jH Kg7c8dfDknknrcqdbFDyRCRTlWwNmwx4aMzLXCpA426usmubTaIYQ+wo2wEQKEhF1dKs riIReEbT6Aa5lUMza8ONuTcAW4/48apFpZK8idF4FB/pR/e6VsZYd3aFYcWpvXa8dovz UauA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:message-id:references :to:date; bh=KGoiJ8cNgCFg7oLWOFJ8Fqj4DIYX/fd8taZxiBpB9bE=; b=oUerpJwJQ5xQ0ktHgeTqN+tUiz5jH3Go1Fv3s71HDFuy9fUiUzaPrPgWnZivum8NoN IOCwU821f8fVSZBHVawvfJLvnglo+F719dfxmtFvBMWkBVArqir9asxDzb9nv934j+tT +Q9HQONRl30fbFtXaSseHFB6qSNuA1aVTTw8MwoOdhbEVYjw99jC/HZn9EAjKlh9jkXa jNI+5rCERyCj047VRQwrdtWp9QdXd6P6bM/ThtxpOLP1jeB5PXbGkzq11tyCJuf6WvnZ NRQ3OObjXM6r4ZCbQkTRvivJOiEb4EldH77Q5bvi+lEJVjO1rW7gCLcDZnaU66JbF5mx 32oQ== X-Gm-Message-State: AOAM530I0JqBGjqS/AHQDAmj2WDLj2CaYx17A94X5lHQXA+VWiKsgVYd H8bzqaW/Y+Qxq413ZfihZ/igWCzidZp5eUYJ X-Google-Smtp-Source: ABdhPJwSxu0LMZB2InA734AlhSB4g/itvSjTKpQBy3SY/dlS+EbAmuxK/Y56Acl4SkcUiiUpOLqMmQ== X-Received: by 2002:ac8:f23:: with SMTP id e32mr26434903qtk.168.1600540418561; Sat, 19 Sep 2020 11:33:38 -0700 (PDT) Received: from ?IPv6:2601:98a:4200:9210:6549:b792:5f47:6486? ([2601:98a:4200:9210:6549:b792:5f47:6486]) by smtp.gmail.com with ESMTPSA id m196sm5026150qke.87.2020.09.19.11.33.37 for <43469-done@debbugs.gnu.org> (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 19 Sep 2020 11:33:38 -0700 (PDT) From: Yuan Fu Content-Type: multipart/alternative; boundary="Apple-Mail=_4B0FA449-06F2-4678-A544-CC0FE798CC33" Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\)) Subject: Fwd: bug#43469: 28.0.50; window-text-pixel-size returns incorrect value when line-prefix is set Message-Id: <15D4649C-A7E0-4269-9CE8-904B9DAC6A23@gmail.com> References: <8EBE71CC-3AA0-4680-92FE-6B91F4E0773A@gmail.com> To: 43469-done@debbugs.gnu.org Date: Sat, 19 Sep 2020 14:33:37 -0400 X-Mailer: Apple Mail (2.3608.120.23.2.1) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 43469-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --Apple-Mail=_4B0FA449-06F2-4678-A544-CC0FE798CC33 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > Begin forwarded message: >=20 > From: Yuan Fu > Subject: Re: bug#43469: 28.0.50; window-text-pixel-size returns = incorrect value when line-prefix is set > Date: September 19, 2020 at 2:33:03 PM GMT-4 > To: Eli Zaretskii > Cc: 43469@debbugs.gnu.org >=20 >=20 >=20 >> On Sep 18, 2020, at 3:22 PM, Eli Zaretskii wrote: >>=20 >>> From: Yuan Fu >>> Date: Fri, 18 Sep 2020 13:05:15 -0400 >>> Cc: 43469@debbugs.gnu.org >>>=20 >>>>> (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))))) >>>>>=20 >>>>> Prints first 98, then 119 >>>>=20 >>>> Why do you think this is a bug? >>>=20 >>> I thought the pixel width shouldn=E2=80=99t include the line-prefix? >>=20 >> It should. =46rom the function's doc string: >>=20 >> This function exists to allow Lisp programs to adjust the dimensions >> of WINDOW to the buffer text it needs to display. >>=20 >> When you want to know how wide a window you need for displaying some >> text, you do want the line-prefix part accounted for. >=20 > I see. I managed to use (window-text-pixel-size nil (point) (point)) = to calculate the prefix width and subtract it out. Thanks. >=20 > Yuan >=20 --Apple-Mail=_4B0FA449-06F2-4678-A544-CC0FE798CC33 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8

Begin forwarded message:

From: = Yuan Fu <casouri@gmail.com>
Subject: = Re: bug#43469: = 28.0.50; window-text-pixel-size returns incorrect value when line-prefix = is set
Date: = September 19, 2020 at 2:33:03 = PM GMT-4
To: = Eli Zaretskii <eliz@gnu.org>



On Sep 18, 2020, at 3:22 = PM, Eli Zaretskii <eliz@gnu.org> wrote:

From: Yuan Fu <casouri@gmail.com>
Date: Fri, 18 Sep 2020 13:05:15 -0400
Cc: 43469@debbugs.gnu.org

(progn (insert "xxxxxxxxxxxxxx")
=     (print (car (window-text-pixel-size
= =             &n= bsp;    nil (line-beginning-position) = (line-end-position))))
=     (put-text-property (line-beginning-position) = (line-end-position)
=             &n= bsp;          'line-pref= ix "   ")
    (print (car = (window-text-pixel-size
=             &n= bsp;    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=E2=80=99t include the line-prefix?

It should.  =46rom 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.

I see. I = managed to use (window-text-pixel-size nil (point) (point)) to calculate = the prefix width and subtract it out. Thanks.

Yuan


= --Apple-Mail=_4B0FA449-06F2-4678-A544-CC0FE798CC33-- From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 19 14:56:43 2020 Received: (at 43469-done) by debbugs.gnu.org; 19 Sep 2020 18:56:43 +0000 Received: from localhost ([127.0.0.1]:48128 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kJi2M-00069f-QD for submit@debbugs.gnu.org; Sat, 19 Sep 2020 14:56:43 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46688) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kJi2L-00069T-Ed for 43469-done@debbugs.gnu.org; Sat, 19 Sep 2020 14:56:41 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50229) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJi2G-0002hI-3K; Sat, 19 Sep 2020 14:56:36 -0400 Received: from [176.228.60.248] (port=2948 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kJi2E-0005Zi-TE; Sat, 19 Sep 2020 14:56:35 -0400 Date: Sat, 19 Sep 2020 21:56:32 +0300 Message-Id: <83v9g91tpb.fsf@gnu.org> From: Eli Zaretskii To: Yuan Fu In-Reply-To: <8EBE71CC-3AA0-4680-92FE-6B91F4E0773A@gmail.com> (message from Yuan Fu on Sat, 19 Sep 2020 14:33:03 -0400) Subject: Re: bug#43469: 28.0.50; window-text-pixel-size returns incorrect value when line-prefix is set References: <83r1r05mxk.fsf@gnu.org> <97950C21-6F10-4E4C-8854-BA64C023B9D6@gmail.com> <835z8a51qu.fsf@gnu.org> <8EBE71CC-3AA0-4680-92FE-6B91F4E0773A@gmail.com> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 43469-done Cc: 43469-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Yuan Fu > Date: Sat, 19 Sep 2020 14:33:03 -0400 > Cc: 43469@debbugs.gnu.org > > > 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. > > I see. I managed to use (window-text-pixel-size nil (point) (point)) to calculate the prefix width and subtract it out. Thanks. Thanks, so I'm closing this bug. From unknown Fri Jun 20 18:20:22 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 18 Oct 2020 11:24:10 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator