]> git.earman.xyz Git - emacsinit.git/commitdiff
Add helper defuns and bindings for sly
authorrearman <rearman@r717.net>
Tue, 16 Sep 2025 15:09:54 +0000 (11:09 -0400)
committerrearman <rearman@r717.net>
Tue, 16 Sep 2025 15:09:54 +0000 (11:09 -0400)
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.

re/re-packages.el
re/re-repl-defuns.el

index 6dd30b3768dbfd635d3f5acbf7b25eae00c33cd4..db06a8567c42d4836f23c70259a68d66c8bacc3f 100644 (file)
        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
+  (("<f7>" . sly)
+   ("S-<f7>" . re/sly-repl-new-frame)
+   ("<f9>" . re/sly-connect-stump)
+   ("S-<f9>" . sly-connect)
+   (:map sly-mrepl-mode-map ("C-c q" . re/sly-quit-current-lisp))))
 
 (use-package geiser
   :config
    ("S-<f6>" . re/org-show-agenda)
    ("S-<f7>" . re/org-agenda-new-frame)
    ("S-<f8>" . re/org-agenda-show-custom)
-   :map org-mode-map
+   :map
+   org-mode-map
    ("M-<right>" . org-shiftmetaright)
    ("M-<left>" . org-shiftmetaleft)
    ("M-S-<right>" . org-metaright)
index 50f72ddace6baaa2f7fdd0ac2cbb332047fb6a25..b0462b2f485def8e1caae2934030bd859bab2794 100644 (file)
@@ -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