From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Brahimi Saifullah Newsgroups: gmane.emacs.bugs Subject: bug#51995: 29.0.50; `string-pixel-width' depends on the current window width Date: Sat, 20 Nov 2021 02:04:14 -0300 Message-ID: <84czmvbepd.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7776"; mail-complaints-to="usenet@ciao.gmane.io" To: 51995@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 20 06:05:39 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 1moIZG-0001hf-Es for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Nov 2021 06:05:38 +0100 Original-Received: from localhost ([::1]:50506 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1moIZD-0006Bq-Dh for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 20 Nov 2021 00:05:37 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:36246) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1moIYg-0006BH-Ny for bug-gnu-emacs@gnu.org; Sat, 20 Nov 2021 00:05:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58003) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1moIYg-0000s3-FP for bug-gnu-emacs@gnu.org; Sat, 20 Nov 2021 00:05:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1moIYg-0000Rw-8W for bug-gnu-emacs@gnu.org; Sat, 20 Nov 2021 00:05:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Brahimi Saifullah Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 20 Nov 2021 05:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 51995 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16373846771658 (code B ref -1); Sat, 20 Nov 2021 05:05:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 20 Nov 2021 05:04:37 +0000 Original-Received: from localhost ([127.0.0.1]:41316 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1moIYH-0000Qg-8v for submit@debbugs.gnu.org; Sat, 20 Nov 2021 00:04:37 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:52142) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1moIYF-0000QW-8n for submit@debbugs.gnu.org; Sat, 20 Nov 2021 00:04:35 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:36194) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1moIYE-00068d-W9 for bug-gnu-emacs@gnu.org; Sat, 20 Nov 2021 00:04:35 -0500 Original-Received: from [2607:f8b0:4864:20::836] (port=38707 helo=mail-qt1-x836.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1moIYC-0000ph-Qq for bug-gnu-emacs@gnu.org; Sat, 20 Nov 2021 00:04:34 -0500 Original-Received: by mail-qt1-x836.google.com with SMTP id 8so11507725qtx.5 for ; Fri, 19 Nov 2021 21:04:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=09p81VldLPhoOE4htDq3aCWGfh3cCUPgM7pAbfE++is=; b=A6MRXX+ZG6S4geHJK+bikY6vXa3INX2aIH88JMCWcJG2eqith+ZZyLsw0axcN+Co3r NC5oWlOKw3c41PmZKsQx2m+QyEexEk3CVPTeWi6c/eQeqohOFmknAWY/FORS1415ndk5 qYA8V5g4rGsae9LphuEehqb90iVZWJ8f1pIKYDpMWYiwvmOzF62orPWbJmUWEiRTDAmk GYMfajLZ8SWVZKh7ejbW68Hx1j192/lZ/0hDUquvdOtRpR3BHBqOnHUvPFrF3x9bZ8SS 2EAxRRTmDDq4D1aWDuw5rGHjC0V/nNeZNjbCObL8NnH/B1RNibtpdvbWEhT3e0TDFWB2 8GzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=09p81VldLPhoOE4htDq3aCWGfh3cCUPgM7pAbfE++is=; b=LL9xtBEJTQih8d0iN31R/hfXscvrEMs3fTAuO2ido2+robVgJPg72p1VW2BYzxXGBH zwC+m+UNOKojuWGl2SFlT3DB1eSqjrwW7iuPoQsPB6K/H4CqVZaPDIczTKF8WZBFLwlE m1G7325TXTtb9XsuYqoVJx4bccQhaBC4DJcBzFzUMDjmqDuhUW4+VxfvrUlrzytNm427 8iXYtWCLD8IxTtkvk05k4bsQpI+owQgcAzfuV5Am50vRyv305P66pFZbCk8/hQrHvrg/ 5x821iKJa2kDhBt0TBcg17QQhnuITPSsHrwmMF3NjVBeXLSraeiN6VjPxKg8NlLcum1P 9v9w== X-Gm-Message-State: AOAM533meti0GIN8Iw1cuVpbNpHBupAsi/TkD/U6Fyy8cfr5tGXBykBi 6uZr57pALQiwBq053lc/deJDSxDoG+qeeiw8 X-Google-Smtp-Source: ABdhPJxSVy3m99ONkcY+mdY0nGaKXbJ1TiIuFw+ccsrT7ZNytGn9cJplL1dQE2as/dk8wPvW4FQVIg== X-Received: by 2002:ac8:4e4f:: with SMTP id e15mr12276482qtw.168.1637384671335; Fri, 19 Nov 2021 21:04:31 -0800 (PST) Original-Received: from COMPUTADOR ([2804:14d:90bc:8726:6928:8009:bb3:aa5f]) by smtp.googlemail.com with ESMTPSA id e17sm1021869qtw.18.2021.11.19.21.04.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Nov 2021 21:04:31 -0800 (PST) X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::836 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::836; envelope-from=brahimi.saifullah@gmail.com; helo=mail-qt1-x836.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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:220448 Archived-At: emacs -Q (string-pixel-width "foo") =3D> 24 (string-pixel-width "fooooooooooooooooooooooooooooooooooooooooooooooooooooo= ooooooooooooooooooooooooooooooooooooooo") =3D> 744 C-x 3 (or reduce the size of the current window some other way) (string-pixel-width "fooooooooooooooooooooooooooooooooooooooooooooooooooooo= ooooooooooooooooooooooooooooooooooooooo") =3D> 481 C-x 3 (string-pixel-width "fooooooooooooooooooooooooooooooooooooooooooooooooooooo= ooooooooooooooooooooooooooooooooooooooo") =3D> 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' wi= dth, the windows' width is returned, and not the string's. This can be traced back to `window-text-pixel-size', specifically: | The optional argument X-LIMIT, if non-nil, specifies the maximum X | coordinate beyond which the text should be ignored. It is therefore | also the maximum width that the function can return. X-LIMIT nil or | omitted means to use the pixel-width of WINDOW=E2=80=99s body. This defa= ult | means text of truncated lines wider than the window will be ignored; | specify a large value for X-LIMIT if lines are truncated and you need | to account for the truncated text. Use nil for X-LIMIT if you want to | know how high WINDOW should become in order to fit all of its buffer=E2= =80=99s | text with the width of WINDOW unaltered. Use the maximum width WINDOW | may assume if you intend to change WINDOW=E2=80=99s width. Since calcula= ting | the width of long lines can take some time, it=E2=80=99s always a good id= ea to | make this argument as small as possible; in particular, if the buffer | contains long lines that shall be truncated anyway. In `string-pixel-width', X-LIMIT is nil. I think the best solution is to modify `window-text-pixel-size' so that X-LIMIT may be specified as having "no limit". Y-LIMIT already offers this possibility: when it is nil, the entirety of the buffer is considered (in reality, it seems to be simply set to INT_MAX, and that does the job). ---------------------------------------------------------------------------= ----- I'm experience some different problems with this function, and I'm pretty s= ure it don't stem from this same issue, but from WINDOW being buffer. Should I open a new bug report? Or expand upon the issue on this same threa= d? In GNU Emacs 29.0.50 (build 1, x86_64-w64-mingw32) of 2021-11-19 built on COMPUTADOR Repository revision: 956f21b6b916f8d87a7b872e02f668883c17b8ba Repository branch: master Windowing system distributor 'Microsoft Corp.', version 10.0.19041 System Description: Microsoft Windows 10 Enterprise (v10.0.2004.19041.1348) Configured using: 'configure --with-native-compilation --with-json --with-imagemagick --without-pop' Configured features: ACL DBUS GIF GMP GNUTLS HARFBUZZ IMAGEMAGICK JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND THREADS TIFF TOOLKIT_SCROLL_BARS WEBP XPM ZLIB Important settings: value of $LC_CTYPE: pt_BR.UTF-8 value of $LANG: PTB locale-coding-system: cp1252 Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-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 indent-tabs-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media rmc puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json map text-property-search seq byte-opt bytecomp byte-compile cconv mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils gv time-date subr-x help-mode cl-loaddefs cl-lib iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel dos-w32 ls-lisp disp-table term/w32-win w32-win w32-vars term/common-win tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax 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 emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads w32notify dbusbind w32 lcms2 multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 72646 4855) (symbols 48 6899 0) (strings 32 21630 1558) (string-bytes 1 703288) (vectors 16 14099) (vector-slots 8 298463 13452) (floats 8 26 261) (intervals 56 234 3) (buffers 992 10))