Function: cvs-update-header

cvs-update-header is a byte-compiled function defined in pcvs.el.gz.

Signature

(cvs-update-header CMD ADD)

Source Code

;; Defined in /usr/src/emacs/lisp/vc/pcvs.el.gz
(defun cvs-update-header (cmd add)
  (let* ((hf (ewoc-get-hf cvs-cookies))
	 (str (car hf))
	 (done "")
	 (tin (ewoc-nth cvs-cookies 0)))
    ;; look for the first *real* fileinfo (to determine emptiness)
    (while
	(and tin
	     (memq (cvs-fileinfo->type (ewoc-data tin))
		   '(MESSAGE DIRCHANGE)))
      (setq tin (ewoc-next cvs-cookies tin)))
    (if add
        (progn
          ;; Remove the default empty line, if applicable.
          (if (not (string-match "." str)) (setq str "\n"))
          (setq str (concat "-- Running " cmd " ...\n" str)))
      (if (not (string-match
                ;; FIXME:  If `cmd' is large, this will bump into the
                ;; compiled-regexp size limit.  We could drop the "^" anchor
                ;; and use search-forward to circumvent the problem.
		(concat "^-- Running " (regexp-quote cmd) " \\.\\.\\.\n") str))
	  (error "Internal PCL-CVS error while removing message")
	(setq str (replace-match "" t t str))
        ;; Re-add the default empty line, if applicable.
        (if (not (string-match "." str)) (setq str "\n\n"))
	(setq done (concat "-- last cmd: " cmd " --\n"))))
    ;; set the new header and footer
    (ewoc-set-hf cvs-cookies
		 str (concat "\n--------------------- "
			     (if tin "End" "Empty")
			     " ---------------------\n"
			     done))))