* Re: new syntactic symbols in cc-mode
[not found] <mailman.405.1060848468.29551.help-gnu-emacs@gnu.org>
@ 2003-08-14 12:40 ` Alan Mackenzie
2003-08-14 23:06 ` Heiko Gerdau
[not found] ` <mailman.435.1060902656.29551.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 6+ messages in thread
From: Alan Mackenzie @ 2003-08-14 12:40 UTC (permalink / raw)
Heiko Gerdau <hg@technosis.de> wrote on Thu, 14 Aug 2003 10:03:21 +0200:
> Hi,
> using the cc-mode package is there a way to create a new syntatic
> symbol or to append new keywords to existing syntactic symbols using
> the .emacs configuration file?
Not really, other than by editing and enhancing CC Mode's source files.
But it doesn't really make any sense to "customize" the syntactic symbols
list this sort of way - the syntactic symbols are all about indenting
code, so you'd have to extend the syntax recognition functions (chiefly
c-guess-basic-syntax) anyway. Having gone through all that work, it's
trivial by comparison to add one or two syntactic symbols in the source
code.
> The background is to customize indentation for language extensions not
> covered yet. (like Qt's signal and slots).
Aren't there any suitable syntactic symbols already?
> Thanks for any hint.
There's the CC Mode mailing list at <bug-cc-mode@gnu.org>
> Heiko
--
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").
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: new syntactic symbols in cc-mode
2003-08-14 12:40 ` new syntactic symbols in cc-mode Alan Mackenzie
@ 2003-08-14 23:06 ` Heiko Gerdau
[not found] ` <mailman.435.1060902656.29551.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 6+ messages in thread
From: Heiko Gerdau @ 2003-08-14 23:06 UTC (permalink / raw)
On Thursday 14 August 2003 14:40, Alan Mackenzie wrote:
> > The background is to customize indentation for language extensions not
> > covered yet. (like Qt's signal and slots).
>
> Aren't there any suitable syntactic symbols already?
No, AFAIK
>
> There's the CC Mode mailing list at <bug-cc-mode@gnu.org>
I did not know that and found a discussion about the issue. I seem to have
to modify the constant 'c-protection-kwds' and recompile to introduce
indentation of Qt's signal and slot extensions. I did not try yet but
will.
Thanks
Heiko
^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <mailman.435.1060902656.29551.help-gnu-emacs@gnu.org>]
* Re: new syntactic symbols in cc-mode
[not found] ` <mailman.435.1060902656.29551.help-gnu-emacs@gnu.org>
@ 2003-08-15 8:16 ` Marco Gidde
2003-08-15 12:13 ` Heiko Gerdau
[not found] ` <mailman.445.1060950571.29551.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 6+ messages in thread
From: Marco Gidde @ 2003-08-15 8:16 UTC (permalink / raw)
Heiko Gerdau <hg@technosis.de> writes:
> > There's the CC Mode mailing list at <bug-cc-mode@gnu.org>
>
> I did not know that and found a discussion about the issue. I seem to have
> to modify the constant 'c-protection-kwds' and recompile to introduce
> indentation of Qt's signal and slot extensions. I did not try yet but
> will.
I tried something like that about two years ago and did not
succeed. Would you please publish your working code on this list?
Marco
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: new syntactic symbols in cc-mode
2003-08-15 8:16 ` Marco Gidde
@ 2003-08-15 12:13 ` Heiko Gerdau
[not found] ` <mailman.445.1060950571.29551.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 6+ messages in thread
From: Heiko Gerdau @ 2003-08-15 12:13 UTC (permalink / raw)
On Friday 15 August 2003 10:16, Marco Gidde wrote:
> > I did not know that and found a discussion about the issue. I seem to
> > have to modify the constant 'c-protection-kwds' and recompile to
> > introduce indentation of Qt's signal and slot extensions. I did not
> > try yet but will.
>
> I tried something like that about two years ago and did not
> succeed. Would you please publish your working code on this list?
If you add "signals" to the definition of 'c-protection-kwds' in
'cc-lang.el' ( and don't use the precompiled cc-*.elc) it works fine.
Unfortunately if you add any keyword containing a blank (like "public
slots") it does not work, although the generated regular expression in
variable 'c-opt-access-key' would find it. I don't know where the "blank"
problem comes from.
Heiko
^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <mailman.445.1060950571.29551.help-gnu-emacs@gnu.org>]
* Re: new syntactic symbols in cc-mode
[not found] ` <mailman.445.1060950571.29551.help-gnu-emacs@gnu.org>
@ 2003-08-15 22:11 ` Marco Gidde
0 siblings, 0 replies; 6+ messages in thread
From: Marco Gidde @ 2003-08-15 22:11 UTC (permalink / raw)
Heiko Gerdau <hg@technosis.de> writes:
> If you add "signals" to the definition of 'c-protection-kwds' in
> 'cc-lang.el' ( and don't use the precompiled cc-*.elc) it works fine.
>
> Unfortunately if you add any keyword containing a blank (like "public
> slots") it does not work, although the generated regular expression in
> variable 'c-opt-access-key' would find it. I don't know where the "blank"
> problem comes from.
I debugged the code a bit and found that the parser jumps back and
forth not only by character but sometimes also by words (take a look
at c-backward-sexp). I am far away from understanding what's going on
there, but it seems to help if you not only add "public slots" but also
"slots" to the regular expression. While typing your code the parser
identifies the "public slots:" as a label and indents it like that, but
c-indent-defun works (most of the time :-)
^ permalink raw reply [flat|nested] 6+ messages in thread
* new syntactic symbols in cc-mode
@ 2003-08-14 8:03 Heiko Gerdau
0 siblings, 0 replies; 6+ messages in thread
From: Heiko Gerdau @ 2003-08-14 8:03 UTC (permalink / raw)
Hi,
using the cc-mode package is there a way to create a new syntatic symbol or
to append new keywords to existing syntactic symbols using the .emacs
configuration file?
The background is to customize indentation for language extentions not
covered yet. (like Qt's signal and slots).
Thanks for any hint.
Heiko
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2003-08-15 22:11 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <mailman.405.1060848468.29551.help-gnu-emacs@gnu.org>
2003-08-14 12:40 ` new syntactic symbols in cc-mode Alan Mackenzie
2003-08-14 23:06 ` Heiko Gerdau
[not found] ` <mailman.435.1060902656.29551.help-gnu-emacs@gnu.org>
2003-08-15 8:16 ` Marco Gidde
2003-08-15 12:13 ` Heiko Gerdau
[not found] ` <mailman.445.1060950571.29551.help-gnu-emacs@gnu.org>
2003-08-15 22:11 ` Marco Gidde
2003-08-14 8:03 Heiko Gerdau
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).