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

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

Q: less intelligent c-mode


From: Sven Utcke
Subject: Q: less intelligent c-mode
Date: 25 Sep 2002 17:21:34 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

Hi,

within mmm-mode, I need to write some C-code.  However, this will not
be valid C-code, but rather some fragments only; in particular there
will not generally be a function declaration included.  However,
cc-mode in that case insists to 
a) indent everything to start in the first column
b) colour anything starting in column 1 as a function declaration.
Is there any way lobotomize cc-mode some in such a way that it will
indent relative to the first line within the region it is seeing?

Sven

PS: To give you an idea: cc-mode will indent

  for (i=1; i<the_outline->n; i++) {
    VASSERT(the_outline->x[2][i] == 1.0);
  }                           /* end for |i| */
  if (verbose) {
    fprintf(stderr, "# dist = %g\n", dist);
  }

as

  for (i=1; i<the_outline->n; i++) {
    VASSERT(the_outline->x[2][i] == 1.0);
}                           /* end for |i| */
if (verbose) {
  fprintf(stderr, "# dist = %g\n", dist);
}

-- 
 _  __                     The Cognitive Systems Group
| |/ /___  __ _ ___                                       University of Hamburg
| ' </ _ \/ _` (_-<  phone:    +49 (0)40 42883-2576      Vogt-Koelln-Strasse 30
|_|\_\___/\__, /__/  fax  :    +49 (0)40 42883-2572             D-22527 Hamburg
          |___/ http://kogs-www.informatik.uni-hamburg.de/~utcke/home.html


reply via email to

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