GNU bug report logs - #28050
CC Mode 5.33 (C/*l); indentation of array and enum in GNU style isn't right

Previous Next

Package: cc-mode;

Reported by: Mohammed Sadiq <sadiq <at> sadiqpk.org>

Date: Fri, 11 Aug 2017 17:23:02 UTC

Severity: normal

Done: Alan Mackenzie <acm <at> muc.de>

Bug is archived. No further changes may be made.

Full log


Message #22 received at 28050-done <at> debbugs.gnu.org (full text, mbox):

From: Alan Mackenzie <acm <at> muc.de>
To: Mohammed Sadiq <sadiq <at> sadiqpk.org>
Cc: 28050-done <at> debbugs.gnu.org
Subject: Re: bug#28050: CC Mode 5.33 (C/*l); indentation of array and enum in
 GNU style isn't right
Date: Tue, 12 Mar 2019 19:16:54 +0000
Hello, Mohammed and Emacs.

I've just committed a fix to this bug to master.

On Fri, Aug 11, 2017 at 22:50:02 +0530, Mohammed Sadiq wrote:


> For the following code, the indentation of the code isn't right for GNU
> style (C-x h TAB after writing the code):

> /* Output after default (auto)indentation in GNU Emacs (TAB is used sometimes) */
> char *words[] = {
> 		 "good",
> 		 "better",
> 		 "best"
> };

> The GNU style is (as done by the program GNU indent):

> /* They should be indented with 2 spaces (and not TABs)
> char *words[] = {
>   "good",
>   "better",
>   "best"
> };

> Tabs are also add for indentation when defining enums:

> typedef enum {
> 	      GOOD,
> 	      BETTER,
> 	      BEST
> } test;


> The following might be better (2 spaces, and no TABs):

> typedef enum {
>   GOOD,
>   BETTER,
>   BEST
> } test;

> Emacs  : GNU Emacs 26.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.11)
>  of 2017-08-11
> Package: CC Mode 5.33 (C/*l)
> Buffer Style: gnu
> c-emacs-features: (pps-extended-state col-0-paren posix-char-classes gen-string-delim gen-comment-delim syntax-properties 1-bit)

-- 
Alan Mackenzie (Nuremberg, Germany).




This bug report was last modified 6 years and 72 days ago.

Previous Next


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