use-package slime

(untested)
This commit is contained in:
larstvei 2023-06-13 02:36:18 +02:00
parent 750e0dc93a
commit 22ad834c41

View File

@ -207,8 +207,7 @@
(let* ((package--builtins nil) (let* ((package--builtins nil)
(packages (packages
'(slime ; Superior Lisp Interaction Mode for Emacs '(try ; Try out Emacs packages
try ; Try out Emacs packages
vterm ; A terminal via libvterm vterm ; A terminal via libvterm
which-key ; Display available keybindings in popup which-key ; Display available keybindings in popup
z3-mode))) ; z3/SMTLIBv2 interactive development z3-mode))) ; z3/SMTLIBv2 interactive development
@ -1472,40 +1471,35 @@
*** Common lisp *** Common lisp
#+begin_quote
Note that I haven't used Common Lisp for a very long time, and this setup
might be broken. I keep it around for reference.
#+end_quote
I use [[http://www.common-lisp.net/project/slime/][Slime]] along with =lisp-mode= to edit Common Lisp code. Slime provides I use [[http://www.common-lisp.net/project/slime/][Slime]] along with =lisp-mode= to edit Common Lisp code. Slime provides
code evaluation and other great features, a must have for a Common Lisp code evaluation and other great features, a must have for a Common Lisp
developer. [[http://www.quicklisp.org/beta/][Quicklisp]] is a library manager for Common Lisp, and you can developer. You can install the Common Lisp slime counterpart using
install Slime following the instructions from the site along with this [[http://www.quicklisp.org/beta/][Quicklisp]], creating a helper that can be loaded.
snippet.
We can specify what Common Lisp program Slime should use (I use SBCL). More
sensible =loop= indentation is borrowed from [[https://github.com/simenheg][simenheg]].
#+begin_src emacs-lisp #+begin_src emacs-lisp
(defun activate-slime-helper () ;; Superior Lisp Interaction Mode for Emacs
(use-package slime
:defer t
:bind (:map slime-repl-mode-map ("C-l" . slime-repl-clear-buffer))
:hook (common-lisp-mode . activate-slime-helper)
:config
(when (file-exists-p "~/.quicklisp/slime-helper.el") (when (file-exists-p "~/.quicklisp/slime-helper.el")
(load (expand-file-name "~/.quicklisp/slime-helper.el")) (load (expand-file-name "~/.quicklisp/slime-helper.el")))
(define-key slime-repl-mode-map (kbd "C-l")
'slime-repl-clear-buffer))
(remove-hook 'common-lisp-mode-hook #'activate-slime-helper))
(add-hook 'common-lisp-mode-hook #'activate-slime-helper)
#+end_src
We can specify what Common Lisp program Slime should use (I use SBCL).
#+begin_src emacs-lisp
(setq inferior-lisp-program "sbcl") (setq inferior-lisp-program "sbcl")
#+end_src
More sensible =loop= indentation, borrowed from [[https://github.com/simenheg][simenheg]].
#+begin_src emacs-lisp
(setq lisp-loop-forms-indentation 6 (setq lisp-loop-forms-indentation 6
lisp-simple-loop-indentation 2 lisp-simple-loop-indentation 2
lisp-loop-keyword-indentation 6) lisp-loop-keyword-indentation 6))
#+end_src #+end_src