Function: completion-flex-try-completion

completion-flex-try-completion is a byte-compiled function defined in minibuffer.el.gz.

Signature

(completion-flex-try-completion STRING TABLE PRED POINT)

Documentation

Try to flex-complete STRING in TABLE given PRED and POINT.

Source Code

;; Defined in /usr/src/emacs/lisp/minibuffer.el.gz
(defun completion-flex-try-completion (string table pred point)
  "Try to flex-complete STRING in TABLE given PRED and POINT."
  (unless (and completion-flex-nospace (string-search " " string))
    (pcase-let ((`(,all ,pattern ,prefix ,suffix ,_carbounds)
                 (completion-substring--all-completions
                  string table pred point
                  #'completion-flex--make-flex-pattern)))
      (if minibuffer-completing-file-name
          (setq all (completion-pcm--filename-try-filter all)))
      ;; Try some "merging", meaning add as much as possible to the
      ;; user's pattern without losing any possible matches in `all'.
      ;; i.e this will augment "cfi" to "config" if all candidates
      ;; contain the substring "config".  FIXME: this still won't
      ;; augment "foo" to "froo" when matching "frodo" and
      ;; "farfromsober".
      (completion-pcm--merge-try pattern all prefix suffix))))