From ec50e665d22b1a632c7a00daf9f81249879148b4 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 21 Apr 2008 20:49:06 +0000 Subject: [PATCH] (vc-bzr-complete-with-prefix): Remove. (vc-bzr-revision-completion-table): Use completion-table-with-context instead. --- lisp/ChangeLog | 4 ++++ lisp/vc-bzr.el | 33 ++++++++++++++------------------- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f8ab54a1631..5bfdcd1a1de 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2008-04-21 Stefan Monnier + * vc-bzr.el (vc-bzr-complete-with-prefix): Remove. + (vc-bzr-revision-completion-table): Use completion-table-with-context + instead. + * simple.el (choose-completion-string): Use minibuffer-completion-table. 2008-04-21 Chong Yidong diff --git a/lisp/vc-bzr.el b/lisp/vc-bzr.el index 7db90173ee3..fcd1b9b1b5d 100644 --- a/lisp/vc-bzr.el +++ b/lisp/vc-bzr.el @@ -706,12 +706,6 @@ Optional argument LOCALP is always ignored." ;;; Revision completion -(defun vc-bzr-complete-with-prefix (prefix action table string pred) - (let ((comp (complete-with-action action table string pred))) - (if (stringp comp) - (concat prefix comp) - comp))) - (defun vc-bzr-revision-completion-table (files) (lexical-let ((files files)) ;; What about using `files'?!? --Stef @@ -719,19 +713,20 @@ Optional argument LOCALP is always ignored." (cond ((string-match "\\`\\(ancestor\\|branch\\|\\(revno:\\)?[-0-9]+:\\):" string) - (vc-bzr-complete-with-prefix (substring string 0 (match-end 0)) - action - 'read-file-name-internal - (substring string (match-end 0)) - ;; Dropping `pred'. Maybe we should just - ;; stash it in `read-file-name-predicate'? - nil)) + (completion-table-with-context (substring string 0 (match-end 0)) + 'read-file-name-internal + (substring string (match-end 0)) + ;; Dropping `pred'. Maybe we should + ;; just stash it in + ;; `read-file-name-predicate'? + nil + action)) ((string-match "\\`\\(before\\):" string) - (vc-bzr-complete-with-prefix (substring string 0 (match-end 0)) - action - (vc-bzr-revision-completion-table files) - (substring string (match-end 0)) - pred)) + (completion-table-with-context (substring string 0 (match-end 0)) + (vc-bzr-revision-completion-table files) + (substring string (match-end 0)) + pred + action)) ((string-match "\\`\\(tag\\):" string) (let ((prefix (substring string 0 (match-end 0))) (tag (substring string (match-end 0))) @@ -744,7 +739,7 @@ Optional argument LOCALP is always ignored." (goto-char (point-min)) (while (re-search-forward "^\\(.*[^ \n]\\) +[^ \n]*$" nil t) (push (match-string-no-properties 1) table))) - (vc-bzr-complete-with-prefix prefix action table tag pred))) + (completion-table-with-context prefix table tag pred action))) ((string-match "\\`\\(revid\\):" string) ;; FIXME: How can I get a list of revision ids? -- 2.39.5