Back to sly

This commit is contained in:
2024-07-15 02:11:26 -07:00
parent 729629fd8b
commit ef97ad7fa9
3 changed files with 30 additions and 378 deletions

41
init.el
View File

@ -901,20 +901,37 @@ COMMAND and COMINT are like `compile'."
;; yuck (config language for eww)
(use-package yuck-mode)
;; slime
(use-package slime
:defer nil
;; sly
(use-package sly
:hook (lisp-mode . my/-lisp-mode-autoconnect-sly)
:bind (:map sly-mode-map
("C-c e" . my/sly-show-notes-at-point))
:autoload sly-connected-p
:init
(setq inferior-lisp-program "sbcl")
(defun my/-lisp-mode-autoconnect-sly ()
(unless (sly-connected-p)
(sly)))
(defun my/sly-notes-at-point (pos &optional buffer)
"Returns the sly notes at POS in BUFFER.
If BUFFER is nil, the current buffer is used."
(with-current-buffer (or buffer (current-buffer))
(cl-loop for overlay in (overlays-at pos)
for note = (overlay-get overlay 'sly-note)
when note
collect note)))
(defun my/sly-show-notes-at-point ()
"Show all sly notes at point in a floating window."
(interactive)
(my/floating-tooltip " *sly-note-posframe*"
(with-output-to-string
(dolist (note (my/sly-notes-at-point (point)))
(when-let (msg (plist-get note :message))
(princ "·")
(princ msg)
(terpri))))))
(setq inferior-lisp-program "/usr/bin/sbcl")
:config
(slime-setup '(slime-fancy-inspector inferior-slime slime-references
slime-xref-browser slime-mdot-fu slime-sprof slime-fancy)))
(use-package slime-capf
:ensure nil
:after slime
:config
(advice-add 'slime--completion-at-point :override
'slime-capf-complete-at-point))
(sly-symbol-completion-mode -1))
;; pdf-tools
(use-package pdf-tools