From 11f2782f2bfd2189a4b0835ae5c1c565d669b5bc Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 5 May 2021 17:22:33 -0500 Subject: Correctly configure sly and slime keybindings Had to load them after the files. --- init.el | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/init.el b/init.el index e2d5950..1715c9a 100644 --- a/init.el +++ b/init.el @@ -77,7 +77,8 @@ lisp-mode lisp-interaction-mode scheme-mode - slime-repl-mode) + slime-repl-mode + sly-mrepl-mode) "List of modes that are lisp-like enough to hook packages into.") @@ -664,26 +665,38 @@ "~/var/quicklisp/slime-helper.el")))) (load slime-helper)) - (define-key slime-repl-mode-map (kbd "RET") #'slime-repl-return-at-end) - (define-key slime-repl-mode-map (kbd "") - #'slime-repl-return-at-end) - + (with-eval-after-load 'slime + (dolist (key (list (kbd "RET") + (kbd ""))) + (define-key slime-repl-mode-map key #'slime-repl-return-at-end))) (defun slime-repl-return-at-end () (interactive) (if (<= (point-max) (point)) (slime-repl-return) (slime-repl-newline-and-indent))) - (with-eval-after-load 'company (setup (:straight slime-company) (:option slime-company-completion 'fuzzy slime-company-after-completion nil) (slime-setup '(slime-fancy slime-company)))))) - + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (:sly (setup (:straight sly) (:option sly-kill-without-query-p t) + + (with-eval-after-load 'sly + (dolist (key (list (kbd "RET") + (kbd ""))) + (define-key sly-mrepl-mode-map key #'sly-mrepl-return-at-end))) + + (defun sly-mrepl-return-at-end () + (interactive) + (if (<= (point-max) (point)) + (sly-mrepl-return) + (if (bound-and-true-p paredit-mode) + (paredit-newline) + (electric-newline-and-maybe-indent)))) (:also-load sly-autoloads))))) -- cgit 1.4.1-21-gabe81