summaryrefslogtreecommitdiff
path: root/lisp/vc-arch.el
diff options
context:
space:
mode:
authorDan Nicolaescu <dann@ics.uci.edu>2007-07-30 00:19:06 +0000
committerDan Nicolaescu <dann@ics.uci.edu>2007-07-30 00:19:06 +0000
commiteff23ff37606569028a6ef96ba2481df6b061ec4 (patch)
treed5acc8e64e1e122a74c8bf3cfad654b70217dbd4 /lisp/vc-arch.el
parent463dca7e44715219fe720858d2144d54ea315635 (diff)
downloademacs-eff23ff37606569028a6ef96ba2481df6b061ec4.tar.gz
* vc-git.el: (vc-directory-exclusion-list, vc-handled-backends):
Remove. (vc-git-revision-completion-table): Enable. * vc-hooks.el (vc-handled-backends): Add GIT and HG. * vc.el (vc-directory-exclusion-list): Add .git and .hg. * vc-hg.el (vc-hg-revision-completion-table): Re-enable. * diff-mode.el (diff-mode-menu): New entries. * diff-mode.el (diff-beginning-of-file-and-junk): New function. (diff-file-kill): Use it. (diff-beginning-of-hunk): Add arg `try-harder' using it. (diff-restrict-view, diff-find-source-location, diff-refine-hunk): Use it so they find the hunk even when we're in the file header. * vc.el: Add new VC operation `revision-completion-table'. (vc-default-revision-completion-table): New function. (vc-version-diff, vc-version-other-window): Use it to provide completion of revision names if the backend provides it. * vc-arch.el (vc-arch--version-completion-table) (vc-arch-revision-completion-table): New functions to provide completion of revision names. * vc-cvs.el: Require CL. (vc-cvs-revision-table, vc-cvs-revision-completion-table): New functions to provide completion of revision names. * eval.c (init_eval_once): Bump max_lisp_eval_depth to 400. * vc2-xtra.texi (Customizing VC): Add GIT and HG.
Diffstat (limited to 'lisp/vc-arch.el')
-rw-r--r--lisp/vc-arch.el25
1 files changed, 25 insertions, 0 deletions
diff --git a/lisp/vc-arch.el b/lisp/vc-arch.el
index b0cdea9d31f..68a1b1b5f17 100644
--- a/lisp/vc-arch.el
+++ b/lisp/vc-arch.el
@@ -419,6 +419,31 @@ Return non-nil if FILE is unchanged."
(defun vc-arch-init-version () nil)
+;;; Completion of versions and revisions.
+
+(defun vc-arch--version-completion-table (root string)
+ (delq nil
+ (mapcar
+ (lambda (d)
+ (when (string-match "/\\([^/]+\\)/\\([^/]+\\)\\'" d)
+ (concat (match-string 2 d) "/" (match-string 1 d))))
+ (let ((default-directory root))
+ (file-expand-wildcards
+ (concat "*/*/"
+ (if (string-match "/" string)
+ (concat (substring string (match-end 0))
+ "*/" (substring string 0 (match-beginning 0)))
+ (concat "*/" string))
+ "*"))))))
+
+(defun vc-arch-revision-completion-table (file)
+ (lexical-let ((file file))
+ (lambda (string pred action)
+ ;; FIXME: complete revision patches as well.
+ (let* ((root (expand-file-name "{arch}" (vc-arch-root file)))
+ (table (vc-arch--version-completion-table root string)))
+ (complete-with-action action table string pred)))))
+
;;; Less obvious implementations.
(defun vc-arch-find-version (file rev buffer)