From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?utf-8?B?xaB0xJtww6FuIE7Em21lYw==?= Newsgroups: gmane.emacs.devel Subject: Re: master 188bd80: gnus-shorten-url: Improve and avoid args-out-of-range error Date: Tue, 14 Apr 2020 14:24:28 +0200 Message-ID: <878siy9rwj.fsf@gmail.com> References: <20200413102415.23314.52412@vcs0.savannah.gnu.org> <20200413102417.445E520D0C@vcs0.savannah.gnu.org> <87k12ia05d.fsf@gmail.com> <83blnui8n8.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="52319"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Kenichi Handa , monnier@iro.umontreal.ca, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Apr 14 14:24:51 2020 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 1jOKcS-000DTV-VR for ged-emacs-devel@m.gmane-mx.org; Tue, 14 Apr 2020 14:24:49 +0200 Original-Received: from localhost ([::1]:59572 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jOKcS-0000ER-0v for ged-emacs-devel@m.gmane-mx.org; Tue, 14 Apr 2020 08:24:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60925) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jOKbf-0007nD-4U for emacs-devel@gnu.org; Tue, 14 Apr 2020 08:24:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jOKbe-0004BD-2o for emacs-devel@gnu.org; Tue, 14 Apr 2020 08:23:59 -0400 Original-Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]:43896) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1jOKba-000467-31; Tue, 14 Apr 2020 08:23:54 -0400 Original-Received: by mail-wr1-x444.google.com with SMTP id i10so14066346wrv.10; Tue, 14 Apr 2020 05:23:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version:content-transfer-encoding; bh=RUyKE8x2xZOm/7SnAdGjN/bEeC/qkMYH9pOIpk/Ra+Y=; b=BpbLd7sQKqzU0DPIvcl7yzGQl8j10TRYZv0C8gcstxNysDzEHhkSjRnV1zd7zV7wiY gv8OCcnW7jzjZInn0TC0PNLKdfMciyiGGxgyAXKo/lf4gN8ZUw+vJmqcrvUoNR4H571Q mJKqR+Yo2Ay15l52aq5qYcCtS2UNDnWm/4egEMBTpAcaX/+ROG4yxL1iE1xzK0Xn1HuY ukblER6glVfcB6VRLaEP2HPkxXNeGsVTqHLx+EJRCTwkq7MX1NjH9csw9IOFooMF02CW FkvnJVcfWAYmckTTCmrazNiX0udHS61yuSlaemXaolSjNgvP7V1kEKk8NLiH1D1yXQQz IXTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version:content-transfer-encoding; bh=RUyKE8x2xZOm/7SnAdGjN/bEeC/qkMYH9pOIpk/Ra+Y=; b=T5a3fELhSjnkXLF9sLqloEYIMiBIb70H71NFaBVGMtHLCv+PShmLQ3rIBjLjW+dviJ 3hyFdCs5eHHBhHFuZWEi4yEz7cM3hBgltfnZKusAH2Z6FwpuEjY4y4JRCvicB0px5c+h xVlGcnocRPzeQGKw7h1m+mky0Zw7G32rwuQFakdwizaUEg3oMNdYBKVppqiANzBsJoc9 kxn9SLGxzn550in7Jbh5oRnIoEiukBDwDabPW9Tr5sCdB5XtsykQp3uNHSEVb5bmKWYZ 6K0jUKOlq7LffTLot0SYlmRZcoTz8DaPKNK/W36fYr3Wna8awnsZWFaEZJ04nP8urO+/ uIXQ== X-Gm-Message-State: AGi0PuYKJMasDwn52x5AO1WjfxKHZxDbTsWBTHuMj7RAU3VGAKdTKX63 hFFgD2tgXEoiyTylAeF7jHb5OjWq X-Google-Smtp-Source: APiQypI/ReS0V7+fufHyb5T7YhM9GT2gbnILJCO/Qi8ibn7nSiSlH5h2TdCFAIE5I+W5TYI0FYanAA== X-Received: by 2002:adf:dbce:: with SMTP id e14mr22189832wrj.337.1586867031798; Tue, 14 Apr 2020 05:23:51 -0700 (PDT) Original-Received: from localhost ([185.112.167.47]) by smtp.gmail.com with ESMTPSA id h6sm18957632wmf.31.2020.04.14.05.23.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Apr 2020 05:23:51 -0700 (PDT) In-Reply-To: <83blnui8n8.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 14 Apr 2020 14:55:39 +0300") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::444 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:246939 Archived-At: On Tue, 14 Apr 2020 14:55:39 +0300 Eli Zaretskii wrote: >> E.g. with the default Chinese font emacs -Q uses on my system, I get >> roughly 8.5 "columns" per 5 Chinese characters, not 10 as claimed by >> `string-width'. > > AFAIK, string-width is exact only on TTY frames. Interesting, thanks. Given that I remember the issue (for graphical frames) being discussed multiple times in the past, asking whether making it work by default on those as well would be too hard, is probably pointless? > See the definition of the Chinese-GBK language, it calls > use-cjk-char-width-table that sets up the char-width-table entries > specially, not sure why. Maybe Handa-san can comment on this. Now I see that "=E2=80=A6" causes other stange behaviour with Chinese-GBK o= n TTY frames, too, probably as an artifact of its having "width" 2: it causes cursor to skip the following character when moving over it. >> (BTW, I have little experience with RTL scripts, but, doesn't in >> that case the ellipsis end up on the logically wrong side, i.e. with >> the beginning/end of string reversed?): > > No. The ellipsis should be _before_ the tail, in the reading order, > and that is what you get here. If you want to dwell on this issue a > bit longer, look what the truncated string looks like in a buffer > whose bidi-paragraph-direction is set to right-to-left. Thanks. I was mainly concerned about the function name: if that's the case, it had better be called something like "truncate-string-beginning" instead of "-left"? --=20 =C5=A0t=C4=9Bp=C3=A1n