From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Sean Devlin Newsgroups: gmane.emacs.bugs Subject: bug#60575: 28.2; string-pixel-width always returns zero Date: Thu, 5 Jan 2023 10:51:25 -0500 Message-ID: Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.400.42\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15833"; mail-complaints-to="usenet@ciao.gmane.io" To: 60575@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 05 16:52:15 2023 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 1pDSXP-0003y5-9v for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 05 Jan 2023 16:52:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDSXF-0000PH-3T; Thu, 05 Jan 2023 10:52:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDSXD-0000G9-C1 for bug-gnu-emacs@gnu.org; Thu, 05 Jan 2023 10:52:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pDSXC-0005Xg-Lo for bug-gnu-emacs@gnu.org; Thu, 05 Jan 2023 10:52:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pDSXC-000506-54 for bug-gnu-emacs@gnu.org; Thu, 05 Jan 2023 10:52:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Sean Devlin Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Jan 2023 15:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 60575 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.167293390219192 (code B ref -1); Thu, 05 Jan 2023 15:52:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 5 Jan 2023 15:51:42 +0000 Original-Received: from localhost ([127.0.0.1]:52657 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDSWs-0004zT-9d for submit@debbugs.gnu.org; Thu, 05 Jan 2023 10:51:42 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:54908) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pDSWr-0004zM-44 for submit@debbugs.gnu.org; Thu, 05 Jan 2023 10:51:41 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDSWq-0007ua-Td for bug-gnu-emacs@gnu.org; Thu, 05 Jan 2023 10:51:40 -0500 Original-Received: from mail-vk1-xa34.google.com ([2607:f8b0:4864:20::a34]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pDSWo-0004uy-RM for bug-gnu-emacs@gnu.org; Thu, 05 Jan 2023 10:51:40 -0500 Original-Received: by mail-vk1-xa34.google.com with SMTP id b81so18346155vkf.1 for ; Thu, 05 Jan 2023 07:51:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toadstyle-org.20210112.gappssmtp.com; s=20210112; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:from:to:cc:subject:date:message-id:reply-to; bh=w3M0mhNvhM+ez0Ula8OrjMHj5g9mR8UQm1m5wZkI7xg=; b=BhZqq7Yk9z+6HnrUfw1ehYBdqvrkAobvJMrMMz/qxseG/Dv36FAXkFtfVJJq3CSFZP PAycaj/dRsnK9JPyn67T9vk3TZbRgwxZ/hMC2Cdvnyyt60FGZ3xK7H7/YOKYFCEVYyMX Ws1NJEaJ/044Zbfi3dshdMylavlaOPgpL9FZu/GMl0UHCQ5zeiios5GcLknOXdO18YVz o+jahsUF50w9i9kYENW02scz98PzhSXqYHIPrDptUeCNwNdjzavuq4XCLyAcaV8rH9/n 9FYcoy2bWj+EHCBkJGbxwUDcwWZCPAhSdDKm7Rn9SxphhjBfu/p7LCpfAQxbirshxoIY pg2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=w3M0mhNvhM+ez0Ula8OrjMHj5g9mR8UQm1m5wZkI7xg=; b=epd0eqtOLWZcCpeGQt6uFwXwURaaeL9Ntj4dE513VtKGGeF/RKAKxE6jiQrq+9AR2m v5oBtBTb6AqURVjqSxcR1ta0wVC5LHuByW+r0bScsDapEpHD2W+5Imb9N+4EWWuy7iqa s5OLY/moj1lAQFnz1dYBf9gZWGsfS4qyubvVfoyHJc4BHN8tu2KAChWcAcIvuE7wYA6L pSch8lKaMYNLhWXrbdaDGKIAVhKRNPpubJHvh4BFM/35esbmMZt5HV2Bst1VphwPoGpc 6APqgI18vajhu2DzEVLNPoslrWR0SbXT7q6whw/w3dJFFg7bsoSYOyaAW9o3jaRT5RDy vcNg== X-Gm-Message-State: AFqh2krgMyCMnazqnm4Sp6kE9SRSObPyA7SbenaOnVK6gVNktqLZba5r DHux62WxhWAbp8NKCl9sm1e7Qfmbcv5U8wsY X-Google-Smtp-Source: AMrXdXv5R5QpjonBa8UULGmK4ERQwkwhbYgpVO5zsh5N/mW/XgvzxDa3icBFEq/HjNhskrChKa+hsg== X-Received: by 2002:a1f:9b81:0:b0:3cc:110e:b81e with SMTP id d123-20020a1f9b81000000b003cc110eb81emr24300958vke.8.1672933896859; Thu, 05 Jan 2023 07:51:36 -0800 (PST) Original-Received: from smtpclient.apple ([70.107.172.48]) by smtp.gmail.com with ESMTPSA id i17-20020a05620a405100b006fcb77f3bd6sm26473328qko.98.2023.01.05.07.51.36 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Jan 2023 07:51:36 -0800 (PST) X-Mailer: Apple Mail (2.3731.400.42) Received-SPF: pass client-ip=2607:f8b0:4864:20::a34; envelope-from=spd@toadstyle.org; helo=mail-vk1-xa34.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, 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-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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:252608 Archived-At: Hi folks, The compat package recently added a function string-pixel-width. On my macOS GUI build of Emacs 28.2, this function always returns zero. I'm using commit 46d97649897e91a4086b9812346eed168a8c9cc9 of the compat package. To reproduce this result, install compat with the given commit hash and evaluate the following forms: (require 'compat) (string-pixel-width "a string of some width") The second form returns zero regardless of the input string. I see that string-pixel-width inserts the string in a buffer and then calls (buffer-text-pixel-size nil nil t). This function is also defined in compat and calls window-text-pixel-size to do its work. It looks like the handling of the x-limit parameter in window-text-pixel-size may have changed in the Emacs 29 branch. In particular, it seems to set the max_x variable to INT_MAX if x-limit is t (or any non-nil value that is not a fixnum in the expected range). The string-pixel-width function does pass t as the x-limit argument, so I think the behavior will differ between Emacs 29 and earlier versions. Maybe the string-pixel-width function in compat should just pass most-positive-fixnum for x-limit. Thanks! In GNU Emacs 28.2 System Description: macOS 13 Configured using: 'configure --with-ns '--enable-locallisppath=/Library/Application Support/Emacs/${version}/site-lisp:/Library/Application Support/Emacs/site-lisp' --with-modules' Configured features: ACL GMP GNUTLS JSON LIBXML2 MODULES NOTIFY KQUEUE NS PDUMPER THREADS TOOLKIT_SCROLL_BARS ZLIB Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: IELM 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 rmc puny 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 mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils pulse color help-fns radix-tree help-mode xref project time-date subr-x thingatpt find-func compat compat-29 compat-28 compat-27 compat-26 compat-25 compat-24 vc-git diff-mode easy-mmode vc-dispatcher seq byte-opt gv bytecomp byte-compile cconv cl-print ielm pp comint ansi-color ring misearch multi-isearch dired-aux cl-loaddefs cl-lib dired dired-loaddefs iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode 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 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 hashtable-print-readable backquote threads kqueue cocoa ns multi-tty make-network-process emacs) Memory information: ((conses 16 73699 8408) (symbols 48 8298 1) (strings 32 24928 1639) (string-bytes 1 835607) (vectors 16 17852) (vector-slots 8 238271 15106) (floats 8 118 69) (intervals 56 1264 0) (buffers 992 18))