emacs-devel
[Top][All Lists]
Advanced

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

Indentation of ?: in C-mode (was: scratch/fontify-open-string. [Was: CC


From: Stefan Monnier
Subject: Indentation of ?: in C-mode (was: scratch/fontify-open-string. [Was: CC Mode and electric-pair "problem".])
Date: Sun, 15 Jul 2018 22:23:49 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

>> > +        find_start_value
>> > +          = CONSP (state.levelstarts) ? XINT (XCAR (state.levelstarts))
>> > +          : state.thislevelstart >= 0 ? state.thislevelstart
>> > +          : find_start_value;
>> Please use parentheses here for better readability (to clearly show
>> which parts belong to which condition).
> Yes, it didn't indent well by itself.  Maybe I should raise this with
> the CC Mode maintainer.  But yes, I'll put parens in.

This is one of those rare cases where sm-c-mode handles it better:

    find_start_value
      = CONSP (state.levelstarts) ? XINT (XCAR (state.levelstarts))
        : state.thislevelstart >= 0 ? state.thislevelstart
        : find_start_value;

This said, I don't see either indentation as problematic and I'm not
sure what would be "better for readability".


        Stefan




reply via email to

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