From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.bugs Subject: bug#64420: string-width of =?UTF-8?Q?=E2=80=A6?= is 2 in CJK environments Date: Sat, 12 Aug 2023 13:18:03 -0700 Message-ID: <658CA307-6A56-42A9-B964-C9CD9220A56E@gmail.com> References: <83jzuz93rh.fsf@gnu.org> <837cq9sfcc.fsf@gnu.org> <83wmy2gm5h.fsf@gnu.org> <4B239A5E-0878-4304-8C28-FEEC1EBC1B4E@gmail.com> <83v8dlfmt6.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28707"; mail-complaints-to="usenet@ciao.gmane.io" Cc: SUNG TAE KIM , Dmitry Gutov , 64420@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 12 22:19:28 2023 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 1qUv55-0007GQ-FZ for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 12 Aug 2023 22:19:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qUv4i-0008Ct-8p; Sat, 12 Aug 2023 16:19:04 -0400 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 1qUv4g-0008Cf-MA for bug-gnu-emacs@gnu.org; Sat, 12 Aug 2023 16:19:02 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qUv4g-0005iZ-E9 for bug-gnu-emacs@gnu.org; Sat, 12 Aug 2023 16:19:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qUv4g-00022O-9S for bug-gnu-emacs@gnu.org; Sat, 12 Aug 2023 16:19:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 12 Aug 2023 20:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64420 X-GNU-PR-Package: emacs Original-Received: via spool by 64420-submit@debbugs.gnu.org id=B64420.16918715037781 (code B ref 64420); Sat, 12 Aug 2023 20:19:02 +0000 Original-Received: (at 64420) by debbugs.gnu.org; 12 Aug 2023 20:18:23 +0000 Original-Received: from localhost ([127.0.0.1]:57525 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qUv43-00021R-Cj for submit@debbugs.gnu.org; Sat, 12 Aug 2023 16:18:23 -0400 Original-Received: from mail-pf1-x42c.google.com ([2607:f8b0:4864:20::42c]:61861) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qUv41-00021D-0i for 64420@debbugs.gnu.org; Sat, 12 Aug 2023 16:18:21 -0400 Original-Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-68783b2e40bso2210725b3a.3 for <64420@debbugs.gnu.org>; Sat, 12 Aug 2023 13:18:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691871495; x=1692476295; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=3Ds1t+7lGewGqI21UCraHJxfGMCJ+zlytOlWYPin1Xc=; b=oV5uA/CTT3GqyCdI2TeqxQy30AQ3HZJc45V0JW18rw+kwQCKobmc+lqldYqUMU7VXy vl8tuzKr7qmR3F8ApdJTdw7upRyajSxpJTrGHdhW8AlxE3BRaZgYzhqAKfkP+9n155jw yvXIxcdS20s3athw2YfbyEZD+t1+acqBilP/3DTPC/7K0rXqKkoZJrYYo4aPaFr6gIm9 /2eLfhgLycnzFN5Y54bTu9bTuh4K+GtO1bYaQ60kiyy+U3fGHGz8NwQCwVSgDl0vsX3q zbjmTADxzvRtWCpIXamxQMDrIpcd7Xk8v6aWJrziDNzYz6tz9OdReqRkkFXZ/O6ybGLb arXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691871495; x=1692476295; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3Ds1t+7lGewGqI21UCraHJxfGMCJ+zlytOlWYPin1Xc=; b=MAJJ0wRIgq1GDoLxofKuPHdqcKX7JnGgZvWISnHr5yqrXVixYkGWCTGIj6rK4t+fyr YMTRHD8KUq8INtoQnq2NP6D1eEPzS5nxQcL/9YeNOtzyKa0z5yV+Y+lgyn1/PTJ3R3/y MpAaIuxUdfpwH+T6AZ5HEJS3gncKGSTbgbInJcnmQQen+t95WWVQum2+1TrcJWISnsiu JJUdJmk9Ucf8J+iDTJ8LLU+7OoK+ujR6nz+wL8/vHSYPAIgHts5t+xRn3eCBw/erBuKF yQVF5xJkuwIyZd13yGJ2UbRS2xXcHOeMzmcb6V2K2wPF4cgUellvfnzPdCucL6dMOIMC BmWg== X-Gm-Message-State: AOJu0Yy8zsr+/lZs7QsLkJ/dRUy/lkOwJ1V6rXLuxvbJF9tytZrw2uAd Rm69+AVJx0p4xtulXX21C4Q= X-Google-Smtp-Source: AGHT+IFYW81cciJUAEXz9dJwwCM3LAaPGLGwWhfeaBjd2wnSHLkG/R6/3Nql9AbqYF3GmR04dzSwQg== X-Received: by 2002:a17:902:ea0c:b0:1b2:1b22:196 with SMTP id s12-20020a170902ea0c00b001b21b220196mr5909200plg.48.1691871494965; Sat, 12 Aug 2023 13:18:14 -0700 (PDT) Original-Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id p4-20020a170902a40400b001bc675068e2sm6252600plq.111.2023.08.12.13.18.14 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 12 Aug 2023 13:18:14 -0700 (PDT) In-Reply-To: <83v8dlfmt6.fsf@gnu.org> X-Mailer: Apple Mail (2.3731.600.7) 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:267332 Archived-At: > On Aug 11, 2023, at 11:36 AM, Eli Zaretskii wrote: >=20 >> From: Yuan Fu >> Date: Fri, 11 Aug 2023 11:07:26 -0700 >> Cc: dmitry@gutov.dev, >> itaemu@gmail.com, >> 64420@debbugs.gnu.org >>=20 >> On terminal, I saw an interesting option, =E2=80=9CAmbiguous = characters are double-width=E2=80=9D (terminal-setting.png), which is = the same as cjk-ambiguous-chars-are-wide. If I turn it on all the = ambiguous characters are indeed displayed in double-width. = (terminal-narrow.png, terminal-wide.png) >=20 > And in that case, you need to set cjk-ambiguous-chars-are-wide non-nil > to have Emacs display those characters correctly? Or does that option > have no effect on the correctness of the |Emacs display on that > terminal? The value of cjk-ambiguous-chars-are-wide has no effect on the display = of those characters in the terminal, at least in the terminal I use = (iTerm2). Only the terminal option has an effect. The screenshot I took are actually from cat, not Emacs. I tried with = Emacs and found out that the terminal and Emacs must agree on the width = of those characters, otherwise the cursor movement is broken (perhaps = that=E2=80=99s not surprising to you). The cursor movement works if = either a) I turn on "Ambiguous characters are double-width=E2=80=9D in = the terminal and (set-language-environment "Chinese-BIG5=E2=80=9D) in = Emacs, or b) I turn off "Ambiguous characters are double-width=E2=80=9D = (which is off by default) and use default locale (utf8_enUS). >=20 >> On GUI display, the later-half of the ambiguous characters are = definitely wider than one char, but they aren=E2=80=99t quite 2 chars = wide either. But I guess it doesn=E2=80=99t matter too much since one = should use pixel size on GUI anyway. >=20 > Is the actual width closer to 1 or to 2? >=20 I=E2=80=99d say 2. Yuan