emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs/lisp ChangeLog vc-bzr.el


From: Stefan Monnier
Subject: [Emacs-diffs] emacs/lisp ChangeLog vc-bzr.el
Date: Fri, 30 Oct 2009 05:48:17 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        09/10/30 05:48:17

Modified files:
        lisp           : ChangeLog vc-bzr.el 

Log message:
        (vc-bzr-revision-keywords): New var.
        (vc-bzr-revision-completion-table): Use it to fix completion of "s:"
        to "submit:".

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.16523&r2=1.16524
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/vc-bzr.el?cvsroot=emacs&r1=1.83&r2=1.84

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.16523
retrieving revision 1.16524
diff -u -b -r1.16523 -r1.16524
--- ChangeLog   30 Oct 2009 02:00:11 -0000      1.16523
+++ ChangeLog   30 Oct 2009 05:48:13 -0000      1.16524
@@ -1,3 +1,9 @@
+2009-10-30  Stefan Monnier  <address@hidden>
+
+       * vc-bzr.el (vc-bzr-revision-keywords): New var.
+       (vc-bzr-revision-completion-table): Use it to fix completion of "s:"
+       to "submit:".
+
 2009-10-30  Dan Nicolaescu  <address@hidden>
 
        * textmodes/ispell.el (ispell-skip-region-alist):

Index: vc-bzr.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/vc-bzr.el,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -b -r1.83 -r1.84
--- vc-bzr.el   21 Oct 2009 20:04:02 -0000      1.83
+++ vc-bzr.el   30 Oct 2009 05:48:16 -0000      1.84
@@ -728,6 +728,11 @@
 
 ;;; 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 @@
               (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"




reply via email to

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