Experiment with slime' instead of sly'

This commit is contained in:
Gerard Vermeulen 2023-03-22 17:55:26 +01:00
parent 934ce0e0cb
commit ac73e4a2b7

View File

@ -2101,8 +2101,11 @@ list detailing and motivating each listing:
"\\end{document}\n")))
(with-eval-after-load 'ob-lisp
(with-eval-after-load 'sly
(setopt org-babel-lisp-eval-fn #'sly-eval)))
(with-eval-after-load 'slime
(setopt org-babel-lisp-eval-fn #'slime-eval))
;; (with-eval-after-load 'sly
;; (setopt org-babel-lisp-eval-fn #'sly-eval))
)
(with-eval-after-load 'emacs
(defun set-org-babel-language-activity (lang active)
@ -4090,10 +4093,41 @@ Finally, listing [[lst:configure-sly]] uses a technique to [[info:sly#Loading Sl
by means of a custom core file in src_emacs-lisp{no-littering-var-directory}.
Listing [[lst:sbcl-core-for-sly]] tangles to a script to dump such a [[http://www.sbcl.org/][SBCL]] core.
#+caption[Configure =slime=]:
#+caption: Configure =slime=.
#+name: lst:configure-slime
#+begin_src emacs-lisp -n :results silent
(when (ensure-package-installation 'slime)
(with-eval-after-load 'slime
(setq slime-default-lisp 'sbcl
slime-lisp-implementations
`((sbcl (,(executable-find "sbcl")
"--core"
,(no-littering-expand-var-file-name "sbcl.core-for-sly")))))
;; (add-hook 'slime-mode-hook
;; (defun on-slime-mode-hook ()
;; (unless (slime-connected-p)
;; (save-excursion (slime)))))
(cond
((eq system-type 'darwin)
(setq common-lisp-hyperspec-root
"file:///usr/local/share/doc/hyperspec/HyperSpec/")
(setq common-lisp-hyperspec-symbol-table
(concat common-lisp-hyperspec-root "Data/Map_Sym.txt")))
((eq system-type 'gnu/linux)
(setq common-lisp-hyperspec-root
"file:///usr/share/doc/hyperspec-7.0/HyperSpec/"))
(t (message "Default Common Lisp HyperSpec access")))
(keymap-set slime-prefix-map "M-h" #'slime-documentation-lookup)))
#+end_src
#+caption[Configure =sly=]:
#+caption: Configure =sly=.
#+name: lst:configure-sly
#+begin_src emacs-lisp -n :results silent
#+begin_src emacs-lisp -n :results silent :tangle no
(when (ensure-package-installation 'sly 'sly-named-readtables)
(with-eval-after-load 'sly
;; Set `sly-default-lisp' instead of `inferior-lisp-program',
@ -4170,13 +4204,19 @@ EOF
"The face used to highlight standard Common Lisp value symbols.")
#+end_src
#+caption[Setup =SLY= and =Common Lisp= to find standard symbol names]:
#+caption: Setup =SLY= and =Common Lisp= to find standard symbol names.
#+name: lst:sly-cl-standard-symbol-names
#+caption[Setup =SLY= printing]:
#+caption: Setup =SLY= printing.
#+name: lst:setup-sly-printing
#+begin_src lisp -n :eval never-export :results silent :tangle no
;; Works in case of sly, but fails in case of slime.
(rplacd (assoc 'slynk:*string-elision-length* slynk:*slynk-pprint-bindings*)
(ash 1 14))
#+end_src
#+caption[Define a =Common Lisp= function to find standard symbol names]:
#+caption: Define a =Common Lisp= function to find standard symbol names.
#+name: lst:standard-symbol-names
#+begin_src lisp :eval never-export :results silent :tangle no
(defun standard-symbol-names (predicate)
(let ((symbols nil))
(do-external-symbols (symbol :common-lisp)
@ -4510,6 +4550,7 @@ git clone git@github.com:ageldama/cl-state-machine.git
;; https://www.crategus.com/books/cl-gtk/gtk-tutorial.html
(ql:register-local-projects)
(ql:quickload "cs325")
(ql:quickload "meta")
(ql:quickload "named-readtables")
(ql:quickload "nodgui") ;; requires https://www.tcl.tk/software/tklib/
(ql:quickload "rutils")