Commit Graph

32 Commits

Author SHA1 Message Date
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
c795a988e6
Conform many modules to new conventions 2019-07-23 12:30:47 +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
Henrik Lissner
0f8baf3f3e
Minor comment tweaks 2019-04-17 11:19:37 -04:00
Henrik Lissner
b56639e31b
Remove deprecated set! & def-setting! macros 2019-01-05 17:48:46 -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
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
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
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
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
5531d7115a
Fix indentation for many autodef setters 2018-06-22 01:49:21 +02:00
Henrik Lissner
8c5deef5fc
Fix unintern calls (missing second argument) 2018-06-22 01:49:21 +02:00
Henrik Lissner
bc87ccf894
Refactor set-company-backend! & revise docstring 2018-06-22 01:49:19 +02:00
Henrik Lissner
aa4c9744f8
Fix set-company-backends! & update docstring
+ It wasn't preserving insertion order of multiple backends
+ It failed when BACKENDS = nil (supposed to unset mode backends)
+ Use eq/equal as a test-fn conditionally (glorious, glorious premature
  optimization)
2018-06-20 19:44:08 +02:00
Henrik Lissner
746d90c330
make-variable-buffer-local -> make-local-variable
It is more correct to use the latter.
2018-06-19 13:49:18 +02:00
Henrik Lissner
97b42c449b
Allow set-company-backend! to unset backends
Passing nil as its second argument will unset previously set backends.
2018-06-17 21:40:32 +02:00
Henrik Lissner
17981d6a61
Conform hook names to conventions
Also minor reformatting & comment corrections.
2018-06-17 02:25:12 +02:00
Henrik Lissner
3ad16f660f
Refactor set-company-backend! 2018-06-16 12:46:57 +02:00
Henrik Lissner
f81a0e6f41
Remove redundant def-setting! docstrings
def-setting! will now grab the autodef's docstring if it has an
:obsolete property defined.
2018-06-15 16:54:39 +02:00
Henrik Lissner
d8b1e469bc
Introduce autodefs to replace some settings
+ :popup -> set-popup-rule!
+ :popups -> set-popup-rules!
+ :company-backend -> set-company-backend!
+ :evil-state -> set-evil-initial-state!

I am slowly phasing out the setting system (def-setting! and set!),
starting with these.

What are autodefs? These are functions that are always defined, whether
or not their respective modules are enabled. However, when their modules
are disabled, they are replaced with macros that no-op and don't
waste time evaluating their arguments.

The old set! function will still work, for a while.
2018-06-15 03:42:01 +02:00
Henrik Lissner
80bd587d87
Move :company-backend setting to autoload.el
This decouples the company module from module load-order.
2018-06-01 14:54:13 +02:00
Henrik Lissner
5e49239ff2
Give feedback on +company/toggle-auto-completion 2018-05-31 15:59:52 +02:00
Henrik Lissner
5b31fd9505
Use company-dabbrev-code in prog-modes & company-dabbrev everywhere else 2018-05-28 00:08:14 +02:00
Henrik Lissner
3488821b2e
completion/company: minor quoting refactor
Sharp-quote function and use backquotes in pcase (better Emacs <25
compatibility).
2018-05-08 17:57:27 +02:00
Henrik Lissner
b488e4085f
completion/company: add +company/toggle-auto-completion command 2018-02-02 20:47:32 -05:00
Henrik Lissner
9b47d987aa
Add +company/dabbrev-code-previous 2017-06-09 01:09:20 +02:00
Henrik Lissner
c7254e7bdc
Major optimization refactor, across the board
+ enable lexical-scope everywhere (lexical-binding = t): ~5-10% faster
  startup; ~5-20% general boost
+ reduce consing, function calls & garbage collection by preferring
  cl-loop & dolist over lambda closures (for mapc[ar], add-hook, and
  various cl-lib filter/map/reduce functions) -- where possible
+ prefer functions with dedicated opcodes, like assq (see byte-defop's
  in bytecomp.el for more)
+ prefer pcase & cond (faster) over cl-case
+ general refactor for code readability
+ ensure naming & style conventions are adhered to
+ appease byte-compiler by marking unused variables with underscore
+ defer minor mode activation to after-init, emacs-startup or
  window-setup hooks; a customization opportunity for users + ensures
  custom functionality won't interfere with startup.
2017-06-09 00:47:45 +02:00
Henrik Lissner
2b027c0052 Add modules/completion/company 2017-02-20 00:26:08 -05:00