Nested indentation for preprocessor directives like #if

"R. Diez via CC-Mode-help" <[email protected]> Sat, 6 Dec 2025 12:28:04 +0100
Newsgroups gmane.emacs.cc-mode.general
Message-ID <[email protected]>
Hi all:

I have been playing with 'c-toggle-cpp-indent-to-body', but it is not enough, I would like to have nested indentation like:

#if AAA
   #if BBB
     ...
   #else
     ...
   #endif
#else
   #if CCC
     ...
   #else
     ...
   #endif
#endif

I gather that is not possible with the current implementation, right?

I am not the first to come up with such a wish:

https://emacs.stackexchange.com/questions/76465/how-to-configure-emacs-to-support-indented-c-preprocessor-statements

At the very least, it would be nice if the documentation for 'c-toggle-cpp-indent-to-body' mentioned that this often-expected indentation does not work.


By the way, on this web page:

https://cc-mode.sourceforge.net/

There is a "Mailing lists" link like this:

https://cc-mode.sourceforge.net/lists.php

But that URL just redirects back to https://cc-mode.sourceforge.net/ , and there is no mention of this mailing list [email protected] .

Thanks in advance,
   rdiez