Function: cvs-parse-buffer

cvs-parse-buffer is a byte-compiled function defined in pcvs-parse.el.gz.

Signature

(cvs-parse-buffer PARSE-SPEC DCD &optional SUBDIR)

Documentation

Parse current buffer according to PARSE-SPEC.

PARSE-SPEC is a function of no argument advancing the point and returning
  either a fileinfo or t (if the matched text should be ignored) or
  nil if it didn't match anything.
DCD just indicates whether the command was changing the disc
  or not (useful to tell the difference between cvs-examine and cvs-update
  output.
The path names should be interpreted as relative to SUBDIR (defaults
  to the default-directory).
Return a list of collected entries, or t if an error occurred.

Source Code

;; Defined in /usr/src/emacs/lisp/vc/pcvs-parse.el.gz
(defun cvs-parse-buffer (parse-spec dcd &optional subdir)
  "Parse current buffer according to PARSE-SPEC.
PARSE-SPEC is a function of no argument advancing the point and returning
  either a fileinfo or t (if the matched text should be ignored) or
  nil if it didn't match anything.
DCD just indicates whether the command was changing the disc
  or not (useful to tell the difference between `cvs-examine' and `cvs-update'
  output.
The path names should be interpreted as relative to SUBDIR (defaults
  to the `default-directory').
Return a list of collected entries, or t if an error occurred."
  (goto-char (point-min))
  (let ((fileinfos ())
	(dont-change-disc dcd)
	(cvs-current-dir "")
	(case-fold-search nil)
	(cvs-current-subdir (or subdir "")))
    (while (not (or (eobp) (eq fileinfos t)))
      (let ((ret (cvs-parse-run-table parse-spec)))
	(cond
	 ;; it matched a known information message
	 ((cvs-fileinfo-p ret) (push ret fileinfos))
	 ;; it didn't match anything at all (impossible)
	 ((and (consp ret) (cvs-fileinfo-p (car ret)))
	  (setq fileinfos (append ret fileinfos)))
	 ((null ret) (setq fileinfos t))
	 ;; it matched something that should be ignored
	 (t nil))))
    (nreverse fileinfos)))