From: Alan Mackenzie <acm@muc.de>
Subject: Re: Emacs CC Mode's auto-newline facility: INFORMAL SURVEY
Date: Tue, 12 Apr 2005 20:58:12 +0000 [thread overview]
Message-ID: <4pch3d.i6.ln@acm.acm> (raw)
In-Reply-To: pan.2005.04.10.21.22.17.977274@black.hole.com
Vedat Hallac <vman@black.hole.com> wrote on Mon, 11 Apr 2005 07:22:18 +1000:
> On Fri, 08 Apr 2005 19:58:01 +0000, Alan Mackenzie wrote:
[ .... ]
>> o How often do you use C-c C-a (or even C-c C-t) to toggle
>> auto-newline mode?
> Never in the last two years or so. But there are times when I should.
> Especially when typing in initializers for arrays of structures. I do
> not always want to see them formatted as C code, especially when they
> are short (pointer, length) pairs.
You could actually configure CC Mode only to do auto-newline on certain
types of brace. For example, on one of these braces, type <CR> before it
to get it onto a line of its own. Then do C-c C-s to get its "syntactic
context". You'll get back something like "((bracelist-open 1523))".
Then make sure c-hanging-braces-alist looks something like this:
(setq c-hanging-braces-alist '((bracelist-open)
(bracelist-close)))
This will stop auto-newlines going in in these particular circumstances.
(Note: auto-newlines are put on all braces apart from those in the list.
If you wanted an auto-newline only _after_ a statement-block `{' (say,
for Kernighan & Ritchie formatting) you'd have something like this:
(setq c-hanging-braces-alist '((bracelist-open)
(bracelist-close)
(substatement-open after)))
).
--
Alan Mackenzie (Munich, Germany)
Email: aacm@muuc.dee; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").
next prev parent reply other threads:[~2005-04-12 20:58 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-08 19:58 Emacs CC Mode's auto-newline facility: INFORMAL SURVEY Alan Mackenzie
2005-04-08 20:18 ` MSR
2005-04-08 20:31 ` William Hughes
2005-04-08 21:38 ` Aidan Kehoe
2005-04-08 22:11 ` Jonathan Arnold
2005-04-08 22:13 ` Ben Pfaff
2005-04-10 18:34 ` Eric Eide
2005-04-10 21:22 ` Vedat Hallac
2005-04-12 20:58 ` Alan Mackenzie [this message]
2005-04-13 8:03 ` Vedat Hallac
2005-04-11 6:39 ` Klaus Zeitler
2005-04-11 10:19 ` James
2005-04-12 21:12 ` Alan Mackenzie
2005-04-11 17:52 ` Robert Marshall
[not found] ` <9on63d.36.ln-Yd3Idk226uQ@public.gmane.org>
2005-04-11 20:51 ` Jochen Küpper
2005-04-12 11:47 ` Greg Rowe
2005-04-24 16:42 ` Emacs CC Mode's auto-newline facility: INFORMAL SURVEY RESULTS Alan Mackenzie
2005-04-25 2:37 ` Miles Bader
2005-04-25 8:21 ` Chris Croughton
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4pch3d.i6.ln@acm.acm \
--to=acm@muc.de \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).