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 15:17:22 +0300 Message-ID: <834k0eky7h.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> <83fsjyl3sz.fsf@gnu.org> <87r13iqo19.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19196"; 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 14:18: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 1o3cpg-0004hz-7x for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 21 Jun 2022 14:18:12 +0200 Original-Received: from localhost ([::1]:49870 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3cpf-00056B-46 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 21 Jun 2022 08:18:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46924) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3cpW-00053g-Tt for bug-gnu-emacs@gnu.org; Tue, 21 Jun 2022 08:18:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37228) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o3cpW-0007Lm-KS for bug-gnu-emacs@gnu.org; Tue, 21 Jun 2022 08:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o3cpW-0005Ez-Gk for bug-gnu-emacs@gnu.org; Tue, 21 Jun 2022 08:18: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 12:18: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.165581386420120 (code B ref 51766); Tue, 21 Jun 2022 12:18:02 +0000 Original-Received: (at 51766) by debbugs.gnu.org; 21 Jun 2022 12:17:44 +0000 Original-Received: from localhost ([127.0.0.1]:59358 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o3cpE-0005EQ-Eo for submit@debbugs.gnu.org; Tue, 21 Jun 2022 08:17:44 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:33722) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o3cpB-0005Dz-1D for 51766@debbugs.gnu.org; Tue, 21 Jun 2022 08:17:41 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:43502) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3cp5-0007Jd-Km; Tue, 21 Jun 2022 08:17:35 -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=PQr1EyjUvT39AMqJ+K7NE+Lzh5YSL7XPSnpxahrcB5E=; b=cmam8QVjqYxd nIzLioKItLe+578Zt9sjIrDQ3CanD7C3XbEJrL5EbIiuFwzGHGT5Cs1dE8g8vVY6g/oFBRRIsobtj PdUm596H5Uizq7rdX41LMdnvmOfo2quLLhw8FZo9E4f52N64TqYwEjRZ0E21IgmXrnX1vSrN6RzQi vE22sITRwBMV5eqD3ApASJZGPdgljOR5VyA9jKHDjZV3XXZVBjbbntiNfdgevNzusW1vwPAvl8QJO 1I32VqU89TnAeEqxALGmoiN/xqbyHwBniDIi1qWFijOh289X05UEaxnNFGK1mcXP19t0l8eBmL08S kUiqLRCF8HjyyUORunrPZw==; Original-Received: from [87.69.77.57] (port=4549 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 1o3cp4-0004h4-BZ; Tue, 21 Jun 2022 08:17:35 -0400 In-Reply-To: <87r13iqo19.fsf@localhost> (message from Ihor Radchenko on Tue, 21 Jun 2022 19:00:34 +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:234952 Archived-At: > From: Ihor Radchenko > Cc: monnier@iro.umontreal.ca, 51766@debbugs.gnu.org > Date: Tue, 21 Jun 2022 19:00:34 +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? > > window-text-pixel-size suffers from the same issues with > wrap-prefix/line-prefix and line numbers mode. What issue are those? > 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. The usual method is to use a temporary buffer.