SLY: Use internal completion instead of Company.

master
Pierre Neidhardt 2021-02-19 11:10:35 +01:00
parent 0410f342a2
commit ed5c68bcbe
1 changed files with 21 additions and 11 deletions

View File

@ -264,19 +264,29 @@ Good substitute for `sly-mrepl-indent-and-complete-symbol'."
;; REVIEW: With Emacs 27 we can:
;; (customize-set-variable 'helm-completion-style 'emacs)
;; (add-to-list 'completion-styles 'backend)
;; (add-to-list 'completion-styles 'backend) ; Useless?
(when (require 'helm-sly nil 'noerror)
;; (add-hook 'sly-mrepl-hook #'helm-sly-disable-internal-completion)
(add-hook 'sly-mrepl-hook #'helm-sly-disable-internal-completion)
;; REVIEW: Company completion has the benefit of having annotations.
(when (require 'helm-company nil :noerror)
(add-hook 'lisp-mode-hook #'company-mode)
(define-key lisp-mode-map (kbd "<tab>") 'ambrevar/indent-and-helm-company)
(define-key lisp-mode-map (kbd "M-<tab>") 'ambrevar/indent-and-helm-company)
(defun ambrevar/sly-set-keys ()
(define-key sly-mrepl-mode-map (kbd "<tab>") 'ambrevar/indent-and-helm-company)
(define-key sly-mrepl-mode-map (kbd "M-<tab>") 'ambrevar/indent-and-helm-company))
(add-hook 'sly-mrepl-hook #'ambrevar/sly-set-keys)
(add-hook 'sly-mrepl-hook #'company-mode)))
;; (when (require 'helm-company nil :noerror)
;; (add-hook 'lisp-mode-hook #'company-mode)
;; (define-key lisp-mode-map (kbd "<tab>") 'ambrevar/indent-and-helm-company)
;; (define-key lisp-mode-map (kbd "M-<tab>") 'ambrevar/indent-and-helm-company)
;; (defun ambrevar/sly-set-keys ()
;; (define-key sly-mrepl-mode-map (kbd "<tab>") 'ambrevar/indent-and-helm-company)
;; (define-key sly-mrepl-mode-map (kbd "M-<tab>") 'ambrevar/indent-and-helm-company))
;; (add-hook 'sly-mrepl-hook #'ambrevar/sly-set-keys)
;; (add-hook 'sly-mrepl-hook #'company-mode))
)
;; Cons of internal completion vs. company completion.
;; - Internal does not support spaces like Helm does.
;; - Word order matters.
;; - Cannot complete against current package.
;; - [ ] File completion does not work.
;; Pros:
;; - Current suffix is included.
;; - Less config.
(when (require 'helm-selector nil :noerror)
(require 'init-sly-selector))