[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Support paragraph-local tab stops
From: |
Yuan Fu |
Subject: |
Re: Support paragraph-local tab stops |
Date: |
Wed, 27 May 2020 11:48:35 -0400 |
> On May 27, 2020, at 11:29 AM, Eli Zaretskii <address@hidden> wrote:
>
>> From: Yuan Fu <address@hidden>
>> Date: Tue, 26 May 2020 19:26:01 -0400
>>
>> As show above, the second table has longer tab stops since they have longer
>> headers.
>>
>> In Emacs, both table would have to use long tab stops, and the first table
>> with short headers would waste a lot of space. In order to set proper tab
>> stops, you have to go through the whole buffer and use the longest header
>> for each column.
>>
>> Word processors doesn’t have this problem because they have paragraph-local
>> tab stops, so each table can have their own tabs stops. I wonder if Emacs
>> can do the same. Can we add a text property that points to a list that
>> specifies the tabs stops to use? Is that possible?
>
> IMO, TAB stops are not the right tool for the job here. You need to
> use the :align-to display property, which allows to align text with
> pixel granularity.
I think both approach are equally appropriate. And the tab-based one aligns
more closely to word processors. If we want to gradually add WYSIWYG editor
features, and enable Emacs to edit rich text, this is an unavoidable feature.
I just wrote a (very rough) proof-of-concept patch—it’s much easier than I
thought. With the patch you can do something like
(put-text-property (region-beginning) (region-end)
'pixel-tab-stop-list '(70 140 210 280 350 420))
Yuan
tab-stop.patch
Description: Binary data