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

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

Re: What is the best way to navigate #ifdef and #endif in C program


From: Emmy Noether
Subject: Re: What is the best way to navigate #ifdef and #endif in C program
Date: Wed, 08 Dec 2010 15:23:17 -0000
User-agent: G2/1.0

On Aug 3, 9:45 pm, Fren Zeee <frenz...@gmail.com> wrote:
> On Aug 2, 5:31 pm, "Daniel (Youngwhan)" <breadn...@gmail.com> wrote:
>
>
>
> > Hi,
>
> > If there is curly brace, it is easy to navigate between them by M-C-f
> > and M-C-b in c-mode.
>
> > However, I cannot find a way to navigate in like curly brace when it
> > comes to #ifdef, #else, and #endif.
>
> > For example, if there is a code like this:
>
> > #ifdef A_DEFINED
> > (...100 lines)
> > #else
> > (... 500 lines)
> > #endif
>
> > , is there a easy way to move the cursor from #endif to #ifdef or
> > #else and vice versa?
>
> > Daniel
>
> You might get better luck posting in a C group also.
>
> I use #ifdef ... #endif often also to comment out blocks of code
> during debugging.
>
> My question to CLISP/ELISP/scheme people is
>
> If there is a wrapper do nothing type function in elisp/clisp/scheme
> which can have the same effect as commenting out.
>
> This is because I dont like to do comment-region/uncomment-region in
> emacs.
>
> These three lispy languages dont seem to have comment block construct
> like C ie /* and */

I would remove a function block by wrapping in one of man conditionals
like

(cond (f (comment-out-block)) )

the short circuit evaluation would not even process it.

I plan to test this idea in the future.


reply via email to

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