This makes switching between Emacs 29.x and 30.x much easier, as
straight doesn't need to re-build all packages from scratch when the
Emacs version changes.
These macros work more or less like add-to-list, except they will always
leave ELEMENT as the first/last element in the list, while add-to-list
does not modify the list if ELEMENT is already present anywhere in the
list.
This is mostly a helper function for when I've messed around with active
modes in a file buffer a whole bunch, and I just want to revert all
things to the default state of when the file is opened.
Both undo-fu and undo-fu-session are hosted on codeberg, which seems to
be down right now. Hence instead let's pull in these packages from the
mirrors on the emacsmirrors GitGub org.
Use fussy instead of orderless for filtering and scoring/ordering
completion candidates. This seems to overall order results in a much
better way than just orderless.
Technically orderless is still used to filter the candidate list, but
fzf-native is used to score/order the results.
I opted for accepting copilot completions using C-<tab> /
<backtab> (shift+tab) instead of regular tab, as it was often getting in
the way of yasnippet and lsp completion suggestions. This allows a more
explicit acceptance of Copilot suggestions.
Also replace undohist with undo-fu-session.
Overall this seems to yield a more reliable undo history, as undo-fu and
vundo supposedly operate with vanilla emacs undo history state, while
undo-tree supposedly does some custom tweaks to the undo state.
Move away from the whitespace-cleanup-mode package, and instead simply
define our own whitespace-cleanup-on-save-mode minor-mode that uses a
before-save-hook.
This applies especially in lsp-mode. Yasnippet snippets now show as
completion candidates if the word at point exactly matches a snippet
keyword, otherwise it'll fallback to normal lsp backed completion.
And it also supports completing file/directory names now too while
lsp-mode is active.
All this is done by modifying completion-at-point-functions after
lsp-mode has done it's trickery with it. Along with a dirty hack to
company-yasnippet to make it only activate on exact matches. Without
this hack, lsp backed completion rarely activates as snippets would have
higher priority if there's any partial matches.
Visually ctrlf is very nice, but it seems one of it's features is to
stay active in the mini-buffer until explicitly cancelled. This can
easily lead to annoyance if you mess up a C-x C-s keybind and then move
on to other buffers and such, as ctrlf will still be active.
Regular isearch however will dismiss itself as soon as you do anything
other than typing in a search query. Hence causing a lot less annoyance
for me.