SLY: Bind s-backspace to sly-switch-to-repl.

master
Pierre Neidhardt 2019-10-13 12:53:46 +02:00
parent 09c7c87ac0
commit 588866917e
2 changed files with 15 additions and 2 deletions

View File

@ -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-<backspace>") #'ambrevar/slime-switch-to-repl)
(exwm-input-set-key (kbd "s-<backspace>") #'sly)
(exwm-input-set-key (kbd "s-<backspace>") #'ambrevar/sly-switch-to-repl)
(defun ambrevar/repl-switcher ()
"Switch between Geiser and SLIME REPLs."
(interactive)

View File

@ -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'.