From b45cc335db7a5d37fcc7084937696a8854afbbe8 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 12 Oct 2019 00:41:46 -0400 Subject: [PATCH] lang/common-lisp: offload to evil-collection-sly --- modules/editor/evil/+everywhere.el | 1 + .../lang/common-lisp/autoload/common-lisp.el | 10 -- modules/lang/common-lisp/config.el | 109 +----------------- 3 files changed, 2 insertions(+), 118 deletions(-) diff --git a/modules/editor/evil/+everywhere.el b/modules/editor/evil/+everywhere.el index 6a05adacf..fddfa9fb3 100644 --- a/modules/editor/evil/+everywhere.el +++ b/modules/editor/evil/+everywhere.el @@ -166,6 +166,7 @@ variable for an explanation of the defaults (in comments). See rtags simple slime + sly (term term ansi-term multi-term) tetris tide diff --git a/modules/lang/common-lisp/autoload/common-lisp.el b/modules/lang/common-lisp/autoload/common-lisp.el index 641a646c6..337809d96 100644 --- a/modules/lang/common-lisp/autoload/common-lisp.el +++ b/modules/lang/common-lisp/autoload/common-lisp.el @@ -3,13 +3,3 @@ ;; HACK Fix #1772: void-variable sly-contribs errors due to sly packages (like ;; `sly-macrostep') trying to add to `sly-contribs' before it is defined. ;;;###autoload (defvar sly-contribs '(sly-fancy)) - -;;;###autoload -(defun +common-lisp--sly-last-sexp-a (command &rest args) - "In normal-state or motion-state, last sexp ends at point." - (if (and (not evil-move-beyond-eol) - (or (evil-normal-state-p) (evil-motion-state-p))) - (save-excursion - (unless (or (eobp) (eolp)) (forward-char)) - (apply command args)) - (apply command args))) diff --git a/modules/lang/common-lisp/config.el b/modules/lang/common-lisp/config.el index 7c8e79222..bfed909f7 100644 --- a/modules/lang/common-lisp/config.el +++ b/modules/lang/common-lisp/config.el @@ -126,114 +126,7 @@ :desc "Untrace all" "u" #'sly-untrace-all)) (when (featurep! :editor evil +everywhere) - (add-hook 'sly-mode-hook #'evil-normalize-keymaps) - (add-hook 'sly-popup-buffer-mode-hook #'evil-normalize-keymaps) - - (unless evil-move-beyond-eol - (dolist (fn '(sly-eval-last-expression - sly-pprint-eval-last-expression - sly-eval-print-last-expression - sly-eval-last-expression-in-repl)) - (advice-add fn :around #'+common-lisp--sly-last-sexp-a))) - (set-evil-initial-state! - '(sly-db-mode - sly-inspector-mode - sly-popup-buffer-mode - sly-xref-mode) - 'normal) - - (evil-define-key 'insert sly-mrepl-mode-map - [S-return] #'newline-and-indent - [backspace] #'sp-backward-delete-char - [up] (λ! () (evil-goto-line) (comint-previous-input 1)) - [down] (λ! () (evil-goto-line) (comint-next-input 1))) - (evil-define-key 'normal sly-parent-map - (kbd "C-t") #'sly-pop-find-definition-stack) - (evil-define-key 'normal sly-popup-buffer-mode-map - (kbd "C-t") 'sly-pop-find-definition-stack - "q" 'quit-window) - (evil-define-key 'normal sly-db-mode-map - [follow-link] 'mouse-face - [mouse-2] 'sly-db-default-action/mouse - [remap quit-window] 'sly-db-quit - (kbd "C-i") 'sly-db-cycle - (kbd "C-j") 'sly-db-down - (kbd "C-k") 'sly-db-up - (kbd "C-m") 'sly-db-default-action - (kbd "C-S-j") 'sly-db-details-down - (kbd "C-S-k") 'sly-db-details-up - "]" 'sly-db-details-down - "[" 'sly-db-details-up - "0" 'sly-db-invoke-restart-0 - "1" 'sly-db-invoke-restart-1 - "2" 'sly-db-invoke-restart-2 - "3" 'sly-db-invoke-restart-3 - "4" 'sly-db-invoke-restart-4 - "5" 'sly-db-invoke-restart-5 - "6" 'sly-db-invoke-restart-6 - "7" 'sly-db-invoke-restart-7 - "8" 'sly-db-invoke-restart-8 - "9" 'sly-db-invoke-restart-9 - "a" 'sly-db-abort - "A" 'sly-db-break-with-system-debugger - "b" 'sly-db-break-on-return - "B" 'sly-db-break-with-default-debugger - "c" 'sly-db-continue - "C" 'sly-db-inspect-condition - "d" 'sly-db-pprint-eval-in-frame - "D" 'sly-db-disassemble - "e" 'sly-db-eval-in-frame - "g:" 'sly-interactive-eval - "g?" 'describe-mode - "gg" 'sly-db-beginning-of-backtrace - "gj" 'sly-db-down - "gk" 'sly-db-up - "gr" 'sly-db-restart-frame - "G" 'sly-db-end-of-backtrace - "i" 'sly-db-inspect-in-frame - "I" 'sly-db-invoke-restart-by-name - "n" 'sly-db-next - "o" 'sly-db-out - "P" 'sly-db-print-condition - "q" 'sly-db-quit - "R" 'sly-db-return-from-frame - "s" 'sly-db-step - "S" 'sly-db-show-frame-source - "t" 'sly-db-toggle-details) - (evil-define-key 'normal sly-inspector-mode-map - [backtab] 'backward-button - [return] 'push-button - [(shift tab)] 'backward-button - (kbd "") 'sly-mrepl-copy-part-to-repl - (kbd "C-i") 'next-button - (kbd "C-m") 'push-button - "e" 'sly-inspector-eval - "gb" 'sly-inspector-pop - "gj" 'sly-inspector-next - "gr" 'sly-inspector-reinspect - "gR" 'sly-inspector-fetch-all - "gv" 'sly-inspector-toggle-verbose - "h" 'sly-inspector-history - "k" 'backward-button - "K" 'sly-inspector-describe-inspectee - "p" 'sly-button-pretty-print - "q" 'sly-inspector-quit) - (evil-define-key 'normal sly-mode-map - (kbd "C-t") 'sly-pop-find-definition-stack) - (evil-define-key 'normal sly-xref-mode-map - [return] 'sly-goto-xref - (kbd "S-") 'sly-show-xref - (kbd "C-j") 'sly-xref-next-line - (kbd "C-k") 'sly-xref-prev-line - "]" 'sly-xref-next-line - "[" 'sly-xref-prev-line - "gj" 'sly-xref-next-line - "gk" 'sly-xref-prev-line - "go" 'sly-show-xref - "gr" 'sly-recompile-xref - "gR" 'sly-recompile-all-xrefs - "q" 'quit-window - "r" 'sly-xref-retract))) + (add-hook 'sly-mode-hook #'evil-normalize-keymaps))) (use-package! sly-repl-ansi-color