All notable changes to this project will be documented in this file. The format is based on Keep a Changelog.
- In version 6.3 a bug was introduced that caused
vertico-directory-enter
to no longer remember candidates. This has been fixed.
- The completion style now supports lazy highlighting via
completion-lazy-hilit
andcompletion-lazy-hilit-fn
, new in Emacs 30 and already supported by some completion UIs (#152, #153).
- Change how candidates are remembered for Vertico to work with
vertico-directory-enter
and to remember the minibuffer contents when exiting the minibuffer. - Use
corfu--initial-state
ifcorfu--state-vars
is not bound (#158, #159).
- New user option
prescient-tiebreaker
which can be used to change how matches with no recency information are sorted, instead of by length (#128).
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
.
- Fix highlighting of the first prefix in the
prefix
filter method (#149).
- 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",
-
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.
-
Toggling off filter methods no longer accidentally changes the global value of
prescient-filter-method
. See #123, #124. -
Always
require
the librarychar-fold
so thatchar-fold-table
is defined. This variable apparently isn't always loaded when we callchar-fold-to-regexp
. See #126, #127. -
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.
-
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
(#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.
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
.
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.
- 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).
- 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).
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).
- 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).
- 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).
-
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 P
selectrum-prescient-toggle-literal-prefix
M-s r
selectrum-prescient-toggle-regexp
M-s '
-
-
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
- 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
.)
- 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.
- In
selectrum-prescient.el
, secondary highlighting now works correctly when multiple filter methods are enabled (#123).
- 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.
- 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.
- 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.
- Due to internal changes in Ivy and Counsel which make it extremely
difficult and brittle to control sorting in a fine-grained manner,
candidates for all commands are now sorted by default. You can still
configure the behavior in
ivy-prescient-sort-commands
, which has a new default value and now also has the ability to specify a blacklist of commands (used in the new default, which excludesswiper
andivy-switch-buffer
) in addition to a whitelist (used in the old default).
- New package
selectrum-prescient
provides integration with Selectrum, a modern alternative to Ivy and Helm. It provides a single entry point,selectrum-prescient-mode
, which may be enabled in your init-file. This package is likely to be essentially bug-free when compared toivy-prescient
, because of the vastly simpler API on which it depends.
- The function
prescient-filter
usually made a new copy of the input list, but didn't do this in the case that there was nothing to filter out. That was subtle behavior with the potential for causing bugs, so nowprescient-filter
is guaranteed to always make a copy of the input list.
- Recent commits to Counsel (including
9da800
and2d840b
) resulted in candidates for many commands no longer being sorted. This has been fixed.
- Function
prescient-initials-regexp
, which was deprecated in release 2.2 over a year ago.
- New user option
prescient-aggressive-file-save
to enable saving the cache data more aggressively according to the discussions (#17 and #39). - The minor mode
ivy-prescient-mode
now affects thecompletion-in-region
command by default, without the need for the user to change the value ofivy-sort-functions-alist
(#41).
- An update to Ivy caused
ivy-prescient.el
to no longer have any effect for theivy-completion-in-region
command. This has been fixed (#41, #42).
- New user options
prescient-sort-length-enable
andcompany-prescient-sort-length-enable
allow disablingprescient.el
sorting by length, without disabling sorting altogether.
- The
fuzzy
regex builder now matches the first occurrence of each character in the query, giving more intuitive results when highlighted (#37).
- Logic error which caused a crash on an all-whitespace query has now been fixed.
- Previously,
ivy-prescient.el
would only remember directories that the user operated on with an action (for example, opening them with Dired). Now it will remember all intermediate directories used in navigation (#36).
- The user option
prescient-filter-method
now accepts a list of filter methods that will be applied in order until one matches. This allows for any combination of filter methods (#29). The default value has changed fromliteral+initialism
to(literal regexp initialism)
, which provides a superset of functionality. - Two new user options,
ivy-prescient-enable-filtering
andivy-prescient-enable-sorting
, which allow the user to selectively disable the filtering or sorting functionalities ofivy-prescient.el
(#32).
- Previously, if you had set
prescient-filter-method
toregexp
and entered an invalid regexp withivy-prescient.el
, then the candidate list would not update. Now, the list is cleared until your regexp is valid again. This behavior is more consistent and predictable.
- Fixed sorting in filename-based collections (#28).
- Fixed an issue where Ivy actions that accepted a list of candidates were being handled incorrectly (#33).
- Removed
ivy-prescient-filter-method-keys
andivy-prescient-persist-filter-method
becauseregexp
is now part of the default filter method, and therefore these are no longer needed (#15, #24, and #27). - Removed
ivy-prescient-excluded-commands
becauseivy-prescient.el
now automatically detects if sorting is enabled in a collection.
- The Custom groups for the user options
prescient-persist-mode
,ivy-prescient-mode
, andcompany-prescient-mode
have now been set properly toprescient
(instead of each being in its own group).
ivy-prescient
now depends on version 0.11.0 ofivy
, rather than 0.10.0. This long-awaited release includes a number of bugfixes which are critical for correct operation ofivy-prescient
.
- Previously, if the user or some other code had customized
print-length
orprint-level
, then these settings could break the ability ofprescient.el
to persist history and frequency data toprescient-save-file
. Now, persistence works regardless of the values of these variables (#16).
- New user option
prescient-filter-method
allows you to use substring, initialism, regexp, or fuzzy matching (#13). - By default, you can use
C-c C-r
in Ivy to toggle between substring/initialism matching and regexp matching. Bindings can be customized in the new user optionivy-prescient-filter-method-keys
. By default, the changes do not persist between Ivy sessions, but this can be customized using the new user optionivy-prescient-persist-filter-method
.
- The function
prescient-initials-regexp
is now considered deprecated and it should not be used. Changes to its behavior will however be documented until it is removed in a future release.
- New user option
ivy-prescient-retain-classic-highlighting
allows you to more closely emulate the highlighting behavior of Ivy whenivy-prescient-mode
is enabled (#11).
- API function
prescient-filter-regexps
now has special behavior when the symbolall
is passed as theWITH-GROUPS
argument. The documentation string for this function, which was previously erroneous, has been fixed (#11). - For some reason, Ivy explicitly supports candidates which are lists,
by just taking their cars.
ivy-prescient.el
now does the same, instead of converting the lists to strings. This reduces bloat in the save file, and in some cases improves frequency tracking (for example, frequency tracking works much better fororg-refile-get-location
).
ivy-prescient.el
now clears the value ofivy-initial-inputs-alist
whenivy-prescient-mode
is enabled, in order to allow functions likecounsel-describe-function
to work out of the box (#7).
- Previously,
ivy-prescient.el
didn't work with the latest version ofcounsel-projectile
because that package relied on certain undocumented semantics of theivy-read
API. This is now fixed (#6).
- Packages:
prescient.el
ivy-prescient.el
company-prescient.el
- User options:
prescient-history-length
prescient-frequency-decay
prescient-frequency-threshold
prescient-save-file
ivy-prescient-excluded-commands
ivy-prescient-sort-commands
- Minor modes:
prescient-persist-mode
ivy-prescient-mode
company-prescient-mode
- API functions:
prescient-split-query
prescient-initials-regexp
prescient-filter-regexps
prescient-filter
prescient-sort-compare
prescient-sort
prescient-remember