summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2021-05-13 18:00:48 -0500
committerCase Duckworth2021-05-13 18:00:48 -0500
commit53decaf0358e7ca4a6bf88827dc74981f3ba7efb (patch)
tree9c7622ac7842d96b6dce6f71920a1c16f7a46f0e
parentAdd `acdw-org/word-count' (diff)
parentMerge branch 'main' of https://tildegit.org/acdw/emacs (diff)
downloademacs-53decaf0358e7ca4a6bf88827dc74981f3ba7efb.tar.gz
emacs-53decaf0358e7ca4a6bf88827dc74981f3ba7efb.zip
Merge branch 'main' of https://tildegit.org/acdw/emacs
-rw-r--r--init.el100
1 files changed, 23 insertions, 77 deletions
diff --git a/init.el b/init.el index bc61a28..06caede 100644 --- a/init.el +++ b/init.el
@@ -676,83 +676,6 @@
676(setup (:straight (beginend)) 676(setup (:straight (beginend))
677 (beginend-global-mode +1)) 677 (beginend-global-mode +1))
678 678
679(setup common-lisp-ide
680 (defvar acdw/cl-ide :sly)
681 (defvar acdw/lisp-bin (or (executable-find "sbcl")
682 (executable-find "clisp")))
683 (:needs acdw/lisp-bin)
684 (:option inferior-lisp-program acdw/lisp-bin)
685
686 (setup (:straight clhs))
687
688 (defmacro acdw/cl-define-key (key-string &rest bindings)
689 "Define KEY-STRING to functions in BINDINGS.
690KEY-STRING is passed directly to `kbd'. BINDINGS are a lists of
691the form (:IDE MAP FUNC AFTER), where IDE is an IDE (like `slime' or
692`sly'), MAP is the mapping in which to bind KEY-STRING, FUNC
693is 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.
694`acdw/cl-define-key' only binds the keys that match `acdw/cl-ide'
695to save computation time."
696 (declare (indent 1))
697 (let* ((binding (catch :found
698 (dolist (b bindings)
699 (when (eq (car b) acdw/cl-ide)
700 (throw :found b)))))
701 (binding-map `,(nth 1 binding))
702 (binding-func `(function ,(nth 2 binding)))
703 (binding-after `,(nth 3 binding)))
704 `(with-eval-after-load ',binding-after
705 (define-key ,binding-map (kbd ,key-string) ,binding-func))))
706
707 (dolist (key '("RET" "<return>"))
708 (acdw/cl-define-key key
709 (:slime slime-repl-mode-map slime-repl-return-at-end slime)
710 (:sly sly-mrepl-mode-map sly-mrepl-return-at-end sly-mrepl)))
711
712 (eval-after-load 'sly-mrepl
713 (function
714 (lambda nil
715 (define-key sly-mrepl-mode-map
716 (kbd "C-c C-c")
717 (function sly-mrepl-return)))))
718
719 (pcase acdw/cl-ide
720 (:slime
721 (setup (:straight slime)
722 (:also-load slime-autoloads)
723
724 (when-let ((slime-helper (or (expand-file-name-exists-p
725 "~/quicklisp/slime-helper.el")
726 (expand-file-name-exists-p
727 "~/var/quicklisp/slime-helper.el"))))
728 (load slime-helper))
729
730 (defun slime-repl-return-at-end ()
731 (interactive)
732 (if (<= (point-max) (point))
733 (slime-repl-return)
734 (slime-repl-newline-and-indent)))
735
736 (with-eval-after-load 'company
737 (setup (:straight slime-company)
738 (:option slime-company-completion 'fuzzy
739 slime-company-after-completion nil)
740 (slime-setup '(slime-fancy slime-company))))))
741 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
742 (:sly
743 (setup (:straight sly)
744 (:option sly-kill-without-query-p t)
745
746 (defun sly-mrepl-return-at-end ()
747 (interactive)
748 (if (<= (point-max) (point))
749 (sly-mrepl-return)
750 (if (bound-and-true-p paredit-mode)
751 (paredit-newline)
752 (electric-newline-and-maybe-indent))))
753
754 (:also-load sly-autoloads)))))
755
756(setup (:straight (consult 679(setup (:straight (consult
757 :host github 680 :host github
758 :repo "minad/consult")) 681 :repo "minad/consult"))
@@ -1066,6 +989,29 @@ if ripgrep is installed, otherwise `consult-grep'."
1066 (require 'acdw-modeline) 989 (require 'acdw-modeline)
1067 (simple-modeline-mode +1)) 990 (simple-modeline-mode +1))
1068 991
992(setup (:straight sly)
993 (defvar acdw/lisp-bin (or (executable-find "sbcl")
994 (executable-find "clisp")))
995 (:needs acdw/lisp-bin)
996 (:option inferior-lisp-program acdw/lisp-bin
997 sly-kill-without-query-p t)
998
999 (:also-load sly-autoloads)
1000 (setup (:straight clhs))
1001
1002 (:with-feature sly-mrepl
1003 (dolist (key '("RET" "<return>"))
1004 (:bind key sly-mrepl-return-at-end))
1005 (:bind "C-c C-c" sly-mrepl-return))
1006
1007 (defun sly-mrepl-return-at-end ()
1008 (interactive)
1009 (if (<= (point-max) (point))
1010 (sly-mrepl-return)
1011 (if (bound-and-true-p paredit-mode)
1012 (paredit-newline)
1013 (electric-newline-and-maybe-indent)))))
1014
1069(setup (:straight undo-fu) 1015(setup (:straight undo-fu)
1070 (:global "C-/" undo-fu-only-undo 1016 (:global "C-/" undo-fu-only-undo
1071 "C-?" undo-fu-only-redo)) 1017 "C-?" undo-fu-only-redo))