aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2000-06-12 04:53:34 +0000
committerStefan Monnier2000-06-12 04:53:34 +0000
commit6dc7d3d5473fdc64df47d65860a0d60e1e65bcf6 (patch)
tree7c7c1e804805f1e108a06b9c9cbe08a40d61e9d0
parent1fe28d30991cbdfd0aaf0f64e465c0ea0b270cf7 (diff)
downloademacs-6dc7d3d5473fdc64df47d65860a0d60e1e65bcf6.tar.gz
emacs-6dc7d3d5473fdc64df47d65860a0d60e1e65bcf6.zip
(cvs-parse-process): Don't blindly refresh all cookies.
(cvs-cleanup-removed): New function. (cvs-cleanup-functions): New var. (cvs-cleanup-collection): Use cvs-cleanup-functions to allow the user some flexibility in specifying additional entries to auto-cleanup. (cvs-quickdir): New function. (cvs-mode-insert): Use cvs-fileinfo-from-entries. (cvs-mode-imerge): Use smerge-ediff rather than vc-resolve-conflicts. (cvs-mode-find-file): Check that we are on a filename or dirname when invoked through a mouse-click. (cvs-full-path): Remove. (cvs-dired-action): Re-introduced. (cvs-dired-noselect): Use it. (vc-post-command-functions): use this new hook if available.
-rw-r--r--lisp/ChangeLog38
-rw-r--r--lisp/pcvs.el161
2 files changed, 131 insertions, 68 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3b2a5049cb2..da6431fde31 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,41 @@
12000-06-12 Stefan Monnier <monnier@cs.yale.edu>
2
3 * pcvs.el (cvs-parse-process): Don't blindly refresh all cookies.
4 (cvs-cleanup-removed): New function.
5 (cvs-cleanup-functions): New var.
6 (cvs-cleanup-collection): Use cvs-cleanup-functions to allow the user
7 some flexibility in specifying additional entries to auto-cleanup.
8 (cvs-quickdir): New function.
9 (cvs-mode-insert): Use cvs-fileinfo-from-entries.
10 (cvs-mode-imerge): Use smerge-ediff rather than vc-resolve-conflicts.
11 (cvs-mode-find-file): Check that we are on a filename or dirname
12 when invoked through a mouse-click.
13 (cvs-full-path): Remove.
14 (cvs-dired-action): Re-introduced.
15 (cvs-dired-noselect): Use it.
16 (vc-post-command-functions): use this new hook if available.
17
18 * pcvs-info.el (cvs-fi-up-to-date-face, cvs-fi-unknown-face): New vars.
19 (cvs-status-map): Don't inherit from cvs-mode-map anymore.
20 (cvs-filename-map, cvs-dirname-map): Remove.
21 (cvs-default-action): Remove.
22 (cvs-add-face): Use `keymap' rather than `local-map' property, and only
23 if the arg is really a keymap.
24 (cvs-fileinfo-pp): Don't use any special map for file and dir names.
25 Don't hardcode the mapping from state (aka type) to face, but check
26 the var cvs-fi-<type>-face instead.
27 (cvs-fileinfo-from-entries): New function.
28
29 * pcvs-defs.el (cvs-default-ignore-marks, cvs-diff-ignore-marks):
30 Docstring fix.
31 (cvs-find-file-and-jump): Change default to be safer.
32 (cvs-mode-diff-map): Define it as a function as well.
33 (cvs-mode-map): Refer to the function variant of cvs-mode-diff-map.
34 Bind mouse-2 in this global map rather than with text-properties.
35
36 * pcvs-parse.el (cvs-parse-table): Look for conflict markers in the
37 file to resolve the ambiguity between C(conflict) and C(need-merge).
38
12000-06-12 Kenichi Handa <handa@etl.go.jp> 392000-06-12 Kenichi Handa <handa@etl.go.jp>
2 40
3 * international/mule.el (set-buffer-file-coding-system): If 41 * international/mule.el (set-buffer-file-coding-system): If
diff --git a/lisp/pcvs.el b/lisp/pcvs.el
index 30cbcdfa7d2..c2e587d69fe 100644
--- a/lisp/pcvs.el
+++ b/lisp/pcvs.el
@@ -14,7 +14,7 @@
14;; Maintainer: (Stefan Monnier) monnier+lists/cvs/pcl@flint.cs.yale.edu 14;; Maintainer: (Stefan Monnier) monnier+lists/cvs/pcl@flint.cs.yale.edu
15;; Keywords: CVS, version control, release management 15;; Keywords: CVS, version control, release management
16;; Version: $Name: $ 16;; Version: $Name: $
17;; Revision: $Id: pcvs.el,v 1.2 2000/03/22 02:56:55 monnier Exp $ 17;; Revision: $Id: pcvs.el,v 1.3 2000/05/10 22:28:36 monnier Exp $
18 18
19;; This file is part of GNU Emacs. 19;; This file is part of GNU Emacs.
20 20
@@ -58,8 +58,6 @@
58;; ******** FIX THE DOCUMENTATION ********* 58;; ******** FIX THE DOCUMENTATION *********
59;; 59;;
60;; - proper `g' that passes safe args and uses either cvs-status or cvs-examine 60;; - proper `g' that passes safe args and uses either cvs-status or cvs-examine
61;; - write cvs-fast-examine that parses CVS/Entries instead of running cvs
62;; we could even steal code from vc-cvs-hooks for that.
63;; - add toolbar entries 61;; - add toolbar entries
64;; - marking 62;; - marking
65;; marking directories should jump to just after the dir. 63;; marking directories should jump to just after the dir.
@@ -68,7 +66,6 @@
68;; - liveness indicator 66;; - liveness indicator
69;; - indicate in docstring if the cmd understands the `b' prefix(es). 67;; - indicate in docstring if the cmd understands the `b' prefix(es).
70;; - call smerge-mode when opening CONFLICT files. 68;; - call smerge-mode when opening CONFLICT files.
71;; - after-parse-hook (to eliminate *.elc from Emacs' CVS repository :-)
72;; - have vc-checkin delegate to cvs-mode-commit when applicable 69;; - have vc-checkin delegate to cvs-mode-commit when applicable
73;; - higher-level CVS operations 70;; - higher-level CVS operations
74;; cvs-mode-rename 71;; cvs-mode-rename
@@ -87,11 +84,12 @@
87;; (with completion on tag names and hooks to 84;; (with completion on tag names and hooks to
88;; help generate full releases) 85;; help generate full releases)
89;; - allow cvs-cmd-do to either clear the marks or not. 86;; - allow cvs-cmd-do to either clear the marks or not.
90;; - allow more concurrency: if the output buffer is busy, pick a new one.
91;; - display stickiness information. And current CVS/Tag as well. 87;; - display stickiness information. And current CVS/Tag as well.
92;; - write 'cvs-mode-admin' to do arbitrary 'cvs admin' commands 88;; - write 'cvs-mode-admin' to do arbitrary 'cvs admin' commands
89;; Most interesting would be version removal and log message replacement.
90;; The last one would be neat when called from log-view-mode.
93;; - cvs-mode-incorporate 91;; - cvs-mode-incorporate
94;; It would merge in the status from one ``*cvs*'' buffer into another. 92;; It would merge in the status from one *cvs* buffer into another.
95;; This would be used to populate such a buffer that had been created with 93;; This would be used to populate such a buffer that had been created with
96;; a `cvs {update,status,checkout} -l'. 94;; a `cvs {update,status,checkout} -l'.
97;; - cvs-mode-(i)diff-other-{file,buffer,cvs-buffer} 95;; - cvs-mode-(i)diff-other-{file,buffer,cvs-buffer}
@@ -151,7 +149,7 @@
151(cvs-flags-define cvs-checkout-flags (cvs-defaults '("-P"))) 149(cvs-flags-define cvs-checkout-flags (cvs-defaults '("-P")))
152(cvs-flags-define cvs-status-flags (cvs-defaults '("-v") nil)) 150(cvs-flags-define cvs-status-flags (cvs-defaults '("-v") nil))
153(cvs-flags-define cvs-log-flags (cvs-defaults nil)) 151(cvs-flags-define cvs-log-flags (cvs-defaults nil))
154(cvs-flags-define cvs-diff-flags (cvs-defaults '("-u" "-N") '("-c" "-N"))) 152(cvs-flags-define cvs-diff-flags (cvs-defaults '("-u" "-N") '("-c" "-N") '("-u" "-b")))
155(cvs-flags-define cvs-tag-flags (cvs-defaults nil)) 153(cvs-flags-define cvs-tag-flags (cvs-defaults nil))
156(cvs-flags-define cvs-add-flags (cvs-defaults nil)) 154(cvs-flags-define cvs-add-flags (cvs-defaults nil))
157(cvs-flags-define cvs-commit-flags (cvs-defaults nil)) 155(cvs-flags-define cvs-commit-flags (cvs-defaults nil))
@@ -458,9 +456,9 @@ Working dir: " (abbreviate-file-name dir) "
458 (cvsbuf (cvs-make-cvs-buffer dir new))) 456 (cvsbuf (cvs-make-cvs-buffer dir new)))
459 ;; Check that dir is under CVS control. 457 ;; Check that dir is under CVS control.
460 (unless (file-directory-p dir) 458 (unless (file-directory-p dir)
461 (error "%s is not a directory." dir)) 459 (error "%s is not a directory" dir))
462 (unless (or noexist (file-directory-p (expand-file-name "CVS" dir))) 460 (unless (or noexist (file-directory-p (expand-file-name "CVS" dir)))
463 (error "%s does not contain CVS controlled files." dir)) 461 (error "%s does not contain CVS controlled files" dir))
464 462
465 (set-buffer cvsbuf) 463 (set-buffer cvsbuf)
466 (cvs-mode-run cmd flags fis 464 (cvs-mode-run cmd flags fis
@@ -472,7 +470,6 @@ Working dir: " (abbreviate-file-name dir) "
472;; 'pop-to-buffer 'switch-to-buffer) 470;; 'pop-to-buffer 'switch-to-buffer)
473;; cvsbuf)))) 471;; cvsbuf))))
474 472
475;;----------
476(defun cvs-run-process (args fis postprocess &optional single-dir) 473(defun cvs-run-process (args fis postprocess &optional single-dir)
477 (assert (cvs-buffer-p cvs-buffer)) 474 (assert (cvs-buffer-p cvs-buffer))
478 (save-current-buffer 475 (save-current-buffer
@@ -590,7 +587,6 @@ Working dir: " (abbreviate-file-name dir) "
590 prev-msg)))))) 587 prev-msg))))))
591 588
592 589
593;;----------
594(defun cvs-sentinel (proc msg) 590(defun cvs-sentinel (proc msg)
595 "Sentinel for the cvs update process. 591 "Sentinel for the cvs update process.
596This is responsible for parsing the output from the cvs update when 592This is responsible for parsing the output from the cvs update when
@@ -622,7 +618,6 @@ it is finished."
622 ;; This might not even be necessary 618 ;; This might not even be necessary
623 (set-buffer obuf))))) 619 (set-buffer obuf)))))
624 620
625;;----------
626(defun cvs-parse-process (dcd &optional subdir) 621(defun cvs-parse-process (dcd &optional subdir)
627 "FIXME: bad name, no doc" 622 "FIXME: bad name, no doc"
628 (let* ((from-buf (current-buffer)) 623 (let* ((from-buf (current-buffer))
@@ -638,7 +633,7 @@ it is finished."
638 cvs-auto-remove-directories 633 cvs-auto-remove-directories
639 nil) 634 nil)
640 ;; update the display (might be unnecessary) 635 ;; update the display (might be unnecessary)
641 (ewoc-refresh cvs-cookies) 636 ;;(ewoc-refresh cvs-cookies)
642 ;; revert buffers if necessary 637 ;; revert buffers if necessary
643 (when (and cvs-auto-revert (not dcd) (not cvs-from-vc)) 638 (when (and cvs-auto-revert (not dcd) (not cvs-from-vc))
644 (cvs-revert-if-needed fileinfos)) 639 (cvs-revert-if-needed fileinfos))
@@ -735,6 +730,24 @@ TIN specifies an optional starting point."
735 (ewoc-invalidate c tin)) 730 (ewoc-invalidate c tin))
736 tin))) 731 tin)))
737 732
733(defcustom cvs-cleanup-functions nil
734 "Functions to tweak the cleanup process.
735The functions are called with a single argument (a FILEINFO) and should
736return a non-nil value if that fileinfo should be removed."
737 :group 'pcl-cvs
738 :type '(hook :options (cvs-cleanup-removed)))
739
740(defun cvs-cleanup-removed (fi)
741 "Non-nil if FI has been cvs-removed but still exists.
742This is intended for use on `cvs-cleanup-functions' when you have cvs-removed
743automatically generated files (which should hence not be under CVS control)
744but can't commit the removal because the repository's owner doesn't understand
745the problem."
746 (and (or (eq (cvs-fileinfo->type fi) 'REMOVED)
747 (and (eq (cvs-fileinfo->type fi) 'CONFLICT)
748 (eq (cvs-fileinfo->subtype fi) 'REMOVED)))
749 (file-exists-p (cvs-fileinfo->full-path fi))))
750
738;; called at the following times: 751;; called at the following times:
739;; - postparse ((eq cvs-auto-remove-handled t) cvs-auto-remove-directories nil) 752;; - postparse ((eq cvs-auto-remove-handled t) cvs-auto-remove-directories nil)
740;; - pre-run ((eq cvs-auto-remove-handled 'delayed) nil t) 753;; - pre-run ((eq cvs-auto-remove-handled 'delayed) nil t)
@@ -767,7 +780,8 @@ RM-MSGS if non-nil means remove messages."
767 ;; handled also? 780 ;; handled also?
768 (UP-TO-DATE (not rm-handled)) 781 (UP-TO-DATE (not rm-handled))
769 ;; keep the rest 782 ;; keep the rest
770 (t t)))) 783 (t (not (run-hook-with-args-until-success
784 'cvs-cleanup-functions fi))))))
771 785
772 ;; mark dirs for removal 786 ;; mark dirs for removal
773 (when (and keep rm-dirs 787 (when (and keep rm-dirs
@@ -856,6 +870,35 @@ With a prefix argument, prompt for cvs FLAGS to use."
856 default-directory 870 default-directory
857 (read-file-name msg nil default-directory nil))) 871 (read-file-name msg nil default-directory nil)))
858 872
873;;;###autoload
874(defun cvs-quickdir (dir &optional flags noshow)
875 "Open a *cvs* buffer on DIR without running cvs.
876With a prefix argument, prompt for a directory to use.
877A prefix arg >8 (ex: \\[universal-argument] \\[universal-argument]),
878 prevents reuse of an existing *cvs* buffer.
879Optional argument NOSHOW if non-nil means not to display the buffer.
880FLAGS is ignored."
881 (interactive (list (cvs-query-directory "CVS quickdir (directory): ")))
882 ;; FIXME: code duplication with cvs-cmd-do and cvs-parse-process
883 (let* ((dir (file-name-as-directory
884 (abbreviate-file-name (expand-file-name dir))))
885 (new (> (prefix-numeric-value current-prefix-arg) 8))
886 (cvsbuf (cvs-make-cvs-buffer dir new))
887 last)
888 ;; Check that dir is under CVS control.
889 (unless (file-directory-p dir)
890 (error "%s is not a directory" dir))
891 (unless (file-directory-p (expand-file-name "CVS" dir))
892 (error "%s does not contain CVS controlled files" dir))
893 (set-buffer cvsbuf)
894 (dolist (fi (cvs-fileinfo-from-entries ""))
895 (setq last (cvs-addto-collection cvs-cookies fi last)))
896 (cvs-cleanup-collection cvs-cookies
897 (eq cvs-auto-remove-handled t)
898 cvs-auto-remove-directories
899 nil)
900 (if noshow cvsbuf
901 (let ((pop-up-windows nil)) (pop-to-buffer cvsbuf)))))
859 902
860;;;###autoload 903;;;###autoload
861(defun cvs-examine (directory flags &optional noshow) 904(defun cvs-examine (directory flags &optional noshow)
@@ -908,7 +951,6 @@ Optional argument NOSHOW if non-nil means not to display the buffer."
908 (> (prefix-numeric-value current-prefix-arg) 8) 951 (> (prefix-numeric-value current-prefix-arg) 8)
909 :noshow noshow :dont-change-disc t)) 952 :noshow noshow :dont-change-disc t))
910 953
911;;----------
912(defun cvs-update-filter (proc string) 954(defun cvs-update-filter (proc string)
913 "Filter function for pcl-cvs. 955 "Filter function for pcl-cvs.
914This function gets the output that CVS sends to stdout. It inserts 956This function gets the output that CVS sends to stdout. It inserts
@@ -961,7 +1003,6 @@ the override will persist until the next toggle."
961 (interactive "P") 1003 (interactive "P")
962 (cvs-prefix-set 'cvs-force-command arg)) 1004 (cvs-prefix-set 'cvs-force-command arg))
963 1005
964;;----------
965(put 'cvs-mode 'mode-class 'special) 1006(put 'cvs-mode 'mode-class 'special)
966(define-derived-mode cvs-mode fundamental-mode "CVS" 1007(define-derived-mode cvs-mode fundamental-mode "CVS"
967 "Mode used for PCL-CVS, a frontend to CVS. 1008 "Mode used for PCL-CVS, a frontend to CVS.
@@ -1291,19 +1332,9 @@ The POSTPROC specified there (typically `cvs-edit') is then called,
1291 (ignore-errors 1332 (ignore-errors
1292 (cvs-fileinfo->dir 1333 (cvs-fileinfo->dir
1293 (car (cvs-mode-marked nil nil :read-only t))))))) 1334 (car (cvs-mode-marked nil nil :read-only t)))))))
1294 (let ((file (file-relative-name (directory-file-name file)))) 1335 (let ((file (file-relative-name (directory-file-name file))) last)
1295 (if (file-directory-p file) 1336 (dolist (fi (cvs-fileinfo-from-entries file))
1296 (let ((fi (cvs-create-fileinfo 'DIRCHANGE 1337 (setq last (cvs-addto-collection cvs-cookies fi last)))))
1297 (file-name-as-directory file)
1298 "."
1299 "cvs-mode-insert")))
1300 (cvs-addto-collection cvs-cookies fi))
1301 (let ((fi (cvs-create-fileinfo 'UNKNOWN
1302 (or (file-name-directory file) "")
1303 (file-name-nondirectory file)
1304 "cvs-mode-insert")))
1305 (cvs-mode-run "status" (cvs-flags-query 'cvs-status-flags nil 'noquery)
1306 (list fi) :dont-change-disc t)))))
1307 1338
1308(defun-cvs-mode (cvs-mode-add . SIMPLE) (flags) 1339(defun-cvs-mode (cvs-mode-add . SIMPLE) (flags)
1309 "Add marked files to the cvs repository. 1340 "Add marked files to the cvs repository.
@@ -1331,7 +1362,6 @@ With prefix argument, prompt for cvs flags."
1331 (dolist (fi ',dirs) (setf (cvs-fileinfo->type fi) 'DEAD)))))) 1362 (dolist (fi ',dirs) (setf (cvs-fileinfo->type fi) 'DEAD))))))
1332 (cvs-mode-run "add" flags fis :postproc postproc)))) 1363 (cvs-mode-run "add" flags fis :postproc postproc))))
1333 1364
1334;;----------
1335(defun-cvs-mode (cvs-mode-diff . DOUBLE) (flags) 1365(defun-cvs-mode (cvs-mode-diff . DOUBLE) (flags)
1336 "Diff the selected files against the repository. 1366 "Diff the selected files against the repository.
1337This command compares the files in your working area against the 1367This command compares the files in your working area against the
@@ -1343,21 +1373,18 @@ revision which they are based upon."
1343 (cvs-mode-do "diff" flags 'diff 1373 (cvs-mode-do "diff" flags 'diff
1344 :show t)) ;; :ignore-exit t 1374 :show t)) ;; :ignore-exit t
1345 1375
1346;;----------
1347(defun-cvs-mode (cvs-mode-diff-head . SIMPLE) (flags) 1376(defun-cvs-mode (cvs-mode-diff-head . SIMPLE) (flags)
1348 "Diff the selected files against the head of the current branch. 1377 "Diff the selected files against the head of the current branch.
1349See ``cvs-mode-diff'' for more info." 1378See ``cvs-mode-diff'' for more info."
1350 (interactive (list (cvs-flags-query 'cvs-diff-flags "cvs diff flags"))) 1379 (interactive (list (cvs-flags-query 'cvs-diff-flags "cvs diff flags")))
1351 (cvs-mode-diff-1 (cons "-rHEAD" flags))) 1380 (cvs-mode-diff-1 (cons "-rHEAD" flags)))
1352 1381
1353;;----------
1354(defun-cvs-mode (cvs-mode-diff-vendor . SIMPLE) (flags) 1382(defun-cvs-mode (cvs-mode-diff-vendor . SIMPLE) (flags)
1355 "Diff the selected files against the head of the vendor branch. 1383 "Diff the selected files against the head of the vendor branch.
1356See ``cvs-mode-diff'' for more info." 1384See ``cvs-mode-diff'' for more info."
1357 (interactive (list (cvs-flags-query 'cvs-diff-flags "cvs diff flags"))) 1385 (interactive (list (cvs-flags-query 'cvs-diff-flags "cvs diff flags")))
1358 (cvs-mode-diff-1 (cons (concat "-r" cvs-vendor-branch) flags))) 1386 (cvs-mode-diff-1 (cons (concat "-r" cvs-vendor-branch) flags)))
1359 1387
1360;;----------
1361;; sadly, this is not provided by cvs, so we have to roll our own 1388;; sadly, this is not provided by cvs, so we have to roll our own
1362(defun-cvs-mode (cvs-mode-diff-backup . SIMPLE) (flags) 1389(defun-cvs-mode (cvs-mode-diff-backup . SIMPLE) (flags)
1363 "Diff the files against the backup file. 1390 "Diff the files against the backup file.
@@ -1381,13 +1408,6 @@ or \"Conflict\" in the *cvs* buffer."
1381 cvs-diff-program flags)) 1408 cvs-diff-program flags))
1382 (message "cvs diff backup... Done.")) 1409 (message "cvs diff backup... Done."))
1383 1410
1384;;----------
1385;; (defun cvs-backup-diffable-p (fi)
1386;; "Check if the TIN is backup-diffable.
1387;; It must have a backup file to be diffable."
1388;; (cvs-fileinfo->backup-file fi))
1389
1390;;----------
1391(defun cvs-diff-backup-extractor (fileinfo) 1411(defun cvs-diff-backup-extractor (fileinfo)
1392 "Return the filename and the name of the backup file as a list. 1412 "Return the filename and the name of the backup file as a list.
1393Signal an error if there is no backup file." 1413Signal an error if there is no backup file."
@@ -1463,8 +1483,11 @@ Signal an error if there is no backup file."
1463 (message "Retrieving revision %s... Done" rev) 1483 (message "Retrieving revision %s... Done" rev)
1464 buf)))) 1484 buf))))
1465 1485
1466(eval-and-compile (autoload 'vc-resolve-conflicts "vc")) 1486(eval-and-compile (autoload 'smerge-ediff "smerge-mode"))
1467 1487
1488;; FIXME: The user should be able to specify ancestor/head/backup and we should
1489;; provide sensible defaults when merge info is unavailable (rather than rely
1490;; on smerge-ediff). Also provide sane defaults for need-merge files.
1468(defun-cvs-mode cvs-mode-imerge () 1491(defun-cvs-mode cvs-mode-imerge ()
1469 "Merge interactively appropriate revisions of the selected file." 1492 "Merge interactively appropriate revisions of the selected file."
1470 (interactive) 1493 (interactive)
@@ -1475,9 +1498,8 @@ Signal an error if there is no backup file."
1475 (if (not (and merge backup-file)) 1498 (if (not (and merge backup-file))
1476 (let ((buf (find-file-noselect file))) 1499 (let ((buf (find-file-noselect file)))
1477 (message "Missing merge info or backup file, using VC.") 1500 (message "Missing merge info or backup file, using VC.")
1478 (save-excursion 1501 (with-current-buffer buf
1479 (set-buffer buf) 1502 (smerge-ediff)))
1480 (vc-resolve-conflicts)))
1481 (let* ((ancestor-buf (cvs-retrieve-revision fi (car merge))) 1503 (let* ((ancestor-buf (cvs-retrieve-revision fi (car merge)))
1482 (head-buf (cvs-retrieve-revision fi (cdr merge))) 1504 (head-buf (cvs-retrieve-revision fi (cdr merge)))
1483 (backup-buf (let ((auto-mode-alist nil)) 1505 (backup-buf (let ((auto-mode-alist nil))
@@ -1710,7 +1732,10 @@ This command ignores files that are not flagged as `Unknown'."
1710 "Select a buffer containing the file. 1732 "Select a buffer containing the file.
1711With a prefix, opens the buffer in an OTHER window." 1733With a prefix, opens the buffer in an OTHER window."
1712 (interactive (list last-input-event current-prefix-arg)) 1734 (interactive (list last-input-event current-prefix-arg))
1713 (ignore-errors (mouse-set-point e)) ;for invocation via the mouse 1735 (when (ignore-errors (mouse-set-point e) t) ;for invocation via the mouse
1736 (unless (memq (get-text-property (point) 'face)
1737 '(cvs-dirname-face cvs-filename-face))
1738 (error "Not a file name")))
1714 (cvs-mode! 1739 (cvs-mode!
1715 (lambda (&optional rev) 1740 (lambda (&optional rev)
1716 (interactive (list (cvs-prefix-get 'cvs-branch-prefix))) 1741 (interactive (list (cvs-prefix-get 'cvs-branch-prefix)))
@@ -1800,11 +1825,6 @@ Empty directories are removed."
1800 (setf (cvs-fileinfo->type fi) 'DEAD)) 1825 (setf (cvs-fileinfo->type fi) 'DEAD))
1801 (cvs-cleanup-collection cvs-cookies nil nil nil)) 1826 (cvs-cleanup-collection cvs-cookies nil nil nil))
1802 1827
1803;;----------
1804(defun cvs-insert-full-path (tin)
1805 "Insert full path to the file described in TIN in the current buffer."
1806 (insert (format "%s\n" (cvs-full-path tin))))
1807
1808(defun cvs-do-removal (filter &optional cmd all) 1828(defun cvs-do-removal (filter &optional cmd all)
1809 "Remove files. 1829 "Remove files.
1810Returns a list of FIS that should be `cvs remove'd." 1830Returns a list of FIS that should be `cvs remove'd."
@@ -1877,7 +1897,6 @@ With prefix argument, prompt for cvs flags."
1877 1897
1878;; ChangeLog support. 1898;; ChangeLog support.
1879 1899
1880;;----------
1881(defun-cvs-mode cvs-mode-add-change-log-entry-other-window () 1900(defun-cvs-mode cvs-mode-add-change-log-entry-other-window ()
1882 "Add a ChangeLog entry in the ChangeLog of the current directory." 1901 "Add a ChangeLog entry in the ChangeLog of the current directory."
1883 (interactive) 1902 (interactive)
@@ -1911,12 +1930,6 @@ With prefix argument, prompt for cvs flags."
1911;;;; Utilities for the *cvs* buffer 1930;;;; Utilities for the *cvs* buffer
1912;;;; 1931;;;;
1913 1932
1914;;----------
1915(defun cvs-full-path (tin)
1916 "Return the full path for the file that is described in TIN."
1917 (cvs-fileinfo->full-path (ewoc-data tin)))
1918
1919;;----------
1920(defun cvs-dir-member-p (fileinfo dir) 1933(defun cvs-dir-member-p (fileinfo dir)
1921 "Return true if FILEINFO represents a file in directory DIR." 1934 "Return true if FILEINFO represents a file in directory DIR."
1922 (and (not (eq (cvs-fileinfo->type fileinfo) 'DIRCHANGE)) 1935 (and (not (eq (cvs-fileinfo->type fileinfo) 'DIRCHANGE))
@@ -1999,6 +2012,13 @@ this file, or a list of arguments to send to the program."
1999;; 2012;;
2000 2013
2001;;;###autoload 2014;;;###autoload
2015(defcustom cvs-dired-action 'cvs-examine
2016 "The action to be performed when opening a CVS directory.
2017Sensible values are `cvs-examine', `cvs-status' and `cvs-quickdir'."
2018 :group 'pcl-cvs
2019 :type '(choice (const cvs-examine) (const cvs-status) (const cvs-quickdir)))
2020
2021;;;###autoload
2002(defcustom cvs-dired-use-hook '(4) 2022(defcustom cvs-dired-use-hook '(4)
2003 "Whether or not opening a CVS directory should run PCL-CVS. 2023 "Whether or not opening a CVS directory should run PCL-CVS.
2004NIL means never do it. 2024NIL means never do it.
@@ -2023,22 +2043,27 @@ The exact behavior is determined also by `cvs-dired-use-hook'."
2023 (not current-prefix-arg) 2043 (not current-prefix-arg)
2024 (equal current-prefix-arg cvs-dired-use-hook))) 2044 (equal current-prefix-arg cvs-dired-use-hook)))
2025 (save-excursion 2045 (save-excursion
2026 (cvs-examine (file-name-directory dir) t t)))))) 2046 (funcall cvs-dired-action (file-name-directory dir) t t))))))
2027 2047
2028;; 2048;;
2029;; hook into VC 2049;; hook into VC
2030;; 2050;;
2031 2051
2032(defadvice vc-simple-command (after pcl-cvs-vc activate) 2052(if (boundp 'vc-post-command-functions)
2033 (cvs-vc-command-advice "*vc-info*" (ad-get-arg 1) (ad-get-arg 3))) 2053 ;; Hook into the new VC.
2034 2054 (add-hook 'vc-post-command-functions
2035(defadvice vc-do-command (after pcl-cvs-vc activate) 2055 (lambda (cmd file flags)
2036 (cvs-vc-command-advice (if (eq t (ad-get-arg 0)) (current-buffer) 2056 (cvs-vc-command-advice (current-buffer) cmd (car flags))))
2037 (or (ad-get-arg 0) "*vc*")) 2057 ;; Hook into the old VC.
2038 (ad-get-arg 2) 2058 (defadvice vc-simple-command (after pcl-cvs-vc activate)
2039 (if (stringp (ad-get-arg 4)) 2059 (cvs-vc-command-advice "*vc-info*" (ad-get-arg 1) (ad-get-arg 3)))
2040 (ad-get-arg 4) 2060 (defadvice vc-do-command (after pcl-cvs-vc activate)
2041 (ad-get-arg 5)))) 2061 (cvs-vc-command-advice (if (eq t (ad-get-arg 0)) (current-buffer)
2062 (or (ad-get-arg 0) "*vc*"))
2063 (ad-get-arg 2)
2064 (if (stringp (ad-get-arg 4))
2065 (ad-get-arg 4)
2066 (ad-get-arg 5)))))
2042 2067
2043(defun cvs-vc-command-advice (buffer command cvscmd) 2068(defun cvs-vc-command-advice (buffer command cvscmd)
2044 (when (and (setq buffer (get-buffer buffer)) 2069 (when (and (setq buffer (get-buffer buffer))