Releases: radian-software/prescient.el
prescient.el 6.3.2
prescient.el 6.3.1
Bugs fixed
- In version 6.3 a bug was introduced that caused
vertico-directory-enterto no longer remember candidates. This has been fixed.
prescient.el 6.3
prescient.el 6.2
Features
- New user option
prescient-tiebreakerwhich can be used to change how matches with no recency information are sorted, instead of by length (#128).
Internal Changes
prescient-filternow 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
prefixfilter method (#149).
Enhancements
- Improve filter situation when using
prefix,initialism, andprescient-sort-full-matches-firstby tweakingprefix(#149).- Previously, with the input "re",
prefixwould 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,prefixmatching 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-modeconfigures
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-modeconfigures
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-tableisn't bound, werequirethe librarychar-fold. This variable apparently isn't always loaded when we callchar-fold-to-regexp. See #126. - Fix the filter methods
literalandliteral-prefixnot being literal whenprescient-use-char-foldingwas nil. This bug was added with that user option. See #127.
New features
- Add new function
prescient-sort-full-matches-firstwhich 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-sortwith 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 theprescientcompletion 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-highlightandprescient-secondary-highlight(#125). These faces are used with the completion style andselectrum-prescient.el. The old facesselectrum-prescient-primary-highlightandselectrum-prescient-secondary-highlightare now obsolete aliases of these faces.
Enhancements
prescient-filternow 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 thebasicstyle after theprescientstyle in the user optioncompletion-styles.
Internal Changes
prescient-filternow uses the C functionall-completionsinstead 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-argumenterror may occur. This issue affects the use offormat-all-buffer(#119).
prescient.el 5.2
New features
- Two new user options,
selectrum-prescient-enable-filteringandselectrum-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-highlightandselectrum-prescient-secondary-highlight. The previously used Selectrum facesselectrum-primary-highlightandselectrum-secondary-highlightwill get removed from Selectrum proper (#94, #97). - The user option
prescient-sort-full-matches-firstwas 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-foldingwas added. If non-nil, theliteralandliteral-prefixfilter 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-foldingwas 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-foldwas bound toM-s c. See #105. - The command
prescient-forgetwas added. When used,prescient.elwill immediately forget a candidate (#109).
Enhancements
prescient-filter-methodaccepts 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-pwas deprecated in Selectrum 3.1 in favor ofselectrum-should-sort.selectrum-prescient.elnow uses the updated option name (#99).
Bugs fixed
- A typo was fixed that prevented secondary highlighting (such as the initials in
initialismmatching) from being applied. Functions inprescient-filter-alistwere being passed the keyword argument:with-groupsinstead of the correct:with-group. For consistency, thewith-groupsargument ofprescient-filter-regexpswas 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-barorfooboo-barquuxbut notbar-foo(because that doesn't start withfoo) orfoo-qbar(becausebaris no prefix of some word).It can be enabled by adding
literal-prefixtoprescient-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
anchoredtoprescient-filter-method.For example
TTLmatchestoogle-truncate-linesandFiAPoorfiAPomatch bothfind-file-at-pointandfind-function-at-point. HoweverfiFiAPomatches only the former andfiFuAPomatches 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 addingprefixtoprescient-filter-method.As is the case in partial completion,
t-t-lmatchestoggle-truncate-linesandfi--a-pomatchesfind-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-modeis enabled,M-sis bound toselectrum-prescient-toggle-mapin the Selectrum buffer, and is used as a prefix key to access the commands. The macroselectrum-prescient-create-and-bind-toggle-commandcan be used to create a toggling command for a filter, and bind that command inselectrum-prescient-toggle-map.Key Command M-s aselectrum-prescient-toggle-anchoredM-s fselectrum-prescient-toggle-fuzzyM-s iselectrum-prescient-toggle-initialismM-s lselectrum-prescient-toggle-literalM-s pselectrum-prescient-toggle-prefixM-s rselectrum-prescient-toggle-regexp
-
-
The user option
prescient-filter-alistwas added, which describes the relationship between the symbols inprescient-filter-listand 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-alistand 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-regexpprescient-fuzzy-regexpprescient-initials-regexpprescient-literal-regexpprescient-prefix-regexpprescient-regexp-regexpprescient-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-sorthas been improved by a factor of 2x for large collections. The speed ofprescient-filterhas been improved by a factor of 3x.