Function: c-extend-region-for-CPP

c-extend-region-for-CPP is a byte-compiled function defined in cc-mode.el.gz.

Signature

(c-extend-region-for-CPP BEG END)

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/cc-mode.el.gz
(defun c-extend-region-for-CPP (_beg _end)
  ;; Adjust `c-new-BEG', `c-new-END' respectively to the beginning and end of
  ;; any preprocessor construct they may be in.
  ;;
  ;; Point is undefined both before and after this function call; the buffer
  ;; has already been widened, and match-data saved.  The return value is
  ;; meaningless.
  ;;
  ;; This function is in the C/C++/ObjC values of
  ;; `c-get-state-before-change-functions' and is called exclusively as a
  ;; before change function.
  (goto-char c-new-BEG)
  (c-beginning-of-macro)
  (when (< (point) c-new-BEG)
    (setq c-new-BEG (max (point) (c-determine-limit 500 c-new-BEG))))

  (goto-char c-new-END)
  (when (c-beginning-of-macro)
    (c-end-of-macro)
    (or (eobp) (forward-char)))	 ; Over the terminating NL which may be marked
				 ; with a c-cpp-delimiter category property
  (when (> (point) c-new-END)
    (setq c-new-END (min (point) (c-determine-+ve-limit 500 c-new-END)))))