diff options
| author | Daniel Mendler <mail@daniel-mendler.de> | 2024-07-17 10:13:28 +0200 |
|---|---|---|
| committer | Daniel Mendler <mail@daniel-mendler.de> | 2024-07-17 10:16:38 +0200 |
| commit | 4fd90e3752aefe3ed38b0edc4b94214a5e64002f (patch) | |
| tree | ae953f28d9ada259d332316497ff7032f8b6f961 /cape.el | |
| parent | e8b5667b19ebe1a451b6c5514e023b21571995d9 (diff) | |
cape-wrap-super: Call metadata functions with correct candidates
Make sure to call metadata functions only with candidates belonging to the
originating Capf.
Diffstat (limited to 'cape.el')
| -rw-r--r-- | cape.el | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -1008,13 +1008,14 @@ multiple super Capfs in the `completion-at-point-functions': ,@(and (not exclusive) '(:exclusive no)) ,@(mapcan (lambda (prop) - (list prop (lambda (cand &rest args) - (let ((ref (get-text-property 0 'cape-capf-super cand))) - (when-let ((fun (plist-get - (or (cdr ref) - (and cand-ht (gethash cand cand-ht))) - prop))) - (apply fun (or (car ref) cand) args)))))) + (list prop + (lambda (cand &rest args) + (if-let ((ref (get-text-property 0 'cape-capf-super cand))) + (when-let ((fun (plist-get (cdr ref) prop))) + (apply fun (car ref) args)) + (when-let ((plist (and cand-ht (gethash cand cand-ht))) + (fun (plist-get plist prop))) + (apply fun cand args)))))) cand-functions))))) ;;;###autoload |
