Commit Graph

121 Commits

Author SHA1 Message Date
dac6e05b87 refactor: deprecate appendq!, prependq!, & delq! macros
In the interest of slimming down Doom's core (as we near v3), I've
deprecated these macros. They doesn't really need to exist. Sure, the
alternatives aren't as ergonomic or elegant, but they're good enough
that we don't need these trivial wrappers. Their local uses have been
refactored out as well.
2025-03-25 14:16:56 -04:00
07afef645a tweak(company): company-idle-delay = 0.26
Bumped up from it's default of 0.2.
2024-09-13 23:07:14 -04:00
88a3961489 fix(company): company-backends not set in some buffers
Any buffers opened before company-mode was loaded would not have
`company-backends` initialized in them.

Fix: #6261
Fix: #6180
Fix: #5896
Fix: #5672
Fix: #2015
2024-09-10 23:34:20 -04:00
9787022b83 refactor!: replace all-the-icons with nerd-icons
BREAKING CHANGE: This commit replaces all-the-icons with nerd-fonts. Any
all-the-icons-* function calls or variable references in your private
config will break and should be replaced with their nerd-icons-*
equivalent. That said, Doom will continue to install all-the-icons for
a while, so feel free to load it if you don't want to fully commit to
the change yet.

This change is happening because nerd-icon has wider support for GUI and
TUI Emacs; has a larger, more consistent selection of symbols; plus unicode
coverage.

Fix: #7368
Close: #6675
Close: #7364
2023-09-14 01:03:55 +02:00
22097b5a75 fix(company): hook company-abort when +childframe enabled 2023-03-20 18:55:17 -04:00
a5c80fcb4b refactor: deprecate doom-private-dir for doom-user-dir
- Deprecates the doom-private-dir variable in favor of doom-user-dir.
- Renames the pseudo category for the user's module: :private -> :user.
- Renames the doom-private-error error type to doom-user-error.

Emacs uses the term "user" to refer to the "things" in user space (e.g.
user-init-file, user-emacs-directory, user-mail-address, xdg-user-dirs,
package-user-dir, etc), and I'd like to be consistent with that. It also
has the nice side-effect of being slightly shorter. I also hope
'doom-user-error' will be less obtuse to beginners than
'doom-private-error'.
2022-08-14 20:43:35 +02:00
ad6a3d0f33 refactor: deprecate featurep! for modulep!
featurep! will be renamed modulep! in the future, so it's been
deprecated. They have identical interfaces, and can be replaced without
issue.

featurep! was never quite the right name for this macro. It implied that
it had some connection to featurep, which it doesn't (only that it was
similar in purpose; still, Doom modules are not features). To undo such
implications and be consistent with its namespace (and since we're
heading into a storm of breaking changes with the v3 release anyway),
now was the best opportunity to begin the transition.
2022-08-14 20:43:35 +02:00
480d9fec28 feat(company): disable company in circe-mode
Fix: #5451
2021-12-15 15:18:11 +01:00
d79cea2e4c Minor refactors, reformatting, & comment revision 2021-07-11 17:52:08 -04:00
933dcc4d19 Bump :completion
DarwinAwardWinner/ido-completing-read-plus@0067472 -> DarwinAwardWinner/ido-completing-read-plus@49e7967
abo-abo/swiper@a5eade0 -> abo-abo/swiper@56139df
company-mode/company-mode@ee3177c -> company-mode/company-mode@d771840
emacs-helm/helm@a7bd522 -> emacs-helm/helm@42e2836
sebastiencs/company-box@aa5f09a -> sebastiencs/company-box@c8a8671
tumashu/ivy-posframe@084cc59 -> tumashu/ivy-posframe@9c83828
tumashu/posframe@739d8fd -> tumashu/posframe@f97c4af
2021-07-10 22:36:36 -04:00
3ba364ae10 Minor refactoring across the board 2021-05-23 22:09:07 -04:00
d2426d8442 Disable company-mode in vterm-mode
Doesn't do anything but hijack the TAB key. Company offers no meaningful
completion in vterm buffers anyway.
2021-05-11 21:50:14 -04:00
1274de3d34 Minor reformatting & refactors across the board 2021-02-25 13:59:43 -05:00
a9f57f14ac Fix #4355: trigger eldoc after company completions 2020-12-02 17:58:10 -05:00
29d8f44254 Add comments 2020-11-16 19:27:39 -05:00
44a6c9b2c8 Fix oversized company-box scrollbars 2020-11-16 19:19:43 -05:00
b61096578a Hide tab-bar line in company-box frames 2020-11-16 19:18:56 -05:00
41885c4e72 Revert company-idle-delay to package default (0.5)
Setting a default for this variable is dangerous. Set it to low and
modes with slow backends will give users the impression that this is
typing latency (they'll suspect something else, likely Doom, before
suspecting their lsp servers or company backends). Set it too high and
users may misinterpret this as latency. Turn it off (set to nil) and
I'll get a dozen "code completion isn't working" bug reports.

I've settled on company's own default of 0.5 (which is twice as slow as
Doom's original default) because responsiveness while typing is more
important (and more frustrating to deal with), but it's still enabled,
so users are more likely to notice it than assume code completion isn't
working.
2020-11-03 16:05:12 -05:00
2e476de446 Fix #1335: company keymaps losing precedence to evil 2020-10-16 00:28:25 -04:00
15d976142c Fix #4000: company-box breaks if frames are deleted
Company-box doesn't perform frame-live-p checks before trying to use its
childframes, so any operation that cleans up the current session (like
`SPC TAB x`) would break it.

Should be fixed upstream.
2020-10-15 18:13:42 -04:00
c5605e9de5 Bump :completion
abo-abo/swiper@9bb6841 -> abo-abo/swiper@b65e401
company-mode/company-mode@4462e7d -> company-mode/company-mode@8c22b58
emacs-helm/helm@d2fbf66 -> emacs-helm/helm@19d2ba9
lewang/flx@17f5c9c -> lewang/flx@05600ff
raxod502/prescient.el@cc289ba -> raxod502/prescient.el@0c5d611
sebastiencs/company-box@d8f71fd -> sebastiencs/company-box@be37a9a
tumashu/ivy-posframe@4474956 -> tumashu/ivy-posframe@1e602a7
tumashu/posframe@7b92a54 -> tumashu/posframe@5696463

Fix #4013 due to company-mode/company-mode#1020
2020-10-07 21:51:10 -04:00
fd3b89854e completion/company: minor refactor/reformatting 2020-08-07 20:15:15 -04:00
e7c21634a7 Remove company-prescient
Prescient re-sorts completion candidates by frecency, which is
disruptive for backends that do their own sorting (like LSP or sly, or
any backend that does fuzzy completion). It also slows down the
presentation of candidates by at least a magnitude of 2. The net loss in
performance and accuracy doesn't justify having frecency sorting, and
disabling it on a per-mode basis is too big a maintenance hassle.

Fix #3630
2020-07-26 14:43:19 -04:00
bbe3cbdaf6 Activate global-company-mode on doom-first-input-hook 2020-05-17 20:37:07 -04:00
bdd4657e23 Prevent company-abort side-effects suppressing echo-area
e.g. some sly commands (like sly-compile-defun) log to the echo area,
but company-abort was being called every time normal mode is
invoked (which happens more often than you'd think). It would be fine if
company-abort noop'ed if company wasn't active, but it doesn't; side
effects ensue.
2020-05-17 20:31:51 -04:00
ea18c83c0a General refactors & reformatting across the board 2020-05-15 01:44:53 -04:00
a70cfce520 Merge branch 'develop' into eshell-improvements 2020-05-06 10:33:39 -04:00
8b52e8ca0f Refactor company defaults
In the interest of performance and reducing things we have to maintain.
2020-04-30 01:35:20 -04:00
85cf7a794b Fixes from PR feedback
This contains fixes suggested by Henrik as feedback from the initial PR,
including updating and correcting the Eshell module README, and few
tweaks to the module configuration, and properly pinning
eshell-did-you-mean.
2020-04-28 09:35:06 -04:00
b78fc4eb76 Minor refactor & reformatting across the board 2020-04-08 15:30:10 -04:00
7e40c1ebe3 Fix #2752: self-aborting company-box/docs 2020-04-02 00:46:58 -04:00
169f9a6121 General, minor refactor & reformatting 2020-03-27 01:25:30 -04:00
cd5152497d Ensure company-backends are computed late in mode init 2020-02-25 20:03:58 -05:00
7f9623249f Abort company popups when entering normal mode
You likely don't need completion anymore once you exit insert state.
2020-02-20 20:30:43 -05:00
6f273ffc25 Totally disable company-box scrollbar
Since the problem persists despite the earlier window-width fix.

Fixes sebastiencs/company-box#44
2020-01-13 01:46:43 -05:00
b320075c5b Add company-box scrollbar "fix" & refactor config 2020-01-13 00:08:59 -05:00
99cd52e70f 💥 Drop Emacs 25.x support
Emacs 26.1 is Doom's new minimum supported version

Closes #2026
2019-11-08 16:02:06 -05:00
f779c3b781 completion/company: remove unneeded transient hook 2019-10-14 02:54:44 -04:00
5999fee7c3 completion/company: load company earlier
Potentially addresses #1696, #1687, #1686, #993
2019-10-12 19:31:59 -04:00
d74ed618ce moved company-files-regexps change from org/config to company/conif 2019-10-10 20:34:52 +02:00
9a79f3815f moved comapny files regexp for org mode to org/config.el 2019-10-10 10:04:30 +02:00
596e7c97a9 added company-files support for file links in org mode 2019-10-09 23:21:33 +02:00
19ecf8e46a Correct last inline hook defuns
See a3e262c7 for rationale
2019-07-28 16:10:53 +02:00
82ae3a73f3 def-advice!->defadvice! & conform to new advice conventions
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.
2019-07-23 17:24:56 +02:00
76cacb5bfe 💥 Rename def-package! -> use-package!
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.
2019-07-23 12:50:45 +02:00
c795a988e6 Conform many modules to new conventions 2019-07-23 12:30:47 +02:00
060ede0e2e General, minor reformatting across the board
And an offering of blood to our great lord Byte Compiler-sama.
2019-07-22 02:37:45 +02:00
149b2617b0 💥 revise hook/var fns naming convention (2/2)
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.
2019-07-22 02:30:38 +02:00
51d3b1b424 💥 revise advice naming convention (1/2)
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.
2019-07-22 02:27:45 +02:00
683683736d Cancel previous company popup when invoking another
Enables uses to switch between backends, e.g. C-x C-s followed by C-x
C-n in insert mode.
2019-07-09 16:12:44 +02:00