From: Alan Mackenzie <acm@muc.de>
To: David McMackins <contact@mcmackins.org>
Cc: emacs-devel@gnu.org
Subject: Re: enum indentation in GNU style in c-mode is inconsistent
Date: Mon, 27 Jul 2015 10:55:15 +0000 [thread overview]
Message-ID: <20150727105515.GA3220@acm.fritz.box> (raw)
In-Reply-To: <55B552AF.1040909@mcmackins.org>
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).
prev parent reply other threads:[~2015-07-27 10:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-26 21:35 enum indentation in GNU style in c-mode is inconsistent David McMackins
2015-07-27 10:55 ` Alan Mackenzie [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150727105515.GA3220@acm.fritz.box \
--to=acm@muc.de \
--cc=contact@mcmackins.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.