From ed5c68bcbee9060fcb4f30f772a524ea04a03936 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Fri, 19 Feb 2021 11:10:35 +0100 Subject: [PATCH] SLY: Use internal completion instead of Company. --- .emacs.d/lisp/init-sly.el | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/.emacs.d/lisp/init-sly.el b/.emacs.d/lisp/init-sly.el index efc150ba..bfd13e39 100644 --- a/.emacs.d/lisp/init-sly.el +++ b/.emacs.d/lisp/init-sly.el @@ -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 "") 'ambrevar/indent-and-helm-company) - (define-key lisp-mode-map (kbd "M-") 'ambrevar/indent-and-helm-company) - (defun ambrevar/sly-set-keys () - (define-key sly-mrepl-mode-map (kbd "") 'ambrevar/indent-and-helm-company) - (define-key sly-mrepl-mode-map (kbd "M-") '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 "") 'ambrevar/indent-and-helm-company) + ;; (define-key lisp-mode-map (kbd "M-") 'ambrevar/indent-and-helm-company) + ;; (defun ambrevar/sly-set-keys () + ;; (define-key sly-mrepl-mode-map (kbd "") 'ambrevar/indent-and-helm-company) + ;; (define-key sly-mrepl-mode-map (kbd "M-") '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))