If the same line is present more than once in the buffer, it will be
offered more than once as a candidate. This commit deletes duplicate
lines from the completion list.
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
This commit does two things:
- Renames def-advice! to defadvice!, in the spirit of naming convenience
macros after the function/macro they enhance or replace.
- Correct the names of advice functions to indicate visibility and
intent. A public advice function like doom-set-jump-a is meant to be
used elsewhere. A private one like +dired--cleanup-header-line-a
shouldn't -- it likely won't work anywhere but the function(s) it was
made to advise.
Calling this pivotal macro "def-package!" has frequently been a source
of confusion. It is a thin wrapper around use-package, and it should be
obvious that it is so. For this reason, and to match the naming
convention used with other convenience macros/wrappers, it is now
use-package!.
Also changes def-package-hook! -> use-package-hook!
The old macros are now marked obsolete and will be removed when straight
integration is merged.
This is second of three big naming convention changes. In this commit,
we change the naming conventions for hook functions and variable
functions:
1. Replace the bar | to indicate a hook function with a -h suffix, e.g.
doom|init-ui -> doom-init-ui-h
doom|run-local-var-hooks -> doom-run-local-var-hooks-h
2. And add a -fn suffix for functions meant to be set on variables,
e.g.
(setq magit-display-buffer-function #'+magit-display-buffer-fn)
See ccf327f8 for the reasoning behind these changes.
This is first of three big naming convention updates that have been a
long time coming. With 2.1 on the horizon, all the breaking updates will
batched together in preparation for the long haul.
In this commit, we do away with the asterix to communicate that a
function is an advice function, and we replace it with the '-a' suffix.
e.g.
doom*shut-up -> doom-shut-up-a
doom*recenter -> doom-recenter-a
+evil*static-reindent -> +evil--static-reindent-a
The rationale behind this change is:
1. Elisp's own formatting/indenting tools would occasionally struggle
with | and * (particularly pp and cl-prettyprint). They have no
problem with / and :, fortunately.
2. External syntax highlighters (like pygmentize, discord markdown or
github markdown) struggle with it, sometimes refusing to highlight
code beyond these symbols.
3. * and | are less expressive than - and -- in communicating the
intended visibility, versatility and stability of a function.
4. It complicated the regexps we must use to search for them.
5. They were arbitrary and over-complicated to begin with, decided
on haphazardly way back when Doom was simply "my private config".
Anyhow, like how predicate functions have the -p suffix, we'll adopt the
-a suffix for advice functions, -h for hook functions and -fn for
variable functions.
Other noteable changes:
- Replaces advice-{add,remove}! macro with new def-advice!
macro. The old pair weren't as useful. The new def-advice! saves on a
lot of space.
- Removed "stage" assertions to make sure you were using the right
macros in the right place. Turned out to not be necessary, we'll
employ better checks later.
Makes it easier to change company-backends retrospectively (with a hook
or setq-hook!). Also simplifies how backend defaults are stored (no more
of this :derived and :exact business).
Also updates unit tests.
This provides an alternative backend for filtering and sorting ivy
searches. Uses prescient instead of flx for fuzzy completion when both
+prescient and +fuzzy are selected.
:feature was a "catch-all" category. Many of its modules fit better in
other categories, so they've been moved:
- feature/debugger -> tools/debugger
- feature/evil -> editor/evil
- feature/eval -> tools/eval
- feature/lookup -> tools/lookup
- feature/snippets -> editor/snippets
- feature/file-templates -> editor/file-templates
- feature/workspaces -> ui/workspaces
More potential changes in the future:
- A new :term category for terminal emulation modules (eshell, term and
vterm).
- A new :os category for modules dedicated to os-specific functionality.
The :tools macos module would fit here, but so would modules for nixos
and arch.
- A new :services category for web-service integration, like wakatime,
twitter, elfeed, gist and pastebin services.
company-active-map and company-search-map were losing to global evil
state keymaps, causing an odd issue with the insert keybind for C-j was
overriding C-j (company-select-next) when company was active and
completing.
+ Added +smartparens flag to config/default for default smartparens
config.
+ Fixed +tng support for completion/company.
+ Removed super keybinds (for all but MacOS)
+ Moved "keybind fixes" to config/default/config.el (these should be
universally available).
+ Replaced both +default-repeat-forward-key and +default-repeat-backward-key
with +default-repeat-keys. If this variable is nil, the universal
repeat motions won't be bound.
Completion rarely works in the middle of (or at the beginning of) a
symbol, so we insert a space in front of the cursor in those cases and
then invoke completion.
Company backends are now built from an alist (+company-backend-alist),
which can be manipulated through set-company-backend!. Backends can now
be set to all children of a parent mode (text-mode, prog-mode, etc),
like so:
(set-company-backend! :derived 'text-mode 'company-dabbrev)
or only for an exact major-mode:
(set-company-backend! 'markdown-mode 'company-dabbrev-code)
Backends cascade. So combining the two examples above will cause
company-backends in a markdown-buffer (which is derived from text-mode)
to be (company-dabbrev-code company-dabbrev).