+(defvar debbugs-gnu-completion-table
+ (completion-table-dynamic
+ (lambda (string)
+ (if (string-equal string "")
+ (mapcar
+ (lambda (x)
+ (list (format "%d" x) x))
+ '(1 2 3 4 5 6 7 8 9))
+ (let ((newest-bug (car (debbugs-newest-bugs 1))))
+ (and (string-match "^[1-9][0-9]*$" string)
+ (<= (string-to-number string) newest-bug)
+ (append
+ `(,string)
+ (mapcar
+ (lambda (x)
+ (let ((y (format "%s%d" string x)))
+ (and (<= (string-to-number y) newest-bug)
+ (list y x))))
+ '(0 1 2 3 4 5 6 7 8 9))))))))
+ "Dynamic completion table for reading bug numbers.")
+