diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2024-01-19 07:23:46 +0100 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2024-01-19 07:23:46 +0100 |
| commit | 249f6702e99343aac045697178e319784aacd2f0 (patch) | |
| tree | 6436d5e16a9cb3ec053555b6bab9ac75eac96ac5 | |
| parent | f021305d20a40021058fdd31f9acddc86e463eaf (diff) | |
cape-capf-super: Improve deduplication (Fix #103, #104)
| -rw-r--r-- | cape.el | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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)))) |
