all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* enum indentation in GNU style in c-mode is inconsistent
@ 2015-07-26 21:35 David McMackins
  2015-07-27 10:55 ` Alan Mackenzie
  0 siblings, 1 reply; 2+ messages in thread
From: David McMackins @ 2015-07-26 21:35 UTC (permalink / raw)
  To: emacs-devel

As pointed out in an e-mail from last year, the GNU style C indentation
in Emacs is wrong for enumerated types. The user who wrote it said that
the bug should not be fixed because it would case creeping changes in
the GNU code base over a long period of time.

While that is true, one large problem is inconsistency. I have gotten
Emacs into a state where the enum indentation would actually be true to
GNU coding standards through some messing about with opening and closing
braces in a header file, but if I reload c-mode, it goes back to the way
it was before.

I do think this should be fixed, since one of the primary reasons I use
Emacs is its correct indentation in many C styles.

Happy Hacking,

David E. McMackins II
Associate, Free Software Foundation (#12889)

www.mcmackins.org www.delwink.com
www.gnu.org www.fsf.org



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: enum indentation in GNU style in c-mode is inconsistent
  2015-07-26 21:35 enum indentation in GNU style in c-mode is inconsistent David McMackins
@ 2015-07-27 10:55 ` Alan Mackenzie
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Mackenzie @ 2015-07-27 10:55 UTC (permalink / raw)
  To: David McMackins; +Cc: emacs-devel

Hello, David.

On Sun, Jul 26, 2015 at 04:35:43PM -0500, David McMackins wrote:
> As pointed out in an e-mail from last year, the GNU style C indentation
> in Emacs is wrong for enumerated types. The user who wrote it said that
> the bug should not be fixed because it would case creeping changes in
> the GNU code base over a long period of time.

That would almost certainly have been me.

> While that is true, one large problem is inconsistency. I have gotten
> Emacs into a state where the enum indentation would actually be true to
> GNU coding standards through some messing about with opening and closing
> braces in a header file, ....

Sorry, but there're too many prepositions in that paragraph for me to be
sure of your meaning.

By "gotten Emacs into a state where ..." do you mean that you've got the
indentation in a particular buffer to be standards-correct, or that
you've configured C Mode to indent standards-correctly when it does
indentation (e.g. with <tab>)?

> ...., but if I reload c-mode, it goes back to the way it was before.

Restarting C Mode doesn't change any existing indentation, so by "it",
do you mean "the C mode configuration of indentation operations"?

> I do think this should be fixed, since one of the primary reasons I use
> Emacs is its correct indentation in many C styles.

As I explained last year, I don't want to correct this bug in GNU style
indentation, because that would make a (very) large quantity of existing
source code's indentation unstable.

I'm guessing here, but I think what you've done is, after starting C
Mode, you've configured indentation of enums to be standards-correct
on-the-fly.  And that each time C Mode is (re-)started, this on-the-fly
configuration is lost.  This is naturally irritating and tedious.

What I think the best thing for you to do here is to create a CC Mode
style of your own, which "inherits" from the GNU style, and sets its own
indentation for enums.  This would be in your .emacs, and once set up,
would work without further tedium.  The setting up of styles is
described in the CC Mode manual, in particular you should read the pages
"Config Basics", "Styles" and some of its subpages, and there is an
example of setting up a style in "Sample .emacs file".

Alternatively, you could clarify the points here, then ask me to create
the style for you.  :-)

> Happy Hacking,

and yourself too, Sir!

> David E. McMackins II
> Associate, Free Software Foundation (#12889)

> www.mcmackins.org www.delwink.com
> www.gnu.org www.fsf.org

-- 
Alan Mackenzie (Nuremberg, Germany).



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-07-27 10:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-26 21:35 enum indentation in GNU style in c-mode is inconsistent David McMackins
2015-07-27 10:55 ` Alan Mackenzie

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.