Commit Graph

123 Commits

Author SHA1 Message Date
Henrik Lissner
f779c3b781
completion/company: remove unneeded transient hook 2019-10-14 02:54:44 -04:00
Henrik Lissner
5999fee7c3
completion/company: load company earlier
Potentially addresses #1696, #1687, #1686, #993
2019-10-12 19:31:59 -04:00
Jakub Darul
d74ed618ce moved company-files-regexps change from org/config to company/conif 2019-10-10 20:34:52 +02:00
Jakub Darul
9a79f3815f moved comapny files regexp for org mode to org/config.el 2019-10-10 10:04:30 +02:00
Jakub Darul
596e7c97a9 added company-files support for file links in org mode 2019-10-09 23:21:33 +02:00
Henrik Lissner
0690bac82f
completion/company: update plugin list in readme 2019-09-26 14:26:48 -04:00
Henrik Lissner
19ecf8e46a
Correct last inline hook defuns
See a3e262c7 for rationale
2019-07-28 16:10:53 +02:00
Rudi Grinberg
7c523f2c15 Uniquify completion candidates of whole lines
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>
2019-07-28 01:19:45 +07:00
Henrik Lissner
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
Henrik Lissner
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
Henrik Lissner
c795a988e6
Conform many modules to new conventions 2019-07-23 12:30:47 +02:00
Henrik Lissner
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
Henrik Lissner
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
Henrik Lissner
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
Henrik Lissner
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
Henrik Lissner
281ea56643
completion/company: refactor backend resolution
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.
2019-06-29 01:39:23 +02:00
Andrew Whatson
2a511a6576 Add +prescient option for :completion ivy
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.
2019-05-29 00:46:57 +10:00
Henrik Lissner
04acb8fa98
completion/company: +auto by default
Questions regarding "completion not working" are very common, so the
+auto flag has been removed and idle completion enabled by default.
2019-05-04 19:13:25 -04:00
Henrik Lissner
952a86c2e5
completion/company: revise idle completion in docs 2019-05-01 21:02:29 -04:00
Henrik Lissner
77e4cc4d58
💥 Remove :feature category
: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.
2019-04-24 18:16:04 -04:00
Thiago Kenji Okada
0beb194e23 Document company +tng flag 2019-04-18 00:23:07 -03:00
Henrik Lissner
0f8baf3f3e
Minor comment tweaks 2019-04-17 11:19:37 -04:00
Henrik Lissner
5b43b2840b
Fix RET/TAB company keybinds in GUI Emacs 2019-04-01 13:12:03 -04:00
Andrew Whatson
979c201bf1 Fix latest company-box all-the-icons configuration 2019-03-12 23:23:19 +10:00
Henrik Lissner
1f23eecdc8
(Try to) homogenize TAB/RET/ESC keybinds
Map them to \t/^M/^[, rather than [tab], [return] and [escape].
2019-03-08 04:25:45 -05:00
Henrik Lissner
50de8a07dd
Reduce company+evil keymap conflicts #903
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.
2019-03-02 02:04:28 -05:00
Henrik Lissner
e11ea611cf
Move company-dict-dir to DOOMDIR/dicts 2019-03-02 01:38:54 -05:00
Henrik Lissner
f45073880b
Use new company-box-show-single-candidate option
And remove old hack since sebastiencs/company-box#40 was merged.
2019-01-22 19:29:13 -05:00
Henrik Lissner
b56639e31b
Remove deprecated set! & def-setting! macros 2019-01-05 17:48:46 -05:00
Henrik Lissner
daa26a86ba
completion/company: rewrite README 2019-01-03 01:29:57 -05:00
Henrik Lissner
9f2dff02fa
Rethink config/default & keybindings
+ 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.
2018-12-24 00:04:50 -05:00
Henrik Lissner
d21887149f
Minor refactor/reformatting 2018-10-06 20:44:25 -04:00
Henrik Lissner
b4b19c40bf
company-capf = universal default company-backend
Also removes company-files from sly-mrepl-mode, because sly's capf
completion includes file completion.
2018-10-03 11:18:58 -04:00
Henrik Lissner
5a079c7fd6
Enable company-mode in comint-modes 2018-09-23 16:30:23 -04:00
Henrik Lissner
5ef94de541 Minor refactor, reformat & comment revision 2018-09-18 21:39:54 -04:00
Henrik Lissner
daccdc3e53
completion/company: fix lsp icons
Fixes a wrong-type-argument error from company-box-frontend.

Also reformats elisp company-box-icons-elisp icon list.
2018-09-16 18:19:34 -04:00
Henrik Lissner
7d3ffdff06
Remove third line in section headers
This is truly important stuff. We've saved many lives with this update.
2018-09-09 09:58:19 -04:00
Henrik Lissner
381851aab6
Prevent wrong-type error on +company/complete 2018-08-26 22:02:35 +02:00
Henrik Lissner
3948704c69
completion/company: add +tng flag & support 2018-08-25 19:54:11 +02:00
Henrik Lissner
0009c7bebf
Append space on C-SPC if not at end-of-symbol
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.
2018-08-25 15:16:28 +02:00
Henrik Lissner
808c1356df
Don't sort company candidates by default 2018-08-08 23:37:30 +02:00
Henrik Lissner
c385ed7708
Set no default company-backends
No magic. Let the user decide exactly what backends to use for any given
buffer.
2018-08-07 21:31:34 +02:00
Henrik Lissner
e266ec9eec
Add company-ispell to default text-mode backends 2018-08-06 23:03:02 +02:00
Henrik Lissner
eaaf6751d3
Polish docstring for set-company-backend! 2018-08-06 22:41:44 +02:00
Henrik Lissner
316a9f06b2
completion/company: add company-prescient 2018-08-04 02:14:43 +02:00
Henrik Lissner
b2b8d5d260
Fix company-backends circular-list error in latex 2018-07-30 13:05:02 +02:00
Henrik Lissner
533cb13a02
Append default backends to buffer-local backends 2018-07-30 12:57:26 +02:00
Henrik Lissner
22aeaec399
Refactor how company-backends are set and stored
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).
2018-07-30 03:43:42 +02:00
Henrik Lissner
80a3c9bf62
Fix company-box not showing lone candidates
Revert this once sebastiencz/company-box#40 is merged.
2018-07-05 21:45:44 +02:00
Henrik Lissner
dfed54c7ad
Shrink oversized company-box icons
This would cause lines in company-box frames to be too large, making the
last candidate seem cut off by the frame edge.
2018-07-05 21:40:34 +02:00