From dcb5a139c4372eea32f33f03f0714898864dea79 Mon Sep 17 00:00:00 2001 From: Daniel Mendler Date: Sun, 28 Nov 2021 18:00:16 +0100 Subject: Add cape-capf-with-case-fold --- README.org | 1 + cape.el | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/README.org b/README.org index 04fa175..115bbad 100644 --- a/README.org +++ b/README.org @@ -161,3 +161,4 @@ achieve a similarly refreshing strategy. - ~cape-interactive-capf~: Create a Capf which can be called interactively. - ~cape-capf-with-properties~: Add completion properties to a Capf. - ~cape-capf-with-predicate~: Add candidate predicate to a Capf. +- ~cape-capf-with-case-fold~: Create a Capf which is case insensitive. diff --git a/cape.el b/cape.el index 4a3a859..8602a35 100644 --- a/cape.el +++ b/cape.el @@ -861,6 +861,14 @@ The PREDICATE is passed the candidate symbol or string." `(,beg ,end ,(cape--silent-table table) ,@plist))))) ;;;###autoload +(defun cape-capf-with-case-fold (capf) + "Create a new CAPF which is case insensitive." + (lambda () + (pcase (funcall capf) + (`(,beg ,end ,table . ,plist) + `(,beg ,end ,(completion-table-case-fold table) ,@plist))))) + +;;;###autoload (defun cape-noninterruptible-capf (capf) "Create a new CAPF which is non-interruptible silent by input." (lambda () -- cgit v1.0