Function: c-forward-conditional

c-forward-conditional is an interactive and byte-compiled function defined in cc-cmds.el.gz.

Signature

(c-forward-conditional COUNT &optional TARGET-DEPTH WITH-ELSE)

Documentation

Move forward across a preprocessor conditional, leaving mark behind.

A prefix argument acts as a repeat count. With a negative argument, move backward across a preprocessor conditional.

If there aren't enough conditionals after (or before) point, an error is signaled.

"#elif" is treated like "#else" followed by "#if", except that
the nesting level isn't changed when tracking subconditionals.

The optional arguments TARGET-DEPTH and WITH-ELSE are historical, and have the same meanings as in c-scan-conditionals. If you are calling c-forward-conditional from a program, you might want to call c-scan-conditionals directly instead.

Probably introduced at or before Emacs version 19.20.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/cc-cmds.el.gz
(defun c-forward-conditional (count &optional target-depth with-else)
  "Move forward across a preprocessor conditional, leaving mark behind.
A prefix argument acts as a repeat count.  With a negative argument,
move backward across a preprocessor conditional.

If there aren't enough conditionals after (or before) point, an
error is signaled.

\"#elif\" is treated like \"#else\" followed by \"#if\", except that
the nesting level isn't changed when tracking subconditionals.

The optional arguments TARGET-DEPTH and WITH-ELSE are historical,
and have the same meanings as in `c-scan-conditionals'.  If you
are calling c-forward-conditional from a program, you might want
to call `c-scan-conditionals' directly instead."
  (interactive "p")
  (let ((new-point (c-scan-conditionals count target-depth with-else)))
    (push-mark)
    (goto-char new-point)))