emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/vc-arch.el,v [EMACS_22_BASE]


From: Dan Nicolaescu
Subject: [Emacs-diffs] Changes to emacs/lisp/vc-arch.el,v [EMACS_22_BASE]
Date: Mon, 30 Jul 2007 00:19:14 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Branch:         EMACS_22_BASE
Changes by:     Dan Nicolaescu <dann>   07/07/30 00:19:07

Index: lisp/vc-arch.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/vc-arch.el,v
retrieving revision 1.24.2.1
retrieving revision 1.24.2.2
diff -u -b -r1.24.2.1 -r1.24.2.2
--- lisp/vc-arch.el     25 Jul 2007 04:46:56 -0000      1.24.2.1
+++ lisp/vc-arch.el     30 Jul 2007 00:19:01 -0000      1.24.2.2
@@ -419,6 +419,31 @@
 
 (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)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]