summaryrefslogtreecommitdiff
path: root/lisp/vc-bzr.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2009-10-30 05:48:13 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2009-10-30 05:48:13 +0000
commit00f71f399096a154ccb61be9c362866ea045200b (patch)
tree19ea585cb17c2d00a7d5782f903e6f179f03df7d /lisp/vc-bzr.el
parent0816d744fb81400c736c1827b9c4332abd8fbabc (diff)
downloademacs-00f71f399096a154ccb61be9c362866ea045200b.tar.gz
(vc-bzr-revision-keywords): New var.
(vc-bzr-revision-completion-table): Use it to fix completion of "s:" to "submit:".
Diffstat (limited to 'lisp/vc-bzr.el')
-rw-r--r--lisp/vc-bzr.el30
1 files changed, 20 insertions, 10 deletions
diff --git a/lisp/vc-bzr.el b/lisp/vc-bzr.el
index b5118538cff..c5d951a48f4 100644
--- a/lisp/vc-bzr.el
+++ b/lisp/vc-bzr.el
@@ -728,6 +728,11 @@ stream. Standard error output is discarded."
;;; Revision completion
+(eval-and-compile
+ (defconst vc-bzr-revision-keywords
+ '("revno" "revid" "last" "before"
+ "tag" "date" "ancestor" "branch" "submit")))
+
(defun vc-bzr-revision-completion-table (files)
(lexical-let ((files files))
;; What about using `files'?!? --Stef
@@ -762,20 +767,25 @@ stream. Standard error output is discarded."
(push (match-string-no-properties 1) table)))
(completion-table-with-context prefix table tag pred action)))
- ((string-match "\\`\\(revid\\):" string)
- ;; FIXME: How can I get a list of revision ids?
- )
- ((eq (car-safe action) 'boundaries)
- (list* 'boundaries
- (string-match "[^:]*\\'" string)
- (string-match ":" (cdr action))))
+ ((string-match "\\`\\([a-z]+\\):" string)
+ ;; no actual completion for the remaining keywords.
+ (completion-table-with-context (substring string 0 (match-end 0))
+ (if (member (match-string 1 string)
+ vc-bzr-revision-keywords)
+ ;; If it's a valid keyword,
+ ;; use a non-empty table to
+ ;; indicate it.
+ '("") nil)
+ (substring string (match-end 0))
+ pred
+ action))
(t
;; Could use completion-table-with-terminator, except that it
;; currently doesn't work right w.r.t pcm and doesn't give
;; the *Completions* output we want.
- (complete-with-action action '("revno:" "revid:" "last:" "before:"
- "tag:" "date:" "ancestor:" "branch:"
- "submit:")
+ (complete-with-action action (eval-when-compile
+ (mapcar (lambda (s) (concat s ":"))
+ vc-bzr-revision-keywords))
string pred))))))
(eval-after-load "vc"