aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2005-10-06 15:32:14 +0000
committerStefan Monnier2005-10-06 15:32:14 +0000
commit7a34e7b1dc99d814e7d170f7825545bb5a985db9 (patch)
tree6be6144b95f7ee52504c7fff8d4642d38db457cc
parentde4ce191011fbfc863098238d3703e4e24303453 (diff)
downloademacs-7a34e7b1dc99d814e7d170f7825545bb5a985db9.tar.gz
emacs-7a34e7b1dc99d814e7d170f7825545bb5a985db9.zip
(cvs-sentinel): Make sure we do re-enable undo.
-rw-r--r--lisp/pcvs.el34
1 files changed, 19 insertions, 15 deletions
diff --git a/lisp/pcvs.el b/lisp/pcvs.el
index c402192c05a..f86e4c95625 100644
--- a/lisp/pcvs.el
+++ b/lisp/pcvs.el
@@ -647,34 +647,38 @@ This is responsible for parsing the output from the cvs update when
647it is finished." 647it is finished."
648 (when (memq (process-status proc) '(signal exit)) 648 (when (memq (process-status proc) '(signal exit))
649 (let ((cvs-postproc (process-get proc 'cvs-postprocess)) 649 (let ((cvs-postproc (process-get proc 'cvs-postprocess))
650 (cvs-buf (process-get proc 'cvs-buffer))) 650 (cvs-buf (process-get proc 'cvs-buffer))
651 (procbuf (process-buffer proc)))
652 (unless (buffer-live-p cvs-buf) (setq cvs-buf nil))
653 (unless (buffer-live-p procbuf) (setq procbuf nil))
651 ;; Since the buffer and mode line will show that the 654 ;; Since the buffer and mode line will show that the
652 ;; process is dead, we can delete it now. Otherwise it 655 ;; process is dead, we can delete it now. Otherwise it
653 ;; will stay around until M-x list-processes. 656 ;; will stay around until M-x list-processes.
654 (process-put proc 'postprocess nil) 657 (process-put proc 'postprocess nil)
655 (delete-process proc) 658 (delete-process proc)
656 ;; Don't do anything if the main buffer doesn't exist any more. 659 ;; Don't do anything if the main buffer doesn't exist any more.
657 (when (buffer-live-p cvs-buf) 660 (when cvs-buf
658 (with-current-buffer cvs-buf 661 (with-current-buffer cvs-buf
659 (cvs-update-header (process-get proc 'cvs-header) nil) 662 (cvs-update-header (process-get proc 'cvs-header) nil)
660 (setq cvs-mode-line-process (symbol-name (process-status proc))) 663 (setq cvs-mode-line-process (symbol-name (process-status proc)))
661 (force-mode-line-update) 664 (force-mode-line-update)
662 (when cvs-postproc 665 (when cvs-postproc
663 (if (null (buffer-live-p (process-buffer proc))) 666 (if (null procbuf)
664 ;;(set-process-buffer proc nil) 667 ;;(set-process-buffer proc nil)
665 (error "cvs' process buffer was killed") 668 (error "cvs' process buffer was killed")
666 (with-current-buffer (process-buffer proc) 669 (with-current-buffer procbuf
667 ;; do the postprocessing like parsing and such 670 ;; Do the postprocessing like parsing and such.
668 (save-excursion (eval cvs-postproc)) 671 (save-excursion (eval cvs-postproc)))))))
669 ;; check whether something is left 672 ;; Check whether something is left.
670 (unless (get-buffer-process (current-buffer)) 673 (when (and procbuf (not (get-buffer-process procbuf)))
671 ;; IIRC, we enable undo again once the process is finished 674 (with-current-buffer procbuf
672 ;; for cases where the output was inserted in *vc-diff* or 675 ;; IIRC, we enable undo again once the process is finished
673 ;; in a file-like buffer. --Stef 676 ;; for cases where the output was inserted in *vc-diff* or
674 (buffer-enable-undo) 677 ;; in a file-like buffer. --Stef
675 (with-current-buffer cvs-buffer 678 (buffer-enable-undo)
676 (message "CVS process has completed in %s" 679 (with-current-buffer (or cvs-buf (current-buffer))
677 (buffer-name)))))))))))) 680 (message "CVS process has completed in %s"
681 (buffer-name))))))))
678 682
679(defun cvs-parse-process (dcd &optional subdir old-fis) 683(defun cvs-parse-process (dcd &optional subdir old-fis)
680 "Parse the output of a cvs process. 684 "Parse the output of a cvs process.