emacs-devel
[Top][All Lists]
Advanced

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

c-offset-alist corner case failure?


From: Karl Fogel
Subject: c-offset-alist corner case failure?
Date: Wed, 08 Mar 2006 01:01:32 -0600

In GNU Emacs 22.0.50.5 (i686-pc-linux-gnu) of 2005-12-17:

I was looking for a way to avoid this indentation in C mode:

    return rtq_error_create(
                            RTQ_ERR_NODE_UNKNOWN_KIND, NULL,
                            _("Unrecognized node kind: '%s'"),
                            rtq_path_local_style(path, pool));

I wanted (indeed, expected) to get something like this instead:

    return rtq_error_create(
      RTQ_ERR_NODE_UNKNOWN_KIND, NULL,
      _("Unrecognized node kind: '%s'"),
      rtq_path_local_style(path, pool));

Luckily, the variable 'c-offsets-alist' seemed to have a way to
control this, via the 'arglist-cont' element:

   arglist-cont -- Subsequent argument list lines when no
                   arguments follow on the same line as the
                   arglist opening paren.

In the C mode buffer in question, I examined the value of that cons
cell in 'c-offsets-alist':

   M-x eval
   (assoc 'arglist-cont c-offsets-alist)
     ==> (arglist-cont c-lineup-gcc-asm-reg 0)

First I tried setting it to the simplest thing, an integer:

   M-x eval
   (let ((cell (assoc 'arglist-cont c-offsets-alist)))
      (if cell
        (setcdr cell 0)))

I used 'assoc' again to make sure the above expression had the
intended effect, which it had:

   (assoc 'arglist-cont c-offsets-alist)
     ==> (arglist-cont . 0)

But it had no effect on indentation; tabbing resulted in the same
indentation as before.  I tried setting to '+', to get a multiple of
c-basic-offset:

   (let ((cell (assoc 'arglist-cont c-offsets-alist)))
      (if cell
        (setcdr cell '+)))

Still no effect on indentation, though.  I tried setting it to 2, also
with no change in behavior.

Does everyone else see the same behavior?  Am I misinterpreting the
documentation of 'arglist-cont', or is there a buglet here?

-Karl




reply via email to

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