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 #8 received at 41061 <at> debbugs.gnu.org (full text, mbox):

From: Richard Stallman <rms <at> gnu.org>
To: Michal Nazarewicz <mina86 <at> mina86.com>
Cc: 41061 <at> debbugs.gnu.org
Subject: Re: bug#41061: [PATCH] cc-mode: add
 ‘c-lineup-ternary-bodies’
Date: Sun, 03 May 2020 23:15:59 -0400
[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

      > return arg % 2 == 0 ? arg / 2
      >                     : (3 * arg + 1);

You can format the code that way if you like,
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.


-- 
Dr Richard Stallman
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)






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.