> This makes a lot of sense. How can we test the effect? The example
> above does not appear to be affected. The lispwords test doesn't fail.
Right, this change is technically not necessary for what I want to do
(changing the indent of consequent from 2 to 1). But while I cannot
imagine why someone would want the original behavior (indent of 2), I
still think it would be nice to have an option to restore it.
That can be done by lw+=else, however original code here does not handle
else\x00 (else\x20 does work, but having to put the space there is
annoying). Therefore this change.
> Perhaps IS_WHITE_OR_NUL() should be used here.
I did not know this is a thing, should I send a version 2 of the patch
or is it faster for you to change on your end? I've tested locally that
it seems to work.
> > }
> > return FALSE;
> > @@ -2039,6 +2039,8 @@ get_lisp_indent(void)
> > if (!vi_lisp && (*that == '(' || *that == '[')
> > && lisp_match(that + 1))
> > amount += 2;
> > + else if (!vi_lisp && STRICMP(that, "(else") == 0)
> > + amount += 1;
> > else
> > {
> > that++;
>
> Is the example at the top a good test for this change? Does it affect
> other situations?
Yes, I think it is a good example. I've tried it on few pieces of
guile's source code and it seems to work even on more complex ones. I'm
not aware of any side effects.
W.
--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.