-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for a
prescient.el
completion style. (#125)
This completion style can optionally modify a completion table's metadata to use `prescient.el` sorting, including `prescient-sort-full-matches-first`. - Update the CHANGELOG. - Update the README. - Prescient changes: - Add faces `prescient-primary-highlight` and `prescient-secondary-highlight`. Add a function to apply them. - Add user options `prescient-highlight-completions` and `prescient-completion-enable-sort`. - Make `prescient-filter` work with completion tables by using `all-completions` instead of assuming lists. - `prescient-filter` now propertizes all returned candidates with the regexps prescient used and whether it ignored case. This is needed for sorting after filtering. - Add filtering functions `prescient-all-completions`, `prescient-try-completion`, which use `prescient-filter`. - Add sorting functions `prescient--completion-modify-sort`, `prescient-sort-full-matches-first`, and `prescient-completion-sort`. - Define a completion style `prescient` that uses those functions. - The completion style can modify unsorted tables to use `prescient-completion-sort`, which wraps `prescient-sort` and `prescient-sort-full-matches-first`. - This requires Emacs 27+. - This is off by default to more easily work with multiple completion UIs. Some UIs (such as Vertico and Corfu) allow setting the sorting function to use after filtering. Setting that option to the function `prescient-completion-sort` works and applies to the output of all completion styles and backends, not just `prescient`. - Selectrum Prescient changes: - Old faces are now aliases of the completion faces. - Since Selectrum seems to remove the text properties of candidates after filtering, we use a function `selectrum-prescient--refine` that combines `prescient-filter` with `prescient-sort-full-matches-first`. - Move `selectrum-prescient--highlight` into Prescient for the completion style as `prescient--highlight-matches`. Use that instead. - Company Prescient changes: - Change `company-prescient-transformer` so that uses `prescient-completion-sort` instead of just `prescient-sort`. This should allow for moving full matches when using CAPFs and will always at least do `prescient-sort`. See also the PR #125. For various discussions about implementing a `prescient` completion style, see also #125, #120, #112, #89, #58, and #54.
- Loading branch information
Showing
5 changed files
with
514 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.