diff --git a/.emacs.d/lisp/init-sly.el b/.emacs.d/lisp/init-sly.el index 1f6ea105..c34aa840 100644 --- a/.emacs.d/lisp/init-sly.el +++ b/.emacs.d/lisp/init-sly.el @@ -12,6 +12,23 @@ "USER") preserve-vars)))) +(defun ambrevar/delete-lisp-image-dump () + "Delete SLY current connection image dump. +This dump is expected to be generated by `lisp-repl-core-dumper'." + (interactive) + (let* ((pid (process-id (sly-inferior-process (sly-current-connection)))) + (args (alist-get 'args (process-attributes pid))) + (command (car (split-string (alist-get 'args (process-attributes pid)))))) + (if (and (string= "image" + (file-name-extension command)) + (string= (file-name-directory command) + (expand-file-name "~/.cache/lisp-repl-core-directory/"))) + (when (yes-or-no-p (format "Delete %s?" command)) + (let ((delete-by-moving-to-trash nil)) + (delete-file command) + (message "%S deleted." command))) + (message "%S is not a Lisp image dump." command)))) + (defun ambrevar/sbcl-for-nyxt (&optional refresh) ;; TODO: Run it in a container? "Fast, pure Guix environment for Nyxt development. If REFRESH is non-nil, rebuild the environment."