minad / cape

🦸cape.el - Completion At Point Extensions
GNU General Public License v3.0
584 stars 20 forks source link

Combine predicates for super-capf test/try-completion, fixes #38 #40

Closed jdtsmith closed 2 years ago

jdtsmith commented 2 years ago

As discussed in #38, composing CAPFs using cape-super-capf leads to candidate selection issues. At its core, this results from the test/try-completion logic, which ignores any :predicate keywords the constituent tables set in their plists. In the case of elisp-completion-at-point, :predicate is set to a function which ignores unbound variables. This is important because all completion fragments are included (unbound) in obarray during completion (see this bug report). So, by default, every input tests as t.

This small fix combines the pred argument with the underlying table's :predicate (if any).