From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Anand Tamariya Newsgroups: gmane.emacs.devel Subject: Re: Unicode combining characters Date: Thu, 27 May 2021 18:57:58 +0530 Message-ID: References: <83k0nmbubk.fsf@gnu.org> <83v975ac4s.fsf@gnu.org> <83lf81a04l.fsf@gnu.org> <83y2c08qg2.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000ec6eed05c34fba25" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37509"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu May 27 15:36:50 2021 Return-path: Envelope-to: ged-emacs-devel@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 1lmGBu-0009df-2j for ged-emacs-devel@m.gmane-mx.org; Thu, 27 May 2021 15:36:50 +0200 Original-Received: from localhost ([::1]:56976 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lmGBs-0006xv-Uj for ged-emacs-devel@m.gmane-mx.org; Thu, 27 May 2021 09:36:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46010) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lmG3c-0006Uc-Nl for emacs-devel@gnu.org; Thu, 27 May 2021 09:28:16 -0400 Original-Received: from mail-io1-xd34.google.com ([2607:f8b0:4864:20::d34]:42691) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lmG3X-0005sp-6v; Thu, 27 May 2021 09:28:16 -0400 Original-Received: by mail-io1-xd34.google.com with SMTP id k22so424640ioa.9; Thu, 27 May 2021 06:28:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gKDPIVYT/Rc5HshEGNllgJl1KcJ1K04uDFeTAEc6m+c=; b=NjW05l5MVknItKq0t+AMI8xyqGN7p+nUaMBsquPFA7LeBTGDY3GCr7hGmOOL8E7Hbl olynM0mAzK/lw9H+euiAgzrINkfVaO5SxGGJrEWGnBcdSL98rDZTxoW04bxBmOKkMKIr A7KiVioOSo8Y53qcsJRHTvKZf4gdHrT3Tkd0MGbO5Q6rQJg8Zr2FRm1j+TMdC1hOcG/i WL+PxcJWdmPAFeZKMyJjPFb98ibGUF4P7M1CWCp08ORZcV8mb4av1xmFTzcwHY0xl0B5 cDXPIXGQrbwEhhwiRuxrWA/vmNimWt6lv+GXwpq0m95+gDgPzNQNeqBZKkGZGnJIo04T oEYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gKDPIVYT/Rc5HshEGNllgJl1KcJ1K04uDFeTAEc6m+c=; b=h3SGnUFGtlstNl/UIpnxEmEsChJNBY2Px43vqkpyXHGUN3nC0ogKMColHJUP5uZPOb SHapoOvbeiK96H6VesigJNMnlefttwaxuctp82UMC6mGbTiEdHJG//kL9yxWFoy9LQKF GH0NnHl2z2Cx7r2O/ObA4s4UhqjWH0UpEtLLF9tKoZVd0KRrbnbSnY6qw+nJ7LZ2M364 4f7kjjzhX8pIgjo/LUm5BAx9kbJA24f3MALxC5g0bZSggtc2Qqk9HXtrzW+8iO222Nsy oPMoU1HZsN9VLvs5D0kdeg1FinVr5CKfEtGegpPGpdA/dXv9icFlKbMcAGqBppa+ERGb akaA== X-Gm-Message-State: AOAM533BhuKnoCgDZee88htlBQ7prPRgaC2AAum3uV7eoZuVuNMVSgnT l1I0IpxEon4S0BDA+OUVapgKna91soDo9SkbjFOVhPwH X-Google-Smtp-Source: ABdhPJyku3Be/XEL1HaY7SN1JmOHVAXM9TIk5kdd117q+QvsvED/4sZGqKSkxAlt2kuJ+q78JRLaUmHNVRKaz4ll0fQ= X-Received: by 2002:a02:ba08:: with SMTP id z8mr3601610jan.74.1622122089441; Thu, 27 May 2021 06:28:09 -0700 (PDT) In-Reply-To: <83y2c08qg2.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::d34; envelope-from=atamariya@gmail.com; helo=mail-io1-xd34.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:269944 Archived-At: --000000000000ec6eed05c34fba25 Content-Type: text/plain; charset="UTF-8" > > The fix works for the given example. However, here's another one that > ideally should be one composed glyph > > (validated by moving the cursor over the glyph) but counts as 2 in > string-width. > > > > (setq ra (string 2352 2366)) > > > > (string-width ra) ; 2 > > OK, I improved this case now on master, please take a look. > > Wonderful!! It works. Thanks. Do you think (current-column) should also return a value conforming to the display logic? e.g. if 'ra' above is the first character in the line and point next to it, should it report 1 or 2? --000000000000ec6eed05c34fba25 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

> The fix works for the given example. However, here's another one t= hat ideally should be one composed glyph
> (validated by moving the cursor over the glyph) but counts as 2 in str= ing-width.
>
> (setq ra (string 2352 2366))
>
> (string-width ra) ; 2

OK, I improved this case now on master, please take a look.

Wonderful!! It works. Thanks.
Do you th= ink (current-column) should also return a value conforming to the display l= ogic? e.g. if 'ra' above is the first character in the line and poi= nt next to it, should it report 1 or 2?

--000000000000ec6eed05c34fba25--