summaryrefslogtreecommitdiff
path: root/lisp/vc/pcvs.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2012-09-29 23:44:35 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2012-09-29 23:44:35 -0400
commite01c13fea4176aab4ec3dadc9e29e82efe967239 (patch)
tree2c4393db5d456af671e4f145684006e76c824976 /lisp/vc/pcvs.el
parent02661b3a811a769064ad91757fb681b52ae8f4a1 (diff)
downloademacs-e01c13fea4176aab4ec3dadc9e29e82efe967239.tar.gz
* lisp/vc/pcvs.el (cvs-cleanup-collection): Keep entries that are currently
visited in a buffer. (cvs-insert-visited-file): New function. (find-file-hook): Use it. * lisp/vc/pcvs-info.el (cvs-fileinfo-pp): Don't use non-existent faces.
Diffstat (limited to 'lisp/vc/pcvs.el')
-rw-r--r--lisp/vc/pcvs.el25
1 files changed, 21 insertions, 4 deletions
diff --git a/lisp/vc/pcvs.el b/lisp/vc/pcvs.el
index 659151a31e9..4bc3eaf8c2c 100644
--- a/lisp/vc/pcvs.el
+++ b/lisp/vc/pcvs.el
@@ -60,8 +60,6 @@
;; - rework the displaying of error messages.
;; - allow to flush messages only
;; - allow to protect files like ChangeLog from flushing
-;; - automatically cvs-mode-insert files from find-file-hook
-;; (and don't flush them as long as they are visited)
;; - query the user for cvs-get-marked (for some cmds or if nothing's selected)
;; - don't return the first (resp last) FI if the cursor is before
;; (resp after) it.
@@ -877,7 +875,10 @@ RM-MSGS if non-nil means remove messages."
;; remove entries
(`DEAD nil)
;; handled also?
- (`UP-TO-DATE (not rm-handled))
+ (`UP-TO-DATE
+ (if (find-buffer-visiting (cvs-fileinfo->full-name fi))
+ t
+ (not rm-handled)))
;; keep the rest
(_ (not (run-hook-with-args-until-success
'cvs-cleanup-functions fi))))))
@@ -1617,7 +1618,8 @@ With prefix argument, prompt for cvs flags."
(defun-cvs-mode (cvs-mode-diff . DOUBLE) (flags)
"Diff the selected files against the repository.
This command compares the files in your working area against the
-revision which they are based upon."
+revision which they are based upon.
+See also `cvs-diff-ignore-marks'."
(interactive
(list (cvs-add-branch-prefix
(cvs-add-secondary-branch-prefix
@@ -2435,6 +2437,21 @@ The exact behavior is determined also by `cvs-dired-use-hook'."
(add-hook 'after-save-hook 'cvs-mark-buffer-changed)
+(defun cvs-insert-visited-file ()
+ (let* ((file (expand-file-name buffer-file-name))
+ (version (and (fboundp 'vc-backend)
+ (eq (vc-backend file) 'CVS)
+ (vc-working-revision file))))
+ (when version
+ (save-current-buffer
+ (dolist (cvs-buf (buffer-list))
+ (set-buffer cvs-buf)
+ ;; look for a corresponding pcl-cvs buffer
+ (when (and (eq major-mode 'cvs-mode)
+ (string-prefix-p default-directory file))
+ (cvs-insert-file file)))))))
+
+(add-hook 'find-file-hook 'cvs-insert-visited-file 'append)
(provide 'pcvs)