comparison lisp/pcvs.el @ 70708:e5bae689766e

(cvs-make-cvs-buffer): Specify extra newline for ewoc's header and footer. (cvs-update-header): Update initial header recognition. Append newline to final header and footer values.
author Thien-Thi Nguyen <ttn@gnuvola.org>
date Thu, 18 May 2006 12:07:10 +0000
parents 3bd95f4f2941
children 4f58e5dcbbc0
comparison
equal deleted inserted replaced
70707:346a9c09f370 70708:e5bae689766e
465 "\n") 465 "\n")
466 (setq buffer-read-only t) 466 (setq buffer-read-only t)
467 (cvs-mode) 467 (cvs-mode)
468 (set (make-local-variable 'list-buffers-directory) buffer-name) 468 (set (make-local-variable 'list-buffers-directory) buffer-name)
469 ;;(set (make-local-variable 'cvs-temp-buffer) (cvs-temp-buffer)) 469 ;;(set (make-local-variable 'cvs-temp-buffer) (cvs-temp-buffer))
470 (let ((cookies (ewoc-create 'cvs-fileinfo-pp "\n" ""))) 470 (let ((cookies (ewoc-create 'cvs-fileinfo-pp "\n\n" "\n")))
471 (set (make-local-variable 'cvs-cookies) cookies) 471 (set (make-local-variable 'cvs-cookies) cookies)
472 (add-hook 'kill-buffer-hook 472 (add-hook 'kill-buffer-hook
473 (lambda () 473 (lambda ()
474 (ignore-errors (kill-buffer cvs-temp-buffer))) 474 (ignore-errors (kill-buffer cvs-temp-buffer)))
475 nil t) 475 nil t)
616 (defun cvs-update-header (cmd add) 616 (defun cvs-update-header (cmd add)
617 (let* ((hf (ewoc-get-hf cvs-cookies)) 617 (let* ((hf (ewoc-get-hf cvs-cookies))
618 (str (car hf)) 618 (str (car hf))
619 (done "") 619 (done "")
620 (tin (ewoc-nth cvs-cookies 0))) 620 (tin (ewoc-nth cvs-cookies 0)))
621 (if (eq (length str) 1) (setq str "")) 621 (if (eq (length str) 2) (setq str ""))
622 ;; look for the first *real* fileinfo (to determine emptyness) 622 ;; look for the first *real* fileinfo (to determine emptyness)
623 (while 623 (while
624 (and tin 624 (and tin
625 (memq (cvs-fileinfo->type (ewoc-data tin)) 625 (memq (cvs-fileinfo->type (ewoc-data tin))
626 '(MESSAGE DIRCHANGE))) 626 '(MESSAGE DIRCHANGE)))
631 (concat "^-- Running " (regexp-quote cmd) " \\.\\.\\.\n") str)) 631 (concat "^-- Running " (regexp-quote cmd) " \\.\\.\\.\n") str))
632 (error "Internal PCL-CVS error while removing message") 632 (error "Internal PCL-CVS error while removing message")
633 (setq str (replace-match "" t t str)) 633 (setq str (replace-match "" t t str))
634 (if (zerop (length str)) (setq str "\n")) 634 (if (zerop (length str)) (setq str "\n"))
635 (setq done (concat "-- last cmd: " cmd " --")))) 635 (setq done (concat "-- last cmd: " cmd " --"))))
636 (setq str (concat str "\n") done (concat done "\n"))
636 ;; set the new header and footer 637 ;; set the new header and footer
637 (ewoc-set-hf cvs-cookies 638 (ewoc-set-hf cvs-cookies
638 str (concat "\n--------------------- " 639 str (concat "\n--------------------- "
639 (if tin "End" "Empty") 640 (if tin "End" "Empty")
640 " ---------------------\n" 641 " ---------------------\n"