From b06a7305c1ffb179f75a66a22e5e34031e0ea861 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 12 May 2021 19:30:24 -0500 Subject: Change common-lisp-ide -> sly Since I just use sly --- init.el | 100 +++++++++++++++------------------------------------------------- 1 file changed, 23 insertions(+), 77 deletions(-) (limited to 'init.el') diff --git a/init.el b/init.el index 9e6f79f..53e7d0e 100644 --- a/init.el +++ b/init.el @@ -641,83 +641,6 @@ (setup (:straight (beginend)) (beginend-global-mode +1)) -(setup common-lisp-ide - (defvar acdw/cl-ide :sly) - (defvar acdw/lisp-bin (or (executable-find "sbcl") - (executable-find "clisp"))) - (:needs acdw/lisp-bin) - (:option inferior-lisp-program acdw/lisp-bin) - - (setup (:straight clhs)) - - (defmacro acdw/cl-define-key (key-string &rest bindings) - "Define KEY-STRING to functions in BINDINGS. -KEY-STRING is passed directly to `kbd'. BINDINGS are a lists of -the form (:IDE MAP FUNC AFTER), where IDE is an IDE (like `slime' or -`sly'), MAP is the mapping in which to bind KEY-STRING, FUNC -is the function to bind KEY-STRING to in that IDE and MAP, and AFTER is the file to `eval-after-load' the `define-key' definition. -`acdw/cl-define-key' only binds the keys that match `acdw/cl-ide' -to save computation time." - (declare (indent 1)) - (let* ((binding (catch :found - (dolist (b bindings) - (when (eq (car b) acdw/cl-ide) - (throw :found b))))) - (binding-map `,(nth 1 binding)) - (binding-func `(function ,(nth 2 binding))) - (binding-after `,(nth 3 binding))) - `(with-eval-after-load ',binding-after - (define-key ,binding-map (kbd ,key-string) ,binding-func)))) - - (dolist (key '("RET" "")) - (acdw/cl-define-key key - (:slime slime-repl-mode-map slime-repl-return-at-end slime) - (:sly sly-mrepl-mode-map sly-mrepl-return-at-end sly-mrepl))) - - (eval-after-load 'sly-mrepl - (function - (lambda nil - (define-key sly-mrepl-mode-map - (kbd "C-c C-c") - (function sly-mrepl-return))))) - - (pcase acdw/cl-ide - (:slime - (setup (:straight slime) - (:also-load slime-autoloads) - - (when-let ((slime-helper (or (expand-file-name-exists-p - "~/quicklisp/slime-helper.el") - (expand-file-name-exists-p - "~/var/quicklisp/slime-helper.el")))) - (load slime-helper)) - - (defun slime-repl-return-at-end () - (interactive) - (if (<= (point-max) (point)) - (slime-repl-return) - (slime-repl-newline-and-indent))) - - (with-eval-after-load 'company - (setup (:straight slime-company) - (:option slime-company-completion 'fuzzy - slime-company-after-completion nil) - (slime-setup '(slime-fancy slime-company)))))) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - (:sly - (setup (:straight sly) - (:option sly-kill-without-query-p t) - - (defun sly-mrepl-return-at-end () - (interactive) - (if (<= (point-max) (point)) - (sly-mrepl-return) - (if (bound-and-true-p paredit-mode) - (paredit-newline) - (electric-newline-and-maybe-indent)))) - - (:also-load sly-autoloads))))) - (setup (:straight (consult :host github :repo "minad/consult")) @@ -1031,6 +954,29 @@ if ripgrep is installed, otherwise `consult-grep'." (require 'acdw-modeline) (simple-modeline-mode +1)) +(setup (:straight sly) + (defvar acdw/lisp-bin (or (executable-find "sbcl") + (executable-find "clisp"))) + (:needs acdw/lisp-bin) + (:option inferior-lisp-program acdw/lisp-bin + sly-kill-without-query-p t) + + (:also-load sly-autoloads) + (setup (:straight clhs)) + + (:with-feature sly-mrepl + (dolist (key '("RET" "")) + (:bind key sly-mrepl-return-at-end)) + (:bind "C-c C-c" sly-mrepl-return)) + + (defun sly-mrepl-return-at-end () + (interactive) + (if (<= (point-max) (point)) + (sly-mrepl-return) + (if (bound-and-true-p paredit-mode) + (paredit-newline) + (electric-newline-and-maybe-indent))))) + (setup (:straight undo-fu) (:global "C-/" undo-fu-only-undo "C-?" undo-fu-only-redo)) -- cgit 1.4.1-21-gabe81