aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2009-10-30 05:48:13 +0000
committerStefan Monnier2009-10-30 05:48:13 +0000
commit00f71f399096a154ccb61be9c362866ea045200b (patch)
tree19ea585cb17c2d00a7d5782f903e6f179f03df7d
parent0816d744fb81400c736c1827b9c4332abd8fbabc (diff)
downloademacs-00f71f399096a154ccb61be9c362866ea045200b.tar.gz
emacs-00f71f399096a154ccb61be9c362866ea045200b.zip
(vc-bzr-revision-keywords): New var.
(vc-bzr-revision-completion-table): Use it to fix completion of "s:" to "submit:".
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/vc-bzr.el30
2 files changed, 26 insertions, 10 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 0826ad8ef44..17ce286df80 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12009-10-30 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * vc-bzr.el (vc-bzr-revision-keywords): New var.
4 (vc-bzr-revision-completion-table): Use it to fix completion of "s:"
5 to "submit:".
6
12009-10-30 Dan Nicolaescu <dann@ics.uci.edu> 72009-10-30 Dan Nicolaescu <dann@ics.uci.edu>
2 8
3 * textmodes/ispell.el (ispell-skip-region-alist): 9 * textmodes/ispell.el (ispell-skip-region-alist):
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."
728 728
729;;; Revision completion 729;;; Revision completion
730 730
731(eval-and-compile
732 (defconst vc-bzr-revision-keywords
733 '("revno" "revid" "last" "before"
734 "tag" "date" "ancestor" "branch" "submit")))
735
731(defun vc-bzr-revision-completion-table (files) 736(defun vc-bzr-revision-completion-table (files)
732 (lexical-let ((files files)) 737 (lexical-let ((files files))
733 ;; What about using `files'?!? --Stef 738 ;; What about using `files'?!? --Stef
@@ -762,20 +767,25 @@ stream. Standard error output is discarded."
762 (push (match-string-no-properties 1) table))) 767 (push (match-string-no-properties 1) table)))
763 (completion-table-with-context prefix table tag pred action))) 768 (completion-table-with-context prefix table tag pred action)))
764 769
765 ((string-match "\\`\\(revid\\):" string) 770 ((string-match "\\`\\([a-z]+\\):" string)
766 ;; FIXME: How can I get a list of revision ids? 771 ;; no actual completion for the remaining keywords.
767 ) 772 (completion-table-with-context (substring string 0 (match-end 0))
768 ((eq (car-safe action) 'boundaries) 773 (if (member (match-string 1 string)
769 (list* 'boundaries 774 vc-bzr-revision-keywords)
770 (string-match "[^:]*\\'" string) 775 ;; If it's a valid keyword,
771 (string-match ":" (cdr action)))) 776 ;; use a non-empty table to
777 ;; indicate it.
778 '("") nil)
779 (substring string (match-end 0))
780 pred
781 action))
772 (t 782 (t
773 ;; Could use completion-table-with-terminator, except that it 783 ;; Could use completion-table-with-terminator, except that it
774 ;; currently doesn't work right w.r.t pcm and doesn't give 784 ;; currently doesn't work right w.r.t pcm and doesn't give
775 ;; the *Completions* output we want. 785 ;; the *Completions* output we want.
776 (complete-with-action action '("revno:" "revid:" "last:" "before:" 786 (complete-with-action action (eval-when-compile
777 "tag:" "date:" "ancestor:" "branch:" 787 (mapcar (lambda (s) (concat s ":"))
778 "submit:") 788 vc-bzr-revision-keywords))
779 string pred)))))) 789 string pred))))))
780 790
781(eval-after-load "vc" 791(eval-after-load "vc"