Function: c-forward-comments

c-forward-comments is a byte-compiled function defined in cc-engine.el.gz.

Signature

(c-forward-comments &optional LIM)

Documentation

Move forward past all following whitespace and comments.

Line continuations, i.e. backslashes followed by line breaks, are treated as whitespace. LIM, if non-nil, is a forward search limit. If LIM is inside a comment, point may be left at LIM.

Note that this function might do hidden buffer changes. See the comment at the start of cc-engine.el for more info.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/cc-engine.el.gz
(defsubst c-forward-comments (&optional lim)
  "Move forward past all following whitespace and comments.
Line continuations, i.e. backslashes followed by line breaks, are
treated as whitespace.  LIM, if non-nil, is a forward search limit.
If LIM is inside a comment, point may be left at LIM.

Note that this function might do hidden buffer changes.  See the
comment at the start of cc-engine.el for more info."

  (save-restriction
    (if lim
	(narrow-to-region (point-min) lim))
    (while (or
	    ;; If forward-comment in at least XEmacs 21 is given a large
	    ;; positive value, it'll loop all the way through if it hits
	    ;; eob.
	    (and (forward-comment 5)
		 ;; Some emacsen (e.g. XEmacs 21) return t when moving
		 ;; forwards at eob.
		 (not (eobp)))

	    (when (looking-at "\\\\[\n\r]")
	      (forward-char 2)
	      t)))))