Function: comment-forward

comment-forward is a byte-compiled function defined in newcomment.el.gz.

Signature

(comment-forward &optional N)

Documentation

Skip forward over N comments.

Just like forward-comment but only for positive N and can use regexps instead of syntax.

Source Code

;; Defined in /usr/src/emacs/lisp/newcomment.el.gz
(defun comment-forward (&optional n)
  "Skip forward over N comments.
Just like `forward-comment' but only for positive N
and can use regexps instead of syntax."
  (setq n (or n 1))
  (if (< n 0) (error "No comment-backward")
    (if comment-use-syntax (forward-comment n)
      (while (> n 0)
	(setq n
	      (if (or (forward-comment 1)
		      (and (looking-at comment-start-skip)
			   (goto-char (match-end 0))
			   (re-search-forward comment-end-skip nil 'move)))
		  (1- n) -1)))
      (= n 0))))