Apply smartparens lisp rules to sly-mrepl-mode

This commit is contained in:
Henrik Lissner 2020-03-06 15:24:22 -05:00
parent c40588a892
commit 69f14bc3da
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
3 changed files with 5 additions and 6 deletions

View file

@ -423,9 +423,10 @@ files, so we replace calls to `pp' with the much faster `prin1'."
:after-call doom-switch-buffer-hook after-find-file
:commands sp-pair sp-local-pair sp-with-modes sp-point-in-comment sp-point-in-string
:config
;; smartparens recognizes `slime-mrepl-mode', but not `sly-mrepl-mode', so...
(add-to-list 'sp-lisp-modes 'sly-mrepl-mode)
;; Load default smartparens rules for various languages
(require 'smartparens-config)
;; Overlays are too distracting and not terribly helpful. show-parens does
;; this for us already (and is faster), so...
(setq sp-highlight-pair-overlay nil

View file

@ -98,7 +98,9 @@
:unless '(sp-point-before-word-p sp-point-before-same-p)))
;; In lisps ( should open a new form if before another parenthesis
(sp-local-pair sp-lisp-modes "(" ")" :unless '(:rem sp-point-before-same-p))
(sp-with-modes sp-lisp-modes
(sp-local-pair "`" "`" :actions nil)
(sp-local-pair "(" ")" :unless '(:rem sp-point-before-same-p)))
;; Major-mode specific fixes
(sp-local-pair '(ruby-mode enh-ruby-mode) "{" "}"

View file

@ -47,10 +47,6 @@
;; buffers are meant to be displayed with sufficient vertical space.
("^\\*sly-\\(?:db\\|inspector\\)" :ignore t)))
(sp-with-modes '(sly-mrepl-mode)
(sp-local-pair "'" "'" :actions nil)
(sp-local-pair "`" "`" :actions nil))
(defun +common-lisp--cleanup-sly-maybe-h ()
"Kill processes and leftover buffers when killing the last sly buffer."
(unless (cl-loop for buf in (delq (current-buffer) (buffer-list))