[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/typo e1002d78ab 02/18: Summary: Honor predicate when th
From: |
ELPA Syncer |
Subject: |
[elpa] externals/typo e1002d78ab 02/18: Summary: Honor predicate when the collection is a function |
Date: |
Sun, 26 Mar 2023 08:01:28 -0400 (EDT) |
branch: externals/typo
commit e1002d78ab6b3fee58029789fe29f91b758cab66
Author: Philip Kaludercic <philip.kaludercic@fau.de>
Commit: Philip Kaludercic <philip.kaludercic@fau.de>
Summary: Honor predicate when the collection is a function
---
typo.el | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/typo.el b/typo.el
index a6db97e0c9..ee229a0795 100644
--- a/typo.el
+++ b/typo.el
@@ -4,7 +4,7 @@
;; Author: Philip Kaludercic <philip.kaludercic@fau.de>
;; URL: https://wwwcip.cs.fau.de/~oj14ozun/src+etc/typo.el
-;; Version: $Id$
+;; Version: $Id: typo.el,v 1.1 2023/01/13 18:53:29 oj14ozun Exp oj14ozun $
;; Package-Version: 1
;; Keywords: convenience
@@ -60,11 +60,11 @@
(and (<= (string-distance ,word ,key) typo-level)
(<= (- typo-shrink) (- (length ,word) (length ,key)) typo-expand)))))
-(defun typo-edits (word collection)
+(defun typo-edits (word collection pred)
"Generate a list of all multi-edit typos of WORD.
-Only words that are in the COLLECTION will be returned. The
-variable `typo-level' specifies how many single-letter typos are
-searched."
+Only words that are in the COLLECTION and satisfy PRED will be
+returned. The variable `typo-level' specifies how many
+single-letter typos are searched."
(let (new-words)
(cond
((and (listp collection) (consp (car collection))) ;alist
@@ -94,19 +94,19 @@ searched."
collection)
new-words)
((functionp collection)
- (typo-edits word (funcall collection "" #'always t))))))
+ (typo-edits word (funcall collection "" pred t) pred)))))
;;;###autoload
-(defun typo-all-completions (string collection _pred _point)
+(defun typo-all-completions (string collection pred _point)
"Generate all versions of the STRING using COLLECTION.
COLLECTION are as defined in `all-completions'."
- (typo-edits string collection))
+ (typo-edits string collection pred))
;;;###autoload
-(defun typo-try-completion (string collection _pred _point &optional _metadata)
+(defun typo-try-completion (string collection pred _point &optional _metadata)
"Generate the most probable version of STRING using COLLECTION.
COLLECTION are as defined in `try-completion'."
- (let* ((result (typo-edits string collection))
+ (let* ((result (typo-edits string collection pred))
(best (car result)))
(dolist (other (cdr result))
(when (< (string-distance string other)
- [elpa] externals/typo 5be4704665 09/18: Update headers for Sourcehut, (continued)
- [elpa] externals/typo 5be4704665 09/18: Update headers for Sourcehut, ELPA Syncer, 2023/03/26
- [elpa] externals/typo c0283a403d 08/18: Summary: Set 'typo-level' to 'sqrt' by default, ELPA Syncer, 2023/03/26
- [elpa] externals/typo dde7825cc0 06/18: Summary: Check functionp before listp, ELPA Syncer, 2023/03/26
- [elpa] externals/typo db35f44b9a 01/18: Initial revision, ELPA Syncer, 2023/03/26
- [elpa] externals/typo e259ccabfb 15/18: Add a .gitignore, ELPA Syncer, 2023/03/26
- [elpa] externals/typo 281c9049c1 18/18: Bump version to 1.0.1 for GNU ELPA, ELPA Syncer, 2023/03/26
- [elpa] externals/typo 6c5e695ec2 13/18: Add licensing information, ELPA Syncer, 2023/03/26
- [elpa] externals/typo ffcd6d1d52 16/18: Add more links to the introductory README paragraph, ELPA Syncer, 2023/03/26
- [elpa] externals/typo ecec5009b5 10/18: Add user option 'typo-support-all-completions', ELPA Syncer, 2023/03/26
- [elpa] externals/typo f68cc15541 04/18: Summary: Add a "Package-Requires" header, ELPA Syncer, 2023/03/26
- [elpa] externals/typo e1002d78ab 02/18: Summary: Honor predicate when the collection is a function,
ELPA Syncer <=
- [elpa] externals/typo 1a93ca65dd 12/18: Add a basic README file, ELPA Syncer, 2023/03/26
- [elpa] externals/typo e38daaf6cd 03/18: Summary: Lower 'typo-level' to 8, ELPA Syncer, 2023/03/26
- [elpa] externals/typo 2e1c408708 14/18: Add a .dir-locals.el, ELPA Syncer, 2023/03/26
- [elpa] externals/typo b41a366511 17/18: Assign copyright to the FSF, ELPA Syncer, 2023/03/26
- [elpa] externals/typo 933daae631 11/18: Add "Maintainer" header, ELPA Syncer, 2023/03/26