Function: completion-search-peek
completion-search-peek is a byte-compiled function defined in
completion.el.gz.
Signature
(completion-search-peek USE-CDABBREV)
Documentation
Return the next completion entry without actually moving the pointers.
Calling this again or calling completion-search-next results in the same
string being returned. Depends on case-fold-search.
If there are no more entries, try cdabbrev and then return only a string.
Source Code
;; Defined in /usr/src/emacs/lisp/completion.el.gz
(defun completion-search-peek (use-cdabbrev)
"Return the next completion entry without actually moving the pointers.
Calling this again or calling `completion-search-next' results in the same
string being returned. Depends on `case-fold-search'.
If there are no more entries, try cdabbrev and then return only a string."
(cond
;; return the cached value if we have it
(cmpl-next-possibility)
((and cmpl-next-possibilities
;; still a few possibilities left
(progn
(while
(and (not (eq 0 (string-match cmpl-test-regexp
(completion-string (car cmpl-next-possibilities)))))
(setq cmpl-next-possibilities (cdr cmpl-next-possibilities))))
cmpl-next-possibilities))
;; successful match
(setq cmpl-next-possibility (car cmpl-next-possibilities)
cmpl-tried-list (cons (downcase (completion-string cmpl-next-possibility))
cmpl-tried-list)
cmpl-next-possibilities (cdr cmpl-next-possibilities))
cmpl-next-possibility)
(use-cdabbrev
;; unsuccessful, use cdabbrev
(cond ((not cmpl-cdabbrev-reset-p)
(reset-cdabbrev cmpl-test-string cmpl-tried-list)
(setq cmpl-cdabbrev-reset-p t)))
(setq cmpl-next-possibility (next-cdabbrev)))
;; Completely unsuccessful, return nil
))