From: rearman Date: Tue, 16 Sep 2025 15:09:54 +0000 (-0400) Subject: Add helper defuns and bindings for sly X-Git-Url: https://git.earman.xyz/?a=commitdiff_plain;h=01f284da818f8109da95906f70e137763dbe08bd;p=emacsinit.git Add helper defuns and bindings for sly Open REPL with F7, in new frame with S-F7. Connect to stumpwm with F9, general connect with S-F9. Call sly-quit-lisp on active repl with C-c q. --- diff --git a/re/re-packages.el b/re/re-packages.el index 6dd30b3..db06a85 100644 --- a/re/re-packages.el +++ b/re/re-packages.el @@ -88,7 +88,13 @@ sly-command-switch-to-existing-lisp 'always) (let ((core (expand-file-name "~/sbcl.core-for-sly"))) (when (file-exists-p core) - (setq sly-lisp-implementations (list `(sbcl ("sbcl" "--core" ,core))))))) + (setq sly-lisp-implementations (list `(sbcl ("sbcl" "--core" ,core)))))) + :bind + (("" . sly) + ("S-" . re/sly-repl-new-frame) + ("" . re/sly-connect-stump) + ("S-" . sly-connect) + (:map sly-mrepl-mode-map ("C-c q" . re/sly-quit-current-lisp)))) (use-package geiser :config @@ -122,7 +128,8 @@ ("S-" . re/org-show-agenda) ("S-" . re/org-agenda-new-frame) ("S-" . re/org-agenda-show-custom) - :map org-mode-map + :map + org-mode-map ("M-" . org-shiftmetaright) ("M-" . org-shiftmetaleft) ("M-S-" . org-metaright) diff --git a/re/re-repl-defuns.el b/re/re-repl-defuns.el index 50f72dd..b0462b2 100644 --- a/re/re-repl-defuns.el +++ b/re/re-repl-defuns.el @@ -62,5 +62,15 @@ Stolen from https://depp.brause.cc/dotemacs" (select-frame (make-frame '((name . "SLY")))) (call-interactively 'sly)) +(defun re/sly-quit-current-lisp () + "Quit the current lisp repl connection without prompting." + (interactive) + (sly-quit-lisp nil nil)) + +(defun re/sly-connect-stump (&optional arg) + "Connect to my typical stumpwm instance." + (interactive "P") + (sly-connect "localhost" 4004)) + (provide 're-repl-defuns) ;;; re-repl-defuns.el ends here