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 10:02:53 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 2018-03-06 09:18, Herring, Davis wrote:
> Maybe I misunderstand -- how is this a problem?  If the number of spaces is 
> correct, it identifies the correct character to match against.

It's a problem if you scale each space to match the width of the character 
above it (or below it, in this case).  If you instead align to a particular 
position, you run into the issue of deciding which space to stretch (strech all 
spaces in the range evenly? stretch a single one? what about cases where the 
spaces need to be shrunk?)

> (progn
> >-(foo)
> >-(bar))
> 
> (and
> _(foo)
> _(bar))

I have a lot of trouble reading these examples, as the '>' get converted to 
reply markers by my email client; but looking at the source, I think I 
understand.  Question: why do you indent the body of a 'progn' differently from 
an 'and'?

I was thinking of cases like 'if', for example:

  (if test
      true-case
    false-case)

Where do you use tabs? 

> 
> int>-x>-= 1,
> >-y>-=2;
> doTheFoo();>-// it's true
> doTheBar();>-// so far

I don't think these are ambiguities (as in, the spec is clear on what should 
happen here); but indeed this doesn't render ideally; you'd write it like this 
instead:

int     x = 1,
        y = 2;

doTheFoo();     // it's true
doTheBar();     // so far

(I personally don't like the concept very much, because it doesn't let you 
distinguish between a 0-width indentation marker and a non-zero width 
indentation marker).  That is, it forces you to writ this:

        int f(  int argc;
                char** argv)

instead of 

        int f(int argc;
              int argv)

Clément.



reply via email to

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