[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/cape 249f6702e9 1/2: cape-capf-super: Improve deduplica
From: |
ELPA Syncer |
Subject: |
[elpa] externals/cape 249f6702e9 1/2: cape-capf-super: Improve deduplication (Fix #103, #104) |
Date: |
Fri, 19 Jan 2024 03:57:34 -0500 (EST) |
branch: externals/cape
commit 249f6702e99343aac045697178e319784aacd2f0
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
cape-capf-super: Improve deduplication (Fix #103, #104)
---
cape.el | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/cape.el b/cape.el
index e1e2875194..19fd78fe0c 100644
--- a/cape.el
+++ b/cape.el
@@ -903,11 +903,13 @@ The functions `cape-wrap-super' and `cape-capf-super' are
experimental."
#'identity))
(cands (funcall sort (all-completions str
table pr))))
(cl-loop
- for cand in-ref cands do
- (if (eq (gethash cand ht t) t)
- (puthash cand plist ht)
+ for cand in-ref cands
+ for other = (gethash cand ht t) do
+ (cond
+ ((eq other t) (puthash cand plist ht))
+ ((not (equal other plist))
(setf cand (propertize cand 'cape-capf-super
- (cons cand plist)))))
+ (cons cand plist))))))
(push cands candidates)))
(setq cand-ht ht)
(apply #'nconc (nreverse candidates))))