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#51995: 29.0.50; `string-pixel-width' depends on the current window width Date: Sat, 20 Nov 2021 09:20:51 +0200 Message-ID: <83o86fthrg.fsf@gnu.org> References: <84czmvbepd.fsf@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29444"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 51995@debbugs.gnu.org To: Brahimi Saifullah Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 20 08:21:21 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 1moKga-0007WR-Lp for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Nov 2021 08:21:20 +0100 Original-Received: from localhost ([::1]:54346 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1moKgZ-0000D9-AW for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Nov 2021 02:21:19 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:37358) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1moKgI-0000AO-LU for bug-gnu-emacs@gnu.org; Sat, 20 Nov 2021 02:21:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58150) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1moKgI-0008Rx-7m for bug-gnu-emacs@gnu.org; Sat, 20 Nov 2021 02:21:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1moKgI-0004VZ-29 for bug-gnu-emacs@gnu.org; Sat, 20 Nov 2021 02:21:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Nov 2021 07:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51995 X-GNU-PR-Package: emacs Original-Received: via spool by 51995-submit@debbugs.gnu.org id=B51995.163739285617298 (code B ref 51995); Sat, 20 Nov 2021 07:21:02 +0000 Original-Received: (at 51995) by debbugs.gnu.org; 20 Nov 2021 07:20:56 +0000 Original-Received: from localhost ([127.0.0.1]:41462 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1moKgC-0004Uw-Jt for submit@debbugs.gnu.org; Sat, 20 Nov 2021 02:20:56 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:36476) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1moKgB-0004Uj-HI for 51995@debbugs.gnu.org; Sat, 20 Nov 2021 02:20:55 -0500 Original-Received: from [2001:470:142:3::e] (port=58468 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 1moKg6-0008Oi-Aq; Sat, 20 Nov 2021 02:20:50 -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=4dYZE6r3OQTAYO+MjCme1zJIQgR79mV+Fc0PlETmVGo=; b=KFtI+RUHm4ag C2YlMJUa96nvQh5OphN9O/1vCwC4wLmr/a9PLkJKKL5hZjEmCMXxoSBaJtsP7V0nz7Chv8cfdajrb fRUMXRutFLw42wR3AVE62CABC/haVpgZKzSwYCJBy61cyNBnpa7dFXhgG3eJrGPQpUQcRUKm8GjGU Pyuq9g/H9is/w8ptBqbkO2YZBIgo+athV7qVj7eh8mwvVnDXFglthwJekDpQv33SFmO9oL/jI78mG R7DiUbD6QBC6PdEkdDABR8oqv1WAAqFCznY/Wtan1aDCiPCxV/XSXsQ5CZBwSf+2JtAIg1u6n5t3d LB3ExWh1V+4WjFEXH7Ar8w==; Original-Received: from [87.69.77.57] (port=2641 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 1moKg5-0005iX-TK; Sat, 20 Nov 2021 02:20:50 -0500 In-Reply-To: <84czmvbepd.fsf@gmail.com> (message from Brahimi Saifullah on Sat, 20 Nov 2021 02:04:14 -0300) 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:220454 Archived-At: > From: Brahimi Saifullah > Date: Sat, 20 Nov 2021 02:04:14 -0300 > > > emacs -Q > (string-pixel-width "foo") > => 24 > (string-pixel-width "foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo") > => 744 > C-x 3 (or reduce the size of the current window some other way) > (string-pixel-width "foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo") > => 481 > C-x 3 > (string-pixel-width "foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo") > => 225 > And so on. The exact values might vary per system. > > The problem is that, when the string's width is larger than the windows' width, > the windows' width is returned, and not the string's. Why is it useful to measure width of a string that is wider than the window? Isn't it enough to know that the string is wider than the window in that case? (This part is not currently documented, but documenting it is easy.) What is the actual real-life situation where this is needed?