From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id SA7iJgDMjmAlIwEAgWs5BA (envelope-from ) for ; Sun, 02 May 2021 17:57:52 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id GP6AIgDMjmAGLQAAB5/wlQ (envelope-from ) for ; Sun, 02 May 2021 15:57:52 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id DF518120C4 for ; Sun, 2 May 2021 17:57:51 +0200 (CEST) Received: from localhost ([::1]:42378 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldETe-0007Ci-7P for larch@yhetil.org; Sun, 02 May 2021 11:57:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:33128) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldESs-0007CV-Nk for emacs-orgmode@gnu.org; Sun, 02 May 2021 11:57:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:60125) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ldESs-0007Z5-Fq for emacs-orgmode@gnu.org; Sun, 02 May 2021 11:57:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ldESs-0004Ku-EV for emacs-orgmode@gnu.org; Sun, 02 May 2021 11:57:02 -0400 Subject: bug#48148: 27.2; ox-ascii breaks TITLE line wrongly when 2 width char is used Resent-From: Nicolas Goaziou Original-Sender: "Debbugs-submit" Resent-To: emacs-orgmode@gnu.org Resent-Date: Sun, 02 May 2021 15:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 48148 X-GNU-PR-Package: org-mode X-GNU-PR-Keywords: To: Eli Zaretskii Mail-Followup-To: 48148@debbugs.gnu.org, mail@nicolasgoaziou.fr, shingo.fg8@gmail.com Received: via spool by 48148-done@debbugs.gnu.org id=D48148.161997097416655 (code D ref 48148); Sun, 02 May 2021 15:57:02 +0000 Received: (at 48148-done) by debbugs.gnu.org; 2 May 2021 15:56:14 +0000 Received: from localhost ([127.0.0.1]:43434 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldES6-0004KZ-IY for submit@debbugs.gnu.org; Sun, 02 May 2021 11:56:14 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:58271) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldES4-0004KT-Mw for 48148-done@debbugs.gnu.org; Sun, 02 May 2021 11:56:13 -0400 X-Originating-IP: 185.131.40.67 Received: from localhost (40-67.ipv4.commingeshautdebit.fr [185.131.40.67]) (Authenticated sender: admin@nicolasgoaziou.fr) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 8D72A60006; Sun, 2 May 2021 15:56:05 +0000 (UTC) From: Nicolas Goaziou References: <87h7jm2es2.wl-shingo.fg8@gmail.com> <83bl9t8vnb.fsf@gnu.org> <87h7jla6ih.fsf@nicolasgoaziou.fr> <8335v58ppu.fsf@gnu.org> <871rap9vn3.fsf@nicolasgoaziou.fr> <83tunl714h.fsf@gnu.org> Date: Sun, 02 May 2021 17:56:04 +0200 In-Reply-To: <83tunl714h.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 02 May 2021 15:48:14 +0300") Message-ID: <87eeep86zv.fsf@nicolasgoaziou.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: emacs-orgmode@gnu.org List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: shingo.fg8@gmail.com, 48148-done@debbugs.gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1619971072; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-to:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post; bh=dIWn3S+k9k2M4lMslLuTbGylfWviPv4pxtD+yRC9Azk=; b=VvLc5caJkVt3jBtXVi1TGmza6N3+Ul8MVGXpLajvXlHEAm0g2G0k8AJbWGFMxaxLyNYWqE feQj5f/z1hTFVHpkwuD/zMvHa6dYdt+FoFH7p69M3bFP/QA6L9JfpNFaxbpEgxfMbVtbZS 1vMzLCnt3NuUSeNiCnd6dxn67l5fV7j194XuoLXp8N9SykonWvcmbbY3POYmI9V+ASeCB5 cRoCYhRCtO69WW1s7fovkXM+dNsx3bAGVk6pGsFwa8Od08PQMuCujpy6eJGRro6qcAkfHG 9KpeY1gex2K4WwEPHWe3JHKOnDL9fUyBYZo11usxj4UY+RQlujhWggqGPSA/nA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1619971072; a=rsa-sha256; cv=none; b=q8wp2SkvYawU+SZkV+TObxVnEFmEL1+Qzjasotl3frd8UCH4KbBVer1sKDloKfrrcn+Y8Q 4MzivHubfHrY90yk7yLw9RVlBmoS2IeA2HjHqDbfy6xno5y++I/BJJ/dN9Tes3hfNZlrze gQzJ0cTawjkbZrJ5qIqonXZ5UColM/4LRN7P+/h0jJQjomSY7AzERHTDzWOPhzdcdHXwF1 PLgu8UbnmjaZfOIo/UfvT61W57rCu4XxL66lacsmq/qx5vjK1jI2xNwBovdY1QHk9Yembk WQ0J7ZpR5AeKTfCsMtTX7bMpUWiOYaHUD5NrVGTUtB6829Be+3agp/ZrAeb9/Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -0.96 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: DF518120C4 X-Spam-Score: -0.96 X-Migadu-Scanner: scn0.migadu.com X-TUID: VQmIFBhHaoS6 Eli Zaretskii writes: >> From: Nicolas Goaziou >> Cc: shingo.fg8@gmail.com, 48148@debbugs.gnu.org >> Date: Sun, 02 May 2021 14:18:24 +0200 >> >> My problem is that I have some string, _which is not displayed anywhere_ >> yet. I need to obtain its real width along with the width of a single >> character in order to compute the length argument in `make-string'. > > The width of any text on display is meaningless unless you also tell > in what window will it be displayed. That's because some of the > factors that affect the display width depend on the window and the > buffer shown by that window. I understand. More than the width of the text, I'm interested in the ratio between the width of the text and the width of an underline character (assuming monospace). > So assuming the string you have will eventually be displayed in some > window -- and most strings in Emacs are of that kind -- you should use > that window up front. Otherwise, the value you get from other methods > can only be an approximation, which will sometimes be close, and > sometimes quite far from the truth. The string may not be displayed at all. Since it is the output of an export process, it could, e.g., be written to a file. I applied Shingo Tanaka's suggestion using `string-width', which is the best we can do considering our requirements. Thank you for your answer, and to Shingo Tanaka for the report an the patch. Regards,