| Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
Fix #55
Only drop the last empty component. The new behavior has the following effects:
1. The first empty component is preserved and can be treated specifically as
requested in #55. The assumption is that a separator at the beginning
is intentional.
(cdr (orderless-compile " ")) => ("")
(cdr (orderless-compile " foo")) => ("" "foo")
2. Completely blank input will compile to an empty regexp list. This is
important for completion command startup performance:
(cdr (orderless-compile "")) => nil
3. When separating components, the last separator will not lead to an
intermediate artificial empty component, as long as the user has
not finished typing. For example the user types the words "foo bar":
(cdr (orderless-compile "foo")) => ("foo")
(cdr (orderless-compile "foo ")) => ("foo")
(cdr (orderless-compile "foo bar")) => ("foo" "bar")
|
|
Orderless expects a list of functions but a hook is not simply that. A hook can
also be a single function, or a list which includes the special value t to
reference the default value of the hook.
|
|
|
|
|
|
|
|
By not only checking the compiled regexp, smart case is also toggled when
matching on annotations, e.g., &Lv as in #184.
|
|
|
|
|
|
|
|
|
|
|
|
Using `completion-substring-try-completion` can be costly in comparison to
prefix completion only via `try-completion`, in particular in the context of
timer-based auto completion. As a compromise, default to `prefix` completion
only. Performance should not be affected, while expansion is still provided.
Depending on preference the expansion setting can be escalated to `substring` or
even disabled, in case the restrictive Orderless (non-)expansion behavior is
preferred.
|
|
If the customization option `orderless-expand-substring` is set to
t, `orderless-try-completion` first tries to treat the input as
literal substring and tries to expand it. If literal substring
expansion fails, Orderless falls back to its regular behavior, and
checks if there exists a single unique match to expand to. The
option `orderless-expand-substring` is effective in the default
completion UI and Corfu when pressing TAB, but does not affect
Vertico. It makes the transition to Orderless a little friendlier
for users accustomed to the Emacs built-in `basic` and `substring`
completion styles.
As an alternative to `orderless-expand-substring` one could define
an alternative completion style `tab` as follows.
(add-to-list 'completion-styles-alist
'(tab completion-substring-try-completion ignore
"Completion style which provides only TAB completion."))
I've used this `tab` configuration style for a long time in my
personal configuration, but the goal is to improve out of the box
behavior of Orderless and related packages. The following two
configurations are equivalent:
;; NEW: Use orderless-expand-substring
(setq completion-styles '(orderless basic)
orderless-expand-substring t)
;; OLD: Use the tab style from above.
(setq completion-styles '(tab orderless basic)
orderless-expand-substring nil)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Otherwise the duplicates created by the orderless-regexp and orderless-literal
styles are not deleted.
|
|
|
|
|
|
|
|
|
|
|
|
The @ sign is used for several other thing like user names on many
services which have Emacs clients, and is also used to add words to
local dictionaries in Jinx.
|
|
Clarify the relation to orderless-literal-prefix.
|
|
Avoid confusion with orderless-prefixes. Registering orderless-literal-prefix
with the ^ character has a modest advantage - it makes sure that the prefix
optimization sets in.
|
|
This makes a difference for multi-line candidates. Multi-line candidates are
uncommon, but they exist, e.g., for read-from-kill-ring.
|
|
Otherwise completion-extra-properties may not be taken into account if the
metadata returned by the completion table is nil.
|
|
The helper function can be reused for other style modifiers, for example a style
matching against the group title returned by the `group-function', which is also
specified by the completion metadata.
|
|
This matching style is useful as a return value of a style dispatcher like
orderless-affix-dispatch. It matches literals as a prefix and triggers the
prefix filter optimization, see `orderless--anchored-quoted-regexp'.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
orderless-annotation and orderless-without take a PRED and a REGEXP argument and
turn it into a new predicate. This looks like a good solution. The complexity is
pushed to orderless--compile-component and orderless-without is as simple as
possible.
|
|
|
|
This way the index and total are preserved even for the recursive matchers.
|
|
|
|
- The dispatchers have a fixed calling convention.
- Explicitly specifying the arguments is both safer and more efficient.
|
|
|
|
|