SLY: Use helm-sly instead of helm-lisp and use native Helm completion.

master
Pierre Neidhardt 2019-10-16 18:05:20 +02:00
parent 383e3e7b3d
commit 236bfd1e56
1 changed files with 10 additions and 3 deletions

View File

@ -55,20 +55,22 @@
(ccl ("ccl"))
(ecl ("ecl"))))
(setq sly-command-switch-to-existing-lisp 'always)
(add-hook 'sly-mrepl-hook 'ambrevar/init-lispy)
(add-hook 'sly-mrepl-hook #'ambrevar/init-lispy)
(add-hook 'sly-mrepl-hook #'rainbow-delimiters-mode)
(add-hook 'sly-mrepl-hook #'company-mode))
(when (require 'helm-sly nil 'noerror)
(add-hook 'sly-mrepl-hook #'helm-sly-disable-internal-completion)))
(defun ambrevar/sly-switch-to-repl () ; TODO: Replace with `helm-defswitch'.
(interactive)
(require 'sly)
(require 'helm-sly)
(pcase (length sly-net-processes)
(0 (sly))
(_ (let ((output-buffer (sly-mrepl--find-buffer (sly-current-connection))))
(cond
((and (eq (current-buffer) output-buffer)
(require 'helm-slime nil 'no-error))
(helm-lisp-mini))
(helm-sly-mini))
(output-buffer
(pop-to-buffer output-buffer))
(t (sly nil nil t)))))))
@ -124,6 +126,11 @@
(add-hook 'slime-repl-mode-hook 'ambrevar/init-lispy)
(add-hook 'slime-repl-mode-hook #'ambrevar/slime-rainbow-init)))
(when (require 'helm-sly nil 'noerror)
(global-helm-sly-mode)
(add-to-list 'helm-source-names-using-follow "Lisp xrefs"))
(when (require 'helm-slime nil 'noerror)
(global-helm-slime-mode)
(add-to-list 'helm-source-names-using-follow "SLIME xrefs"))