emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/cape dcb5a139c4 105/146: Add cape-capf-with-case-fold


From: ELPA Syncer
Subject: [elpa] externals/cape dcb5a139c4 105/146: Add cape-capf-with-case-fold
Date: Sun, 9 Jan 2022 20:57:46 -0500 (EST)

branch: externals/cape
commit dcb5a139c4372eea32f33f03f0714898864dea79
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>

    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 04fa175657..115bbadb94 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 4a3a85944d..8602a355bf 100644
--- a/cape.el
+++ b/cape.el
@@ -860,6 +860,14 @@ The PREDICATE is passed the candidate symbol or string."
       (`(,beg ,end ,table . ,plist)
        `(,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."



reply via email to

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