Skip to content

Releases: radian-software/prescient.el

prescient.el 6.3.1

03 Aug 23:21
Compare
Choose a tag to compare

Bugs fixed

  • In version 6.3 a bug was introduced that caused vertico-directory-enter to no longer remember candidates. This has been fixed.

prescient.el 6.3

26 Feb 02:05
Compare
Choose a tag to compare

Enhancements

  • The completion style now supports lazy highlighting via completion-lazy-hilit and completion-lazy-hilit-fn, new in Emacs 30 and already supported by some completion UIs (#152, #153).

Bugs fixed

  • 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 if corfu--state-vars is not bound (#158, #159).

prescient.el 6.2

23 Nov 22:10
Compare
Choose a tag to compare

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 with prescient-sort-full-matches-first (#148). Custom sorting functions using this data should be changed to search the candidates for the properties, as in prescient--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, and prescient-sort-full-matches-first by tweaking prefix (#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.

prescient.el 6.1

16 Dec 01:18
72b023f
Compare
Choose a tag to compare

New features

  • Add package vertico-prescient, which integrates prescient.el with
    Vertico (#131). New mode vertico-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 mode corfu-prescient-mode configures
    sorting, candidate remembrance, filtering, and binds the toggling
    commands while the Corfu pop-up is active.

prescient.el 6.0

12 Nov 03:45
Compare
Choose a tag to compare

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, we require the library char-fold. This variable apparently isn't always loaded when we call char-fold-to-regexp. See #126.
  • Fix the filter methods literal and literal-prefix not being literal when prescient-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 variable completion-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 combines prescient-sort with the new function prescient-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 the prescient 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 and prescient-secondary-highlight (#125). These faces are used with the completion style and selectrum-prescient.el. The old faces selectrum-prescient-primary-highlight and selectrum-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 the basic style after the prescient style in the user option completion-styles.

Internal Changes

  • prescient-filter now uses the C function all-completions instead of being completely written in Emacs Lisp. This should make it a bit faster. See #125.

prescient.el 5.2.1

01 Jun 16:56
Compare
Choose a tag to compare

Bugs fixed

  • ivy doesn't convert all variables to string when sorting or calling prescient-remember, so it need to preprocess when work with ivy-prescient.el. if not, an wrong-type-argument error may occur. This issue affects the use of format-all-buffer (#119).

prescient.el 5.2

28 Dec 04:18
Compare
Choose a tag to compare

New features

  • Two new user options, selectrum-prescient-enable-filtering and selectrum-prescient-enable-sorting, which allow the user to selectively disable the filtering or sorting functionalities of selectrum-prescient.el (#100).
  • New command selectrum-prescient-toggle-char-fold, bound to M-s ' in the minibuffer.
  • To configure match highlighting you can use the faces selectrum-prescient-primary-highlight and selectrum-prescient-secondary-highlight. The previously used Selectrum faces selectrum-primary-highlight and selectrum-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, the literal and literal-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 of nil, t, or smart (the default). If smart, then case folding is disabled when upper-case characters are sought. In Selectrum, the toggling command selectrum-prescient-toggle-case-fold was bound to M-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 of selectrum-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 in prescient-filter-alist were being passed the keyword argument :with-groups instead of the correct :with-group. For consistency, the with-groups argument of prescient-filter-regexps was changed to with-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

27 Feb 06:02
Compare
Choose a tag to compare

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 with foo, and it must also contain a word starting with bar. That means it would match foo-and-bar or fooboo-barquux but not bar-foo (because that doesn't start with foo) or foo-qbar (because bar is no prefix of some word).

    It can be enabled by adding literal-prefix to prescient-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 to prescient-filter-method.

    For example TTL matches toogle-truncate-lines and FiAPo or fiAPo match both find-file-at-point and find-function-at-point. However fiFiAPo matches only the former and fiFuAPo 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 adding prefix to prescient-filter-method.

    As is the case in partial completion, t-t-l matches toggle-truncate-lines and fi--a-po matches find-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 to selectrum-prescient-toggle-map in the Selectrum buffer, and is used as a prefix key to access the commands. The macro selectrum-prescient-create-and-bind-toggle-command can be used to create a toggling command for a filter, and bind that command in selectrum-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 in prescient-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 to prescient-filter-alist and use that custom method by adding the symbol to prescient-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

16 Jul 14:21
Compare
Choose a tag to compare

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 of prescient-filter has been improved by a factor of 3x.

prescient.el 4.1

31 Mar 14:58
Compare
Choose a tag to compare

Enhancements

  • Package selectrum-prescient.el now uses selectrum-candidate-inserted-hook to update the frecency database of prescient.el when using TAB (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, or selectrum-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.