[Top][All Lists]

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

Re: Variable-width font alignment

From: Stephen Leake
Subject: Re: Variable-width font alignment
Date: Sat, 10 Mar 2018 02:12:57 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.90 (windows-nt)

Eli Zaretskii <address@hidden> writes:

>> From: Clément Pit-Claudel <address@hidden>
>> Date: Fri, 9 Mar 2018 11:05:13 -0500
>> On 2018-03-09 03:34, Eli Zaretskii wrote:
>> > Do people think adding a per-buffer space-width variable would be a
>> > good step in this direction?  It should be easy to add, I think.
>> It does sound convenient. Will it apply only to leading whitespace,
>> or also to inter-word whitespace?
> I'd say it should apply everywhere.  It would be confusing to have SPC
> take a different number of pixels depending on where it is.

Right. Unless we need something else to fix the intra-line align
function - ie align '=>' in 

            Trace                    => Verbosity > 1,
            Put_Parse_Table          => Verbosity > 0,
            Ignore_Unused_Tokens     => Verbosity > 1,
            Ignore_Unknown_Conflicts => Verbosity > 1);

It seems to me that implementing this in a variable width font requires some
sort of align-region-local tab setting, which is a change to current align
algorithms (which just insert spaces).

I use this feature extensively in Ada code, so I would not switch to
variable width font without it.

One step in align.el `align-areas' computes an `align-column'. In
variable-pitch-mode, we could convert that into a tab setting by
computing the pixel column of that character column in the line with the
least whitespace/longest text ("Ignore_Unknown_Conflicts =>" above).

I could try doing this. What is the best approach to implementing an
align-region-local tab setting?

-- Stephe

reply via email to

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