diff --git a/.emacs.d/lisp/init-exwm.el b/.emacs.d/lisp/init-exwm.el index 66d97f21..ae0e2ff0 100644 --- a/.emacs.d/lisp/init-exwm.el +++ b/.emacs.d/lisp/init-exwm.el @@ -117,8 +117,7 @@ (exwm-input-set-key (kbd "s-p") #'helm-pass)) (autoload 'ambrevar/slime-to-repl "lisp") -;; (exwm-input-set-key (kbd "s-") #'ambrevar/slime-switch-to-repl) -(exwm-input-set-key (kbd "s-") #'sly) +(exwm-input-set-key (kbd "s-") #'ambrevar/sly-switch-to-repl) (defun ambrevar/repl-switcher () "Switch between Geiser and SLIME REPLs." (interactive) diff --git a/.emacs.d/lisp/init-lisp.el b/.emacs.d/lisp/init-lisp.el index 655fb2fb..c113de36 100644 --- a/.emacs.d/lisp/init-lisp.el +++ b/.emacs.d/lisp/init-lisp.el @@ -58,6 +58,20 @@ (add-hook 'sly-mrepl-hook #'rainbow-delimiters-mode) (add-hook 'sly-mrepl-hook #'company-mode)) +(defun ambrevar/sly-switch-to-repl () ; TODO: Replace with `helm-defswitch'. + (interactive) + (require '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)) + (output-buffer + (pop-to-buffer output-buffer)) + (t (sly nil nil t))))))) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; SLIME (defun ambrevar/slime-switch-to-repl () ; TODO: Replace with `helm-defswitch'.