2018-10-03 01:24:29 -04:00
|
|
|
;;; lang/common-lisp/autoload/common-lisp.el -*- lexical-binding: t; -*-
|
2018-06-22 01:03:26 +02:00
|
|
|
|
2019-10-08 22:00:30 -04:00
|
|
|
;; HACK Fix #1772: void-variable sly-contribs errors due to sly packages (like
|
|
|
|
;; `sly-macrostep') trying to add to `sly-contribs' before it is defined.
|
|
|
|
;;;###autoload (defvar sly-contribs '(sly-fancy))
|
2023-02-26 15:57:35 +09:00
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
(defun +lisp/open-repl ()
|
|
|
|
"Open the Sly REPL."
|
|
|
|
(interactive)
|
|
|
|
(require 'sly)
|
|
|
|
(if (sly-connected-p) (sly-mrepl)
|
|
|
|
(sly nil nil t)
|
|
|
|
(cl-labels ((recurse (attempt)
|
|
|
|
(sleep-for 1)
|
|
|
|
(cond ((sly-connected-p) (sly-mrepl))
|
|
|
|
((> attempt 5) (error "Failed to start Slynk process."))
|
|
|
|
(t (recurse (1+ attempt))))))
|
|
|
|
(recurse 1))))
|
2023-03-17 13:30:04 +09:00
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
(defun +lisp/reload-project ()
|
2023-12-31 23:44:29 +09:00
|
|
|
"Restart the Sly session and reload a chosen system."
|
2023-03-17 13:30:04 +09:00
|
|
|
(interactive)
|
|
|
|
(sly-restart-inferior-lisp)
|
|
|
|
(cl-labels ((recurse (attempt)
|
|
|
|
(sleep-for 1)
|
|
|
|
(condition-case nil
|
|
|
|
(sly-eval "PONG")
|
|
|
|
(error (if (= 5 attempt)
|
|
|
|
(error "Failed to reload Lisp project in 5 attempts.")
|
|
|
|
(recurse (1+ attempt)))))))
|
|
|
|
(recurse 1)
|
2023-12-31 23:44:29 +09:00
|
|
|
(sly-asdf-load-system)))
|
2023-03-17 13:30:04 +09:00
|
|
|
|
|
|
|
;;;###autoload
|
|
|
|
(defun +lisp/find-file-in-quicklisp ()
|
|
|
|
"Find a file belonging to a library downloaded by Quicklisp."
|
|
|
|
(interactive)
|
|
|
|
(doom-project-find-file "~/.quicklisp/dists/"))
|