branch: externals/typo
commit ecec5009b59c55c96ea74897812bb424fe100c87
Author: Philip Kaludercic <[email protected]>
Commit: Philip Kaludercic <[email protected]>
Add user option 'typo-support-all-completions'
---
typo.el | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/typo.el b/typo.el
index 4a74f6fcd7..c78a1f3cc3 100644
--- a/typo.el
+++ b/typo.el
@@ -57,6 +57,13 @@ indicating the maximal number of permitted typos."
"Number of characters a word may expand."
:type 'natnum)
+(defcustom typo-support-all-completions t
+ "Non-nil means enable support for `all-completions'.
+When enabled typo-based completion will also be applied to the
+*Completions* buffer (or analogous concepts in other completion
+frameworks)."
+ :type 'boolean)
+
(define-inline typo--test (word key)
(inline-letevals (word key)
(inline-quote
@@ -115,7 +122,8 @@ single-letter typos are searched."
(defun typo-all-completions (string collection pred _point)
"Generate all versions of the STRING using COLLECTION.
COLLECTION and PRED are as defined in `all-completions'."
- (typo-edits string collection pred))
+ (and typo-support-all-completions
+ (typo-edits string collection pred)))
;;;###autoload
(defun typo-try-completion (string collection pred _point &optional _metadata)