Mercurial > emacs
comparison lisp/vc-cvs.el @ 81821:0d37b602a4f0
Require CL.
(vc-cvs-revision-table, vc-cvs-revision-completion-table):
New functions to provide completion of revision names.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Thu, 12 Jul 2007 03:13:37 +0000 |
parents | 37a7f9bddc45 |
children | 0744b309302b a66921565bcb |
comparison
equal
deleted
inserted
replaced
81820:37a7f9bddc45 | 81821:0d37b602a4f0 |
---|---|
27 | 27 |
28 ;;; Commentary: | 28 ;;; Commentary: |
29 | 29 |
30 ;;; Code: | 30 ;;; Code: |
31 | 31 |
32 (eval-when-compile | 32 (eval-when-compile (require 'cl) (require 'vc)) |
33 (require 'vc)) | |
34 | 33 |
35 ;; Clear up the cache to force vc-call to check again and discover | 34 ;; Clear up the cache to force vc-call to check again and discover |
36 ;; new functions when we reload this file. | 35 ;; new functions when we reload this file. |
37 (put 'CVS 'vc-functions nil) | 36 (put 'CVS 'vc-functions nil) |
38 | 37 |
930 (if set-state (vc-file-setprop file 'vc-state 'up-to-date))) | 929 (if set-state (vc-file-setprop file 'vc-state 'up-to-date))) |
931 (t | 930 (t |
932 (vc-file-setprop file 'vc-checkout-time 0) | 931 (vc-file-setprop file 'vc-checkout-time 0) |
933 (if set-state (vc-file-setprop file 'vc-state 'edited))))))))) | 932 (if set-state (vc-file-setprop file 'vc-state 'edited))))))))) |
934 | 933 |
934 ;; Completion of revision names. | |
935 ;; Just so I don't feel like I'm duplicating code from pcl-cvs, I'll use | |
936 ;; `cvs log' so I can list all the revision numbers rather than only | |
937 ;; tag names. | |
938 | |
939 (defun vc-cvs-revision-table (file) | |
940 (let ((default-directory (file-name-directory file)) | |
941 (res nil)) | |
942 (with-temp-buffer | |
943 (vc-cvs-command t nil file "log") | |
944 (goto-char (point-min)) | |
945 (when (re-search-forward "^symbolic names:\n" nil t) | |
946 (while (looking-at "^ \\(.*\\): \\(.*\\)") | |
947 (push (cons (match-string 1) (match-string 2)) res) | |
948 (forward-line 1))) | |
949 (while (re-search-forward "^revision \\([0-9.]+\\)" nil t) | |
950 (push (match-string 1) res)) | |
951 res))) | |
952 | |
953 (defun vc-cvs-revision-completion-table (file) | |
954 (lexical-let ((file file) | |
955 table) | |
956 (setq table (lazy-completion-table | |
957 table (lambda () (vc-cvs-revision-table file)))) | |
958 table)) | |
959 | |
960 | |
935 (provide 'vc-cvs) | 961 (provide 'vc-cvs) |
936 | 962 |
937 ;;; arch-tag: 60e1402a-aa53-4607-927a-cf74f144b432 | 963 ;; arch-tag: 60e1402a-aa53-4607-927a-cf74f144b432 |
938 ;;; vc-cvs.el ends here | 964 ;;; vc-cvs.el ends here |