GNU bug report logs - #41061
[PATCH] cc-mode: add ‘c-lineup-ternary-bodies’

Previous Next

Package: emacs;

Reported by: Michal Nazarewicz <mina86 <at> mina86.com>

Date: Sun, 3 May 2020 20:32:01 UTC

Severity: wishlist

Tags: patch

Done: Michał Nazarewicz <mina86 <at> mina86.com>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 41061 <at> debbugs.gnu.org (full text, mbox):

From: Michał Nazarewicz <mina86 <at> mina86.com>
To: rms <at> gnu.org
Cc: 41061 <at> debbugs.gnu.org
Subject: Re: bug#41061: [PATCH] cc-mode: add ‘c-lineup-ternary-bodies’
Date: Mon, 4 May 2020 21:00:06 +0100
On Mon, 4 May 2020 at 04:17, Richard Stallman <rms <at> gnu.org> wrote:
>       > return arg % 2 == 0 ? arg / 2
>       >                     : (3 * arg + 1);
>
> You can format the code that way if you like,

It’s more that project I’m involved in enforces such style.
It’s one of the alignments clang-format supports so I’m likely
not the only person who needs to conform to this particular
style.

> but the GNU convention is like this:
>
>       return (arg % 2 == 0
>               ? arg / 2
>               : 3 * arg + 1);
>
> That not only makes the nesting very clear,
> it also indents correctly without a special hack.

-- 
Best regards
ミハウ “𝓶𝓲𝓷𝓪86” ナザレヴイツ
«If at first you don’t succeed, give up skydiving»




This bug report was last modified 4 years and 358 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.