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#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 13:16:28 +0300 Message-ID: <83fsjyl3sz.fsf@gnu.org> 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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16863"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 51766@debbugs.gnu.org, monnier@iro.umontreal.ca To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 21 12:19:15 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 1o3ayY-00049N-ME for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 21 Jun 2022 12:19:14 +0200 Original-Received: from localhost ([::1]:51678 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3ayX-0006ae-Mp for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 21 Jun 2022 06:19:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49682) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3awQ-0004aD-SC for bug-gnu-emacs@gnu.org; Tue, 21 Jun 2022 06:17:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37042) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o3awQ-0003wk-JA for bug-gnu-emacs@gnu.org; Tue, 21 Jun 2022 06:17:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o3awQ-0005a4-EB for bug-gnu-emacs@gnu.org; Tue, 21 Jun 2022 06:17:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 21 Jun 2022 10:17: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.165580660821404 (code B ref 51766); Tue, 21 Jun 2022 10:17:02 +0000 Original-Received: (at 51766) by debbugs.gnu.org; 21 Jun 2022 10:16:48 +0000 Original-Received: from localhost ([127.0.0.1]:59168 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o3awB-0005ZA-PX for submit@debbugs.gnu.org; Tue, 21 Jun 2022 06:16:47 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:36428) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o3awA-0005Yv-4g for 51766@debbugs.gnu.org; Tue, 21 Jun 2022 06:16:46 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:41754) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3aw4-0003ou-Sb; Tue, 21 Jun 2022 06:16:40 -0400 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=yi/Q040Csa1NWShCO7tb04zJLrd2iKgEkJ7yYGOcFMo=; b=kJxXZaSeDaC6 rCu8/woGi1uj5AMZ/mPsDSdQou1GYdURO2UijNFB2xIRmmjJgxKSZtF+fcX8JcHF4RKplhdXLtzgs 07HaUIy8iae5sofDVWLfkjWyH+vsA/+Hy1hSQkwnUAymTuXJRQNB222y2rHJri3Gtrc6rMxOY1C19 Wvj01qsCx8q44eymsWBF3Phb3KG/S2aTR6KbGDS0fXxxUJWXKi+pXRefjSMXHJyAimrUlnGPX2zye qwz/cec3d1RNJfBC/ZlDIcaVmny0bkyiYBSUmVGMJUq1BUD1n4qmPiWdwvspseZkreY5jIo4WzG/9 ZVpOomNh5djNcJpsDa69cA==; Original-Received: from [87.69.77.57] (port=1101 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 1o3aw4-0005xC-3m; Tue, 21 Jun 2022 06:16:40 -0400 In-Reply-To: <8735fyslgq.fsf@localhost> (message from Ihor Radchenko on Tue, 21 Jun 2022 12:13:09 +0800) 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:234934 Archived-At: > From: Ihor Radchenko > Cc: monnier@iro.umontreal.ca, 51766@debbugs.gnu.org > Date: Tue, 21 Jun 2022 12:13:09 +0800 > > 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?