emacs-devel
[Top][All Lists]
Advanced

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

Re: Variable-width font indentation


From: Clément Pit-Claudel
Subject: Re: Variable-width font indentation
Date: Tue, 6 Mar 2018 08:33:24 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 2018-03-05 23:05, Herring, Davis wrote:
>> I don't know of a good solution to this problem: in general,
>> there's not enough information to distinguish 'indentation'
>> spaces (the two spaces before `printf (', `pr ()', and `return 0')
>> and 'line-up' spaces (the spaces before `char ()').
> 
> This is of course an argument in favor of "smart tabs" 
> <https://www.emacswiki.org/emacs/SmartTabs>

No, not really: smart tabs aren't enough AFAICT.  Take the following example:

        match opt with
        | []     -> []
        | x :: t -> x :: f t

You'd want to scale the spaces according to the line *below*, not ebove, and 
even then you'd have to account for the fact that 'x ' isn't as wide as '[]'.  
Smart Tabs are also not very good for languages like ELisp with variable 
indentation depths.

If anything, I think this is more of an argument in favor of elastic tabs 
(http://nickgravgaard.com/elastic-tabstops/).

Clément.



reply via email to

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