0

When adjusting C++ indentation, I know I can show the syntactic point with C-c C-s and then in .emacs something like

(c-set-offset 'inline-open -0)

Now how do I discriminate between different contexts; for example suppose I want to adjust topmost-into, then there is some context like inclass that I don't know how to represent in .emacs.. Output from C-c C-s:

((innamespace 479) (topmost-intro 479))

((inclass 540) (topmost-intro 540))

Here is a small C++ source:

namespace { int var; // C-c C-s = ((innamespace 11) (topmost-intro 11)) }; class X { int x; // C-c C-s = ((inclass 86) (topmost-intro 86)) }; 

One more question:

I observed by accident that (c-set-offset 'inline-open -0) works as expected (set the relative indent) whereas (c-set-offset 'inline-open 0) has no effect. What is the difference between 0 and negative 0?

3
  • Can you provide a short C++ example that illustrates what you are talking about? Commented Apr 14 at 18:14
  • 1
    @NickD Added a small C++ example Commented Apr 14 at 18:24
  • There is no difference between 0 and -0. Something else is going on: how exactly do you observe the difference? The best way to provide answers to these comments is to edit your question and add the information there. Commented Apr 14 at 18:29

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.