aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2007-07-12 03:13:37 +0000
committerStefan Monnier2007-07-12 03:13:37 +0000
commit2346acf6ba2016deecfa5c7dba3de75a7c9289ae (patch)
tree5cd38af0f46a7fee5e53f3d1b19df102ee1957d4
parent98ad325cb3594f67360210e7c29238d4f8fdb970 (diff)
downloademacs-2346acf6ba2016deecfa5c7dba3de75a7c9289ae.tar.gz
emacs-2346acf6ba2016deecfa5c7dba3de75a7c9289ae.zip
Require CL.
(vc-cvs-revision-table, vc-cvs-revision-completion-table): New functions to provide completion of revision names.
-rw-r--r--lisp/ChangeLog11
-rw-r--r--lisp/vc-cvs.el32
2 files changed, 40 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 69c7f3fb0be..e5273d5e7d9 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,14 @@
12007-07-12 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * vc-cvs.el: Require CL.
4 (vc-cvs-revision-table, vc-cvs-revision-completion-table):
5 New functions to provide completion of revision names.
6
7 * vc-cvs.el (vc-functions): Clear up the cache when reloading the file.
8 (vc-cvs-annotate-first-line-re): New const.
9 (vc-cvs-annotate-process-filter): New fun.
10 (vc-cvs-annotate-command): Use them and run the command asynchronously.
11
12007-07-12 Paul Pogonyshev <pogonyshev@gmx.net> 122007-07-12 Paul Pogonyshev <pogonyshev@gmx.net>
2 13
3 * emacs-lisp/eldoc.el (eldoc-last-data): Revise documentation. 14 * emacs-lisp/eldoc.el (eldoc-last-data): Revise documentation.
diff --git a/lisp/vc-cvs.el b/lisp/vc-cvs.el
index f5afcca581d..22ed10d1286 100644
--- a/lisp/vc-cvs.el
+++ b/lisp/vc-cvs.el
@@ -29,8 +29,7 @@
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.
@@ -932,7 +931,34 @@ is non-nil."
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