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