help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: c-hanging-braces-alist customization shows no syntactic symbols


From: Alan Mackenzie
Subject: Re: c-hanging-braces-alist customization shows no syntactic symbols
Date: Thu, 18 Dec 2003 08:35:53 +0000
User-agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.0.35 (i686))

Stephanos Piperoglou <address@hidden> wrote on Wed, 17 Dec 2003
17:48:43 +0200:
> GNU Emacs 21.3 / Windows 2000 + CygWin

> I'm trying to customize my c-hanging-braces-alist and custom doesn't
> show the list of syntactic symbols correctly. See below for a snippet
> of what I get when I M-x customize-variable c-hanging-braces-alist. As
> you can see custom has trouble getting these symbols, .....

The customize interface doesn't seem very helpful for this sort of
variable.  To use it, you'd first have to click on the "Override Style
settings" button, then fill in each line, one by one.  A typical such
line looks like this, after being filled in:

[X] substatement-open   : [Choice] Newline [ ] before, [X] after brace

> .... and I can find nowhere where the entire list is mentioned and
> documented.

It's in the CC Mode manual, page "Hanging Braces".  (I'm sure I don't
need to say this to you, but to get there, do C-h i   m cc mode
i hanging  .)  

> .... I don't mind hacking my .emacs file by hand for these (in fact I'd
> rather define my own c-style, as this is meant for use with JDE), so my
> question really is where can I get a list of syntactic symbols that
> apply to c-hanging-braces-alist?

That's the "Hanging Braces" page.  I agree with your suggestion that
you'd be better editing your .emacs directly, and defining your own style
would be better still.

> Is this a known issue in 21.3? Is it fixed in the devel branch?

Maybe, and almost certainly no.

I think what you're suggesting is that instead of this blank template:

> ==== SNIP ====
> ( ) Override style settings:
>     [ ] nil                 : Choice Newline [ ] before, [ ] after brace
>     [ ] nil                 : Choice Newline [ ] before, [ ] after brace
>     [ ] nil                 : Choice Newline [ ] before, [ ] after brace
>     [ ] nil                 : Choice Newline [ ] before, [ ] after brace
>     [ ] nil                 : Choice Newline [ ] before, [ ] after brace
>     [ ] nil                 : Choice Newline [ ] before, [ ] after brace
>     [ ] nil                 : Choice Newline [ ] before, [ ] after brace
>     [ ] nil                 : Choice Newline [ ] before, [ ] after brace
>     [ ] nil                 : Choice Newline [ ] before, [ ] after brace
>     [ ] nil                 : Choice Newline [ ] before, [ ] after brace
>     [ ] nil                 : Choice Newline [ ] before, [ ] after brace
>     [ ] nil                 : Choice Newline [ ] before, [ ] after brace
>     [ ] nil                 : Choice Newline [ ] before, [ ] after brace
>     [ ] nil                 : Choice Newline [ ] before, [ ] after brace
>     [ ] nil                 : Choice Newline [ ] before, [ ] after brace
>     [ ] nil                 : Choice Newline [ ] before, [ ] after brace
>     [ ] nil                 : Choice Newline [ ] before, [ ] after brace
>     [ ] nil                 : Choice Newline [ ] before, [ ] after brace
>     [ ] nil                 : Choice Newline [ ] before, [ ] after brace
>     [ ] nil                 : Choice Newline [ ] before, [ ] after brace
>    State: this option has been set and saved.
> ==== SNIP ====

, onto which you add the syntactic symbols you're interested in, you
should get a complete list of relevant syntactic symbols, something like:

[ ] brace-list-open     : [Choice] Newline [ ] before, [ ] after brace
[ ] brace-entry-open    : [Choice] Newline [ ] before, [ ] after brace
[ ] statement-cont      : [Choice] Newline [ ] before, [ ] after brace
....

I'm sure this ought to be possible, and it would seem to be desirable.
Two suggestions:  (1) send a request to the CC Mode mailing list at
address@hidden asking for this;  (2) (If you're at home with Emacs
macros and are feeling really brave :-)  Make sure you've got a
sufficiently recent version of CC Mode (5.30.8 is currently current), get
into cc-vars.el (where c-hanging-braces-alist and defcustom-c-style-var
are defined) and fix it.  CC Mode is available from
<http://www.sourceforge.net/release.php>.

-- 
Alan Mackenzie (Munich, Germany)
Email: address@hidden; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").



reply via email to

[Prev in Thread] Current Thread [Next in Thread]