all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Daniel Mendler <mail@daniel-mendler.de>
To: 48572@debbugs.gnu.org
Cc: Stefan Monnier <monnier@iro.umontreal.ca>, joaotavora@gmail.com
Subject: bug#48572: 28.0.50; Add `passthrough` completion style to minibuffer.el
Date: Fri, 21 May 2021 20:48:35 +0200	[thread overview]
Message-ID: <c8b96e0f-fd60-3a6d-19ae-7918d2d5541b@daniel-mendler.de> (raw)

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	other threads:[~2021-05-21 18:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-21 18:48 Daniel Mendler [this message]
2021-05-22 23:20 ` bug#48572: 28.0.50; Add `passthrough` completion style to minibuffer.el 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c8b96e0f-fd60-3a6d-19ae-7918d2d5541b@daniel-mendler.de \
    --to=mail@daniel-mendler.de \
    --cc=48572@debbugs.gnu.org \
    --cc=joaotavora@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.