From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id ICROCUvPjmAiJwEAgWs5BA (envelope-from ) for ; Sun, 02 May 2021 18:11:55 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 0F/9BEvPjmCLOAAAB5/wlQ (envelope-from ) for ; Sun, 02 May 2021 16:11:55 +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 B1B0D2758A for ; Sun, 2 May 2021 18:11:54 +0200 (CEST) Received: from localhost ([::1]:59724 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ldEhF-00071d-Ow for larch@yhetil.org; Sun, 02 May 2021 12:11:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34840) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldEfT-0006g0-Vl; Sun, 02 May 2021 12:10:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:60191) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ldEfT-0004XC-Lf; Sun, 02 May 2021 12:10:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ldEfT-0004TR-H2; Sun, 02 May 2021 12:10:03 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#48149: 27.2; Wrong underline width when the line char has a width of 2 Resent-From: Nicolas Goaziou Original-Sender: "Debbugs-submit" Resent-CC: emacs-orgmode@gnu.org, bug-gnu-emacs@gnu.org Resent-Date: Sun, 02 May 2021 16:10:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48149 X-GNU-PR-Package: org-mode,emacs X-GNU-PR-Keywords: To: Shingo Tanaka Received: via spool by 48149-submit@debbugs.gnu.org id=B48149.161997174517135 (code B ref 48149); Sun, 02 May 2021 16:10:03 +0000 Received: (at 48149) by debbugs.gnu.org; 2 May 2021 16:09:05 +0000 Received: from localhost ([127.0.0.1]:43491 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldEeU-0004S6-4h for submit@debbugs.gnu.org; Sun, 02 May 2021 12:09:05 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:46247) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldEeQ-0004Rs-Je for 48149@debbugs.gnu.org; Sun, 02 May 2021 12:09:01 -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 relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 7277F1C0007; Sun, 2 May 2021 16:08:51 +0000 (UTC) From: Nicolas Goaziou References: <87fsz62b1w.wl-shingo.fg8@gmail.com> Date: Sun, 02 May 2021 18:08:50 +0200 In-Reply-To: <87fsz62b1w.wl-shingo.fg8@gmail.com> (Shingo Tanaka's message of "Sun, 02 May 2021 10:12:43 +0900") Message-ID: <87a6pd86el.fsf@nicolasgoaziou.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: 48149@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=1619971914; 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: content-transfer-encoding:content-transfer-encoding:resent-cc: 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=LNlGEGRUd3qPVMemQLIFhFdbKCRNVDhsjY0uEOmBUog=; b=XP+LTSwEnPvfMFjlBxcGyAyG3p1tIDUMZSuIYUJIsEchpViaS5eTVUe9X57gknm21LZZXP d6w92I2t76pT4F0ytxD4bFjbYtRr5Ge51KwOSGXVM4eOhtM+HLDtpVTucsGNjPWuDB6MDC 3xO+PWu2PPVgIvrjHaNyWhD+4H2MNs1sCaDllP/aCl4lQMBfywwdm2e6rWQddZPz/Hwj7x cZWUqF/Yzx9fUXk1a9Ys70E8DTTJjENIJgLUs8pCJg0FdRbwVYAw9cpe7lsCuTiApgxS+a P/E7psr63KL4Cu+/UXzkfwv6uiBvfdJ1uBG06uMDlMB/JvfihWfKe7VBGxDZzw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1619971914; a=rsa-sha256; cv=none; b=XRmZ9r8iNMMN7FO9iOSg3RgpKbeLmczKzgfp6YJ8S2ojZ3vYBN7EymthMq3zA7bC1CqFUo yLWhivGJNnIGrcqvUz8Fu067ofgzPSv7vGuA5GyK5aHYNUA1/sdOtTZmHUu5TiZgSLENyc Leb6IfOepG4q+TxuHEq1e+eUax9PlV7azWlqv4iqb4tjoiULaXMtKGsiTZcHmw6MI7JKu8 qEjrV81ez00klesai+wixQLGiB+aRctC6UwXK2YOsDS1MmEc5ofTSuY+mc6x8QS2DA9UB0 Tc5+H7v85lRXwyvddG2m6/bhEjfYiigMhNthZ6ip3fmT5raoRuHwsHXcLxStpQ== 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: B1B0D2758A X-Spam-Score: -0.96 X-Migadu-Scanner: scn0.migadu.com X-TUID: q5TC2xZDUFHf Hello, Shingo Tanaka writes: > When exporting org-mode document to plain text (either ascii/unicode/utf-= 8) > with `org-export-dispatch', Emacs inserts lines under headlines, inline > tasks, table rows and titles of the document, TOC, list of listings, list= of > tables and footnotes. The problem is it inserts too long (double width) = line > when the line character has a width of 2. > > Those lines are made of 3 types of characters below (in ox-ascii.el): > 1) org-ascii-underline > 2) (if (eq (plist-get info :ascii-charset) 'utf-8) ?=E2=94=80 ?_) > 3) (if utf8p ?=E2=94=81 ?_) > > In case of 1), it correctly takes account of the case in which the charac= ter > has a width of 2 in `org-ascii--build-title', by dividing the line width = by > `(char-width under-char)' (line 700-701), maybe because the character is = user > configurable and its width in unknown. However, in case of 2) and > 3), maybe because the characters is embedded in the code, it looks like o= nly > considering the character always has a width of 1. But the reality is > character ?=E2=94=80 or ?=E2=94=81 can have a width of 2 in the screen di= splayed with some > fonts (ex. "Noto Sans Mono CJK JP"), and in that case the line width gets > doubled of the expected width. > > Attached one is a potential patch. The basic concepts are: > > a) Do the same in case of 2) and 3) as in case of 1) > (dividing the line width by `(char-width under-char)', > assuming `char-width-table' is correctly set) >=20=20=20=20=20 > b) Prefer the longer line width if the width is odd, even in case of 1) > (adding `(1- (char-width under-char))' to dividend, > just because it should be more beautiful ;-) ) Thank you. This looks good. I cannot apply it on "maint" branch, however. Also, a proper commit message would be nice. Could you send an updated patch? Moreover, have you signed FSF papers already? This is above limit for tiny changes. Regards, --=20 Nicolas Goaziou