bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#48572: 28.0.50; Add `passthrough` completion style to minibuffer.el


From: Daniel Mendler
Subject: bug#48572: 28.0.50; Add `passthrough` completion style to minibuffer.el
Date: Fri, 21 May 2021 20:48:35 +0200

In some scenarios it is useful to disable the completion style
infrastructure. This includes Eglot or my Asynchronous Fuzzy Finder for
Emacs (https://github.com/minad/affe/).

The addition of a passthrough completion style helps these use cases.

(defun passthrough-all-completions (_str table pred _point)
  "Passthrough completion function.
See `completion-all-completions' for the arguments STR, TABLE, PRED and
POINT."
  (let ((completion-regexp-list))
    (all-completions "" table pred)))

(defun passthrough-try-completion (str table pred _point)
  "Passthrough completion function.
See `completion-try-completion' for the arguments STR, TABLE, PRED and
POINT."
  (let ((completion-regexp-list)
        (completion (try-completion str table pred)))
    (if (stringp completion)
        (cons completion (length completion))
      completion)))

(add-to-list 'completion-styles-alist
             (list 'passthrough
                   #'passthrough-try-completion
                   #'passthrough-all-completions
                   "Passthrough completion style."))





reply via email to

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