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 12:13:09 +0800 Message-ID: <8735fyslgq.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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39791"; 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 06:13:12 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 1o3VGJ-000AC3-OA for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 21 Jun 2022 06:13:11 +0200 Original-Received: from localhost ([::1]:45154 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3VGI-0006bA-Ah for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 21 Jun 2022 00:13:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36584) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3VGB-0006ai-2A for bug-gnu-emacs@gnu.org; Tue, 21 Jun 2022 00:13:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36777) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o3VGA-0007ri-JD for bug-gnu-emacs@gnu.org; Tue, 21 Jun 2022 00:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o3VGA-0004dx-9P for bug-gnu-emacs@gnu.org; Tue, 21 Jun 2022 00:13: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 04:13: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.165578472917788 (code B ref 51766); Tue, 21 Jun 2022 04:13:02 +0000 Original-Received: (at 51766) by debbugs.gnu.org; 21 Jun 2022 04:12:09 +0000 Original-Received: from localhost ([127.0.0.1]:58907 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o3VFJ-0004cq-If for submit@debbugs.gnu.org; Tue, 21 Jun 2022 00:12:09 -0400 Original-Received: from mail-oa1-f54.google.com ([209.85.160.54]:41526) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o3VFE-0004cD-R8 for 51766@debbugs.gnu.org; Tue, 21 Jun 2022 00:12:08 -0400 Original-Received: by mail-oa1-f54.google.com with SMTP id 586e51a60fabf-101bb9275bcso11982073fac.8 for <51766@debbugs.gnu.org>; Mon, 20 Jun 2022 21:12:04 -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=wo3D5qE1+jXahL8rkDSFSahjvyvBEYgWtIhbApX6g60=; b=Mxpdpq3WF88CuMzStcc1j8HBYpN5X20hGoHDbSouDiY7wVxn068JYP+x2OuWPbuLkp wz/5I0uTrb9DImZmhx2jqEM9SkJYQMbzSM6K4/IRcwgeK0ClsKHZ0eaLp7FhZqca323w QmjabftWGTGqSrLN2A8TJs0DFkcQKbZk1GXEFJq5l9bgtNpjW3GeF0pNk162WJX/kOYk Nn0Le67DBaxCPDy6u/50KBqjmAy7ZNX6IHXkgTj4KOuz0UOQgOD4p6qntbuno2zm8byN 8Ux4XFNX/ftlxKS6mcIHTniyb2vms8/jD+KM0Pl+UVt46VSgFYP5dOnrWPKwgfGN1u9h g5kA== 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=wo3D5qE1+jXahL8rkDSFSahjvyvBEYgWtIhbApX6g60=; b=s58OyMj1+HnG5dvV/uvGh5HinjOAwoRkiqCJolBvYTdD9rmqTKwtt8M+2PnyudZ4kj W+7FNSJjnOyCv9nSQnAk7H1HU71S0ohgO98MnbQz4jTaerR0SNqur1xdWfrEbm6C881z +DT2nNZtbTop0vGbyrJFuMlWIey591XoYD7mx3X4LbcE6GekiMWRy6uAoPiYiIog9ZJk 5leUdhxhe6Gjx4XgNwi00dqvdtBUY4ZjMRtzGlDVrUFCndELPqU1Y1Pg1Y+4r6tYgADP T0urWggKwFZL6oL2N57hSUzUkjfmjcoZ4jLeWInyBuVLNd1VKbE4G84Psb6oCLt5SX1Z w7jg== X-Gm-Message-State: AJIora8gkL13Nxa4bh6A9u8HtIugWae5uYVVmfms71X5R0jKmIBF10Lv oX7ay+EAfM6qEvCqbOQPVXQ= X-Google-Smtp-Source: AGRyM1uY+J/6zcprA42znSTwy4PywLHfTaY3t13r/V1ylmlSruEoQKVlEu8KSgyMMpFbMFpYolr0Kg== X-Received: by 2002:a05:6871:5cf:b0:101:cfbb:6b33 with SMTP id v15-20020a05687105cf00b00101cfbb6b33mr6401037oan.198.1655784719230; Mon, 20 Jun 2022 21:11:59 -0700 (PDT) Original-Received: from localhost ([207.126.88.10]) by smtp.gmail.com with ESMTPSA id dv4-20020a056870d88400b00101c83352c6sm5040585oab.34.2022.06.20.21.11.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jun 2022 21:11:58 -0700 (PDT) In-Reply-To: <838rpvpns3.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:234928 Archived-At: Eli Zaretskii writes: >> valign relies on disabling modification hooks because it is otherwise >> difficult to figure out pixel width of a string in current buffer: >> https://github.com/casouri/valign/issues/30 > > 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. The most accurate way to measure the real string width inside current buffer is actually inserting it and requesting the measurement. Best, Ihor