Releases: radian-software/prescient.el
prescient.el 6.3.1
prescient.el 6.3
prescient.el 6.2
Features
- New user option
prescient-tiebreaker
which can be used to change how matches with no recency information are sorted, instead of by length (#128).
Internal Changes
prescient-filter
now only propertizes the first returned candidate for use withprescient-sort-full-matches-first
(#148). Custom sorting functions using this data should be changed to search the candidates for the properties, as inprescient--get-sort-info
.
Bugs fixed
- Fix highlighting of the first prefix in the
prefix
filter method (#149).
Enhancements
- Improve filter situation when using
prefix
,initialism
, andprescient-sort-full-matches-first
by tweakingprefix
(#149).- Previously, with the input "re",
prefix
would match all of the string "repeat", which would sort it higher than "restart-emacs" when attempting to use "re" as an initialism. - Now, the
prefix
"re" only matches the "re" in "repeat", but does not match the entire word. If there is no non-word character in the subquery,prefix
matching is now done non-greedily. - Continuing without change, "str-re" still fully matches "string-rectangle" and ".g" still fully matches ".gitignore". The inclusion of a non-word character means that these inputs couldn't be used as initialisms anyway, so there is no conflict when matching greedily for these inputs.
- Previously, with the input "re",
prescient.el 6.1
New features
-
Add package
vertico-prescient
, which integrates prescient.el with
Vertico (#131). New modevertico-prescient-mode
configures
sorting, candidate remembrance, filtering, and binds the toggling
commands in Vertico. -
Add package
corfu-prescient
, which integrates prescient.el with
Corfu (#131). New modecorfu-prescient-mode
configures
sorting, candidate remembrance, filtering, and binds the toggling
commands while the Corfu pop-up is active.
prescient.el 6.0
Bugs fixed
- Toggling off filter methods no longer accidentally changes the global value of
prescient-filter-method
. See #123, #124. - For character folding, if
char-fold-table
isn't bound, werequire
the librarychar-fold
. This variable apparently isn't always loaded when we callchar-fold-to-regexp
. See #126. - Fix the filter methods
literal
andliteral-prefix
not being literal whenprescient-use-char-folding
was nil. This bug was added with that user option. See #127.
New features
- Add new function
prescient-sort-full-matches-first
which implements the option. This feature already existed, but moving to a separate function makes it easier to support in more UIs. See #125. - Add a completion style
prescient
. This completion style can be used in the variablecompletion-styles
. This completion style works with UIs like Emacs's built-in minibuffer completion, Icomplete, and Vertico. See various discussions in #125, #120, #112, #89, #58, and #54. - Add new function
prescient-completion-sort
, which combinesprescient-sort
with the new functionprescient-sort-full-matches-first
. See #125. This function is meant to be used after filtering and as the sorting function of your preferred completion UI. Note that sorting fully matched candidates before partially matched candidates only works for candidates filtered by theprescient
completion style. - Added user option
prescient-completion-highlight-matches
, which determines whether the completion style highlights the matching parts of candidates with the above new faces (#125). - Add faces
prescient-primary-highlight
andprescient-secondary-highlight
(#125). These faces are used with the completion style andselectrum-prescient.el
. The old facesselectrum-prescient-primary-highlight
andselectrum-prescient-secondary-highlight
are now obsolete aliases of these faces.
Enhancements
prescient-filter
now supports filtering candidates from Emacs's more generic "completion tables", not just lists of strings (#125). However, like with some other completion styles, it does not work well with certain dynamic completion tables that use a prefix string to produce candidates before filtering. To work around this, it is recommended to include thebasic
style after theprescient
style in the user optioncompletion-styles
.
Internal Changes
prescient-filter
now uses the C functionall-completions
instead of being completely written in Emacs Lisp. This should make it a bit faster. See #125.
prescient.el 5.2.1
Bugs fixed
- ivy doesn't convert all variables to string when sorting or calling
prescient-remember
, so it need to preprocess when work withivy-prescient.el
. if not, anwrong-type-argument
error may occur. This issue affects the use offormat-all-buffer
(#119).
prescient.el 5.2
New features
- Two new user options,
selectrum-prescient-enable-filtering
andselectrum-prescient-enable-sorting
, which allow the user to selectively disable the filtering or sorting functionalities ofselectrum-prescient.el
(#100). - New command
selectrum-prescient-toggle-char-fold
, bound toM-s '
in the minibuffer. - To configure match highlighting you can use the faces
selectrum-prescient-primary-highlight
andselectrum-prescient-secondary-highlight
. The previously used Selectrum facesselectrum-primary-highlight
andselectrum-secondary-highlight
will get removed from Selectrum proper (#94, #97). - The user option
prescient-sort-full-matches-first
was added. If non-nil, candidates that are fully matched are sorted before partially matched candidates, though all candidates still follow the order of recency, frequency, and length. See #95. - The user option
prescient-use-char-folding
was added. If non-nil, theliteral
andliteral-prefix
filter methods will use character folding. See #98. This can be used to help avoid the problems reported in #92 and #93. - The user option
prescient-use-case-folding
was added. This feature affects the use of all filters. It can be one ofnil
,t
, orsmart
(the default). Ifsmart
, then case folding is disabled when upper-case characters are sought. In Selectrum, the toggling commandselectrum-prescient-toggle-case-fold
was bound toM-s c
. See #105. - The command
prescient-forget
was added. When used,prescient.el
will immediately forget a candidate (#109).
Enhancements
prescient-filter-method
accepts a function which returns the desired filter methods (#110).selectrum-prescient.el
: Match faces are now combined with faces that might be already present on candidates instead of replacing them which gives better visual results in these cases (#101, #103).
Internal changes
- The user option
selectrum-should-sort-p
was deprecated in Selectrum 3.1 in favor ofselectrum-should-sort
.selectrum-prescient.el
now uses the updated option name (#99).
Bugs fixed
- A typo was fixed that prevented secondary highlighting (such as the initials in
initialism
matching) from being applied. Functions inprescient-filter-alist
were being passed the keyword argument:with-groups
instead of the correct:with-group
. For consistency, thewith-groups
argument ofprescient-filter-regexps
was changed towith-group
. See #106. - Previously, when char folding was enabled, long queries could cause a crash with the error "Regular expression too big". This has now been fixed (#71).
prescient.el 5.1
Enhancements
-
Literal-prefix matching, a new filter method whose behavior is that the first subquery must be the prefix of the candidate and the remaining subqueries must be prefixes of words in the candidate. Supports char folding just like
literal
.For example, if the input is
foo bar
, then the candidate must begin withfoo
, and it must also contain a word starting withbar
. That means it would matchfoo-and-bar
orfooboo-barquux
but notbar-foo
(because that doesn't start withfoo
) orfoo-qbar
(becausebar
is no prefix of some word).It can be enabled by adding
literal-prefix
toprescient-filter-method
. -
Anchored matching, a new filtering method that uses uppercase letters and symbols as beginning of word, similar to initialism. It can be enabled by adding
anchored
toprescient-filter-method
.For example
TTL
matchestoogle-truncate-lines
andFiAPo
orfiAPo
match bothfind-file-at-point
andfind-function-at-point
. HoweverfiFiAPo
matches only the former andfiFuAPo
matches only the latter. See #70 and #76. -
Prefix matching, a new filtering method similar to the Emacs completion style
partial
, was added. It can be enabled by addingprefix
toprescient-filter-method
.As is the case in partial completion,
t-t-l
matchestoggle-truncate-lines
andfi--a-po
matchesfind-file-at-point
,find-function-at-point
, and other similarly named symbols. One difference is that you can't use*
as a wildcard (it is instead taken literally), since you can achieve the same effect by separating queries with a space. See #67 and #76. -
Literal matching now supports char folding making Unicode text filtering much easier (#66).
-
In
selectrum-prescient.el
, commands were added for toggling the
active filtering methods in the Selectrum buffer. See #72.-
This toggling is a buffer-local effect, and doesn't change the default behavior (determined by
prescient-filter-method
). -
With a prefix argument, a command unconditionally toggles on its respective filtering method and toggles off all others.
-
While
selectrum-prescient-mode
is enabled,M-s
is bound toselectrum-prescient-toggle-map
in the Selectrum buffer, and is used as a prefix key to access the commands. The macroselectrum-prescient-create-and-bind-toggle-command
can be used to create a toggling command for a filter, and bind that command inselectrum-prescient-toggle-map
.Key Command M-s a
selectrum-prescient-toggle-anchored
M-s f
selectrum-prescient-toggle-fuzzy
M-s i
selectrum-prescient-toggle-initialism
M-s l
selectrum-prescient-toggle-literal
M-s p
selectrum-prescient-toggle-prefix
M-s r
selectrum-prescient-toggle-regexp
-
-
The user option
prescient-filter-alist
was added, which describes the relationship between the symbols inprescient-filter-list
and the corresponding functions that produce regular expressions for matching candidates. Users can create their own filter methods by adding a symbol-function pair toprescient-filter-alist
and use that custom method by adding the symbol toprescient-filter-method
. See #77.The functions that produce the regexps used for searching candidates are now considered public. They are
prescient-anchored-regexp
prescient-fuzzy-regexp
prescient-initials-regexp
prescient-literal-regexp
prescient-prefix-regexp
prescient-regexp-regexp
prescient-with-group
prescient.el 5.0
Breaking changes
- Candidates which are not strings are no longer supported. This improves performance by a few percent, and there was never any real reason to support non-strings. (Frameworks like Selectrum should convert candidates to strings before interfacing with
prescient.el
.)
Enhancements
- Fuzzy matching now uses lazy wildcards, so only the minimum amount of each candidate will be highlighted in results from Selectrum or Ivy, rather than the maximum.
Bugs fixed
- In
selectrum-prescient.el
, secondary highlighting now works correctly when multiple filter methods are enabled (#123).
Performance
- The speed of
prescient-sort
has been improved by a factor of 2x for large collections. The speed ofprescient-filter
has been improved by a factor of 3x.
prescient.el 4.1
Enhancements
- Package
selectrum-prescient.el
now usesselectrum-candidate-inserted-hook
to update the frecency database ofprescient.el
when usingTAB
(selectrum-insert-current-candidate
) to enter directories while finding files with Selectrum.
Bugs fixed
- Previously, if you explicitly enabled any of the minor modes
ivy-prescient-mode
,company-prescient-mode
, orselectrum-prescient-mode
when it was already on, then disabling the mode would not work correctly (some variables would fail to be reset). This has been fixed.