Function: c-up-conditional
c-up-conditional is an interactive and byte-compiled function defined
in cc-cmds.el.gz.
Signature
(c-up-conditional COUNT)
Documentation
Move back to the containing preprocessor conditional, leaving mark behind.
A prefix argument acts as a repeat count. With a negative argument, move forward to the end of the containing preprocessor conditional.
"#elif" is treated like "#else" followed by "#if", so the
function stops at them when going backward, but not when going
forward.
Probably introduced at or before Emacs version 19.1.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/cc-cmds.el.gz
;; Movement by CPP conditionals.
(defun c-up-conditional (count)
"Move back to the containing preprocessor conditional, leaving mark behind.
A prefix argument acts as a repeat count. With a negative argument,
move forward to the end of the containing preprocessor conditional.
\"#elif\" is treated like \"#else\" followed by \"#if\", so the
function stops at them when going backward, but not when going
forward."
(interactive "p")
(let ((new-point (c-scan-conditionals (- count) -1)))
(push-mark)
(goto-char new-point))
(c-keep-region-active))