Move Lispy patch to separate file.

master
Pierre Neidhardt 2020-11-30 09:46:51 +01:00
parent 89e1a8d416
commit 04d4e34a7f
2 changed files with 12 additions and 40 deletions

View File

@ -85,46 +85,7 @@ replace the expression with its result."
(add-hook 'lispy-mode-hook 'lispyville-mode))
(lispyville-mode)))
;; REVIEW: Remove once merged upstream:
;; https://github.com/abo-abo/lispy/issues/549
(with-eval-after-load 'lispy
(setq lispy-eval-alist
`((,lispy-elisp-modes lispy lispy--eval-elisp)
((,@lispy-clojure-modes nrepl-repl-mode cider-clojure-interaction-mode)
le-clojure lispy-eval-clojure)
(python-mode
le-python lispy--eval-python lispy-eval-python-str lispy-eval-python-bnd)
(julia-mode
le-julia lispy-eval-julia lispy-eval-julia-str)
(racket-mode
le-racket lispy-eval-racket)
(scheme-mode
le-scheme lispy--eval-scheme)
(lisp-mode
le-lisp lispy--eval-lisp)
(slime-repl-mode
le-lisp lispy--eval-lisp)
(slime-mrepl-mode
le-lisp lispy--eval-lisp)
(sly-mrepl-mode
le-lisp lispy--eval-lisp)
(hy-mode
le-hy lispy--eval-hy)))
;; REVIEW: Remove this workaround when upstream has fixed
;; https://github.com/abo-abo/lispy/issues/550.
(setq lispy-parens-preceding-syntax-alist
'((lisp-mode . ("[#`',.@]+" "#[0-9]*" "#[.,Ss+-]" "#[0-9]+[=Aa]"))
;; NEW:
(sly-mrepl-mode . ("[[:space:]]" "[#`',.@]+" "#[0-9]*" "#[.,Ss+-]" "#[0-9]+[=Aa]"))
(emacs-lisp-mode . ("[#`',@]+" "#s" "#[0-9]+="))
(clojure-mode . ("[`'~@]+" "#" "#\\?@?"))
(clojurescript-mode . ("[`'~@]+" "#" "#\\?@?"))
(clojurec-mode . ("[`'~@]+" "#" "#\\?@?"))
(cider-repl-mode . ("[`'~@]+" "#" "#\\?@?"))
(cider-clojure-interaction-mode . ("[`'~@]+" "#" "#\\?@?"))
(janet-mode . ("[@;]"))
(scheme-mode . ("[#`',@]+" "#hash"))
(t . ("[`',@]+")))))
(require 'patch-lispy nil :noerror))
(provide 'init-lispy)

View File

@ -0,0 +1,11 @@
;; REVIEW: Remove once merged upstream:
;; https://github.com/abo-abo/lispy/issues/549
(dolist (mode '(slime-repl-mode slime-mrepl-mode sly-mrepl-mode))
(push `(,mode le-lisp lispy--eval-lisp) lispy-eval-alist))
;; REVIEW: Remove this workaround when upstream has fixed
;; https://github.com/abo-abo/lispy/issues/550.
(push '(sly-mrepl-mode . ("[[:space:]]" "[#`',.@]+" "#[0-9]*" "#[.,Ss+-]" "#[0-9]+[=Aa]"))
lispy-parens-preceding-syntax-alist)
(provide 'patch-lispy)