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.help Subject: Re: Enclosing text in a box Date: Wed, 16 Nov 2022 22:00:51 +0200 Message-ID: <8335aifz4c.fsf@gnu.org> References: <_AODCZ2cNjiSAkIvdrGzDgeSNSWqJoJ9xfXn-zFenyY-yTUYx-Ijx0k4-Lq46rN4CjdkyIrzIBD1h4YY23BAP089R0Tg0kzM9MOUnaEOFrs=@protonmail.com> <835yffgfwp.fsf@gnu.org> <83y1sbez2r.fsf@gnu.org> <83sfiig87w.fsf@gnu.org> <83k03ug0zr.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31066"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 16 21:01:23 2022 Return-path: Envelope-to: geh-help-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 1ovOb5-0007ss-2F for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 16 Nov 2022 21:01:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ovOaf-0000YS-T0; Wed, 16 Nov 2022 15:00:58 -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 1ovOae-0000Wf-8F for help-gnu-emacs@gnu.org; Wed, 16 Nov 2022 15:00:56 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ovOad-0003DV-Vi for help-gnu-emacs@gnu.org; Wed, 16 Nov 2022 15:00:55 -0500 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=G3vvS+rCdT9cHIRXg6HMg2MrVbnxGQoL//nAsACRogA=; b=hYsnVmXQ8VK3 BvoxPxBJR8p51EBSZco28v9bvBj2pX4Xlh/FuFugaAn2eFSOyq24QVMZDTwd3U/w+UD6Iw4GZ83Pi FJWT7euWSrswm1vjHOURJAwbSakHZXFE1yZfni6AUz5pl6K9n0/SkhRWKG1ZDmw6FwsFYDJIKNbw0 MQ6zNaM0QatPiIe2tBaVN8KXn6Hu2EuuSvD1RuGxoUBM8yXgb7ppRzBJjhBOI/VVU6cR3llekxNgo P1xtzyrT7Um7uQ0rF8aHNMwDC8RVX+FdmCQrzrY4vqRDfha56M/UKbMxHZ442tPyz2A3bZaR8VKQ0 3r00RFrHy3pVjKAGcm9DFQ==; Original-Received: from [87.69.77.57] (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 1ovOac-0000t3-Ar for help-gnu-emacs@gnu.org; Wed, 16 Nov 2022 15:00:55 -0500 In-Reply-To: (message from Heime on Wed, 16 Nov 2022 19:35:17 +0000) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:141016 Archived-At: > Date: Wed, 16 Nov 2022 19:35:17 +0000 > From: Heime > Cc: help-gnu-emacs@gnu.org > > > Any character can pose such problems. It depends on the font you are > > using. > > So what are people to do? I already advised what to do, in my original message in this thread. > Basically it means that we cannot rely on "length" and > "string-width". No, it means don't use 'length' (because its purpose is not to measure the display width). You _can_ use 'string-width', it will do a good job in almost all cases. If you need 110% solution, use 'string-pixel-width'. > Then the function are there for nothing. How do you get to such extreme conclusions without even trying what you were advised to do? > Asking users to handle such conditions would be too hard to do > repeatedly. This is not userland, this is Emacs Lisp programming for display, and yes, it is quite tricky if you want rock-solid solutions that work with arbitrary characters and fonts.