emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master 188bd80: gnus-shorten-url: Improve and avoid args-out-of-rang


From: Štěpán Němec
Subject: Re: master 188bd80: gnus-shorten-url: Improve and avoid args-out-of-range error
Date: Tue, 14 Apr 2020 14:24:28 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

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 "…" causes other stange behaviour with Chinese-GBK on 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"?

-- 
Štěpán



reply via email to

[Prev in Thread] Current Thread [Next in Thread]