From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.bugs Subject: bug#51766: string-pixel-width limitations (was: bug#51766: 29.0.50; Return value of buffer-chars-modified-tick changes when buffer text is not yet changed before inserting a character for non-latin input methods) Date: Tue, 21 Jun 2022 19:00:34 +0800 Message-ID: <87r13iqo19.fsf@localhost> References: <87mtmalrs1.fsf@localhost> <837dde200c.fsf@gnu.org> <87k0helmig.fsf@localhost> <831r3m1tpk.fsf@gnu.org> <8735o1r31q.fsf@localhost> <834k8hzi10.fsf@gnu.org> <87zgq9pmb6.fsf@localhost> <831r3lzfk4.fsf@gnu.org> <87wnldpk5x.fsf@localhost> <83zgq9xv1y.fsf@gnu.org> <87r1bkpgjw.fsf@localhost> <87y1xv7ggf.fsf@localhost> <838rpvpns3.fsf@gnu.org> <8735fyslgq.fsf@localhost> <83fsjyl3sz.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26827"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 51766@debbugs.gnu.org, monnier@iro.umontreal.ca To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 21 13:00:59 2022 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 1o3bcx-0006fZ-KQ for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 21 Jun 2022 13:00:59 +0200 Original-Received: from localhost ([::1]:50628 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3bcw-00042L-3y for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 21 Jun 2022 07:00:58 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58634) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3bc3-0003hk-1R for bug-gnu-emacs@gnu.org; Tue, 21 Jun 2022 07:00:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37087) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o3bc2-0002A4-N6 for bug-gnu-emacs@gnu.org; Tue, 21 Jun 2022 07:00:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o3bc2-0000bi-Hd for bug-gnu-emacs@gnu.org; Tue, 21 Jun 2022 07:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 21 Jun 2022 11:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51766 X-GNU-PR-Package: emacs Original-Received: via spool by 51766-submit@debbugs.gnu.org id=B51766.16558091722267 (code B ref 51766); Tue, 21 Jun 2022 11:00:02 +0000 Original-Received: (at 51766) by debbugs.gnu.org; 21 Jun 2022 10:59:32 +0000 Original-Received: from localhost ([127.0.0.1]:59217 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o3bbY-0000aU-0q for submit@debbugs.gnu.org; Tue, 21 Jun 2022 06:59:32 -0400 Original-Received: from mail-oa1-f50.google.com ([209.85.160.50]:44801) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o3bbU-0000aH-Vr for 51766@debbugs.gnu.org; Tue, 21 Jun 2022 06:59:30 -0400 Original-Received: by mail-oa1-f50.google.com with SMTP id 586e51a60fabf-101e1a33fe3so7673617fac.11 for <51766@debbugs.gnu.org>; Tue, 21 Jun 2022 03:59:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=Tnbalz+YvwUhGHM93X0ptnFN02Jq2o7pgLG+JvFl6fg=; b=XC+/c78PfOOs0CkCPKLl/rSb4vBeOUXCSCtcZpbRWZiY5zHuWld8kkx3WNfGmzLw87 hokb7OdrqlPXvBSYdwkCqhJX+PEsN2W73WtaF1RSAyZA+xotvg8IM36lub7rpjX1xeiw znw2PJLR1KDUECZ/Wz1AYxOyiXfBolSte+4pZmT0AcmTUzgWQ8USBkv+O/qnycMSx/zP xbWANBR0/SNB2P9sEm/59ehv0WkodRkUVGXhX/a34gCTRCrQ9XB638g9UU8ri1qDw55a WI9yYnKXYHBWkjPUnsZH20gRO9FiKYbKjNsHHe56/GCSocb8Yy+CtM96twzbCz8EJFfs SFdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=Tnbalz+YvwUhGHM93X0ptnFN02Jq2o7pgLG+JvFl6fg=; b=CNjgVRg2gnLaaCjFHx+h9+lO8KAieFtOnMuHDAlSLQwE3Ncpd/A2f5uwNBKg4uNl8g xCVjuwrJuh1QSkEE1taz0p+j2THBz0ZJynOfECA5LKHvaHK7AcW0eiPcdlx7SQBALxF2 UB5uHlc8l7rcLMMJ2XA3S2GTQNKY7u1yYMKlkoIRXlDCTnTO49ZqHltPyzySVNwwj6/3 druhM4vQBu3r8P1WIJaxk3N4BVo/pjYWsj6M14urURkR4pH18ynWGCBVY27G1FeBfRIj VNMk18VHzfnL+ETrsMfny5PTEyNwPNfFlOQc2wo7gOmRjtmMQRJJa7v6GFiiXD+m0HOe SDiA== X-Gm-Message-State: AJIora/TcDw+kyDyAt9dbn+NPlyDdKT1HK1CPnVeBggVm4zdOTnBVTi3 gRWe7H/O59ZOYhpsJwQGnTI= X-Google-Smtp-Source: AGRyM1usSs3gvoIvG19OwDyKkvohzm1IZoWCkpMoAb6F9MBnYDjANRO6WgITXoIjniubZG4gMxnVWg== X-Received: by 2002:a05:6870:6027:b0:101:696e:d594 with SMTP id t39-20020a056870602700b00101696ed594mr19699243oaa.245.1655809163208; Tue, 21 Jun 2022 03:59:23 -0700 (PDT) Original-Received: from localhost ([207.126.88.10]) by smtp.gmail.com with ESMTPSA id u19-20020a056870951300b000f309d52933sm8810144oal.47.2022.06.21.03.59.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jun 2022 03:59:22 -0700 (PDT) In-Reply-To: <83fsjyl3sz.fsf@gnu.org> 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:234940 Archived-At: Eli Zaretskii writes: >> > That discussion is very short and lacking in detail, but up front, why >> > doesn't valign use the primitives we provide for determining the pixel >> > width of a string? >> >> Because string width in different buffers may be different depending on >> the fontification, frame font size, face remapping, >> wrap-prefix/line-prefix string properties (AFAIK, the built-in >> string-pixel-width will return incorrect value on string with such >> properties), invisibility specs in the buffer, line numbers mode, etc >> We have implemented a number of workarounds in org-string-width on main, >> but I am not 100% sure that I covered all the edge cases. > > If you need such high accuracy, may I suggest window-text-pixel-size? window-text-pixel-size suffers from the same issues with wrap-prefix/line-prefix and line numbers mode. Also, in order to use it in current buffer on not-yet-inserted string, you need to insert it. That where the issue in valign originated from. Best, Ihor