unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#48572: 28.0.50; Add `passthrough` completion style to minibuffer.el
@ 2021-05-21 18:48 Daniel Mendler
  2021-05-22 23:20 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2021-05-23  1:07 ` Dmitry Gutov
  0 siblings, 2 replies; 11+ messages in thread
From: Daniel Mendler @ 2021-05-21 18:48 UTC (permalink / raw)
  To: 48572; +Cc: Stefan Monnier, joaotavora

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."))





^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-05-30 13:03 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-21 18:48 bug#48572: 28.0.50; Add `passthrough` completion style to minibuffer.el Daniel Mendler
2021-05-22 23:20 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-23 10:21   ` Daniel Mendler
2021-05-23 10:36     ` Daniel Mendler
2021-05-23 15:50     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-23 17:33       ` João Távora
2021-05-23 19:58       ` Daniel Mendler
2021-05-26 21:28         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-30  3:23           ` Daniel Mendler
2021-05-30 13:03             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-05-23  1:07 ` Dmitry Gutov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).