emacs-orgmode
[Top][All Lists]
Advanced

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

[O] [PATCH] Re: double-width characters in tables


From: Eric Abrahamsen
Subject: [O] [PATCH] Re: double-width characters in tables
Date: Wed, 13 Feb 2013 10:23:32 +0800
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2 (gnu/linux)

Eric Abrahamsen <address@hidden> writes:

> Achim Gratz <address@hidden> writes:
>
>> Eric Abrahamsen writes:
>>> Yes, org-string-width eventually calls string-width, so that behaves
>>> "correctly" as far as it goes, but unfortunately that's not where the
>>> value in the text properties comes from...
>>>
>>> 《蛙》
>>> 123456
>>>
>>> Doesn't that line up for you? Those bracket characters come with their
>>> own "whitespace", maybe this is clearer:
>>>
>>> 正能量
>>> 123456
>>>
>>> One Chinese character should definitely take up two screen columns.

[...]

> On second thought I don't think it's a problem with text properties.
> (add-text-properties 0 6 '() "正能量") gives an Args out of range error,
> and it probably should, since all it cares about is the number of
> characters in the string.

Here's one provisional attempt to fix one instance of weirdness, inside
`org-table-justify-field-maybe'. This handles re-justification of table
fields when you hit TAB or S-TAB. It turns out this spot doesn't use
text properties, but match-end/beginning locations. This patch Works For
Me, though it's a little ugly and I have no idea if it may cause other
repercussions. Could someone just glance over it?

Thanks,
Eric

Attachment: 0001-Make-table-field-justification-respect-string-width.patch
Description: Text Data


reply via email to

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