From 04d4e34a7f2b9ade8133d960ca9603313acc3708 Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Mon, 30 Nov 2020 09:46:51 +0100 Subject: [PATCH] Move Lispy patch to separate file. --- .emacs.d/lisp/init-lispy.el | 41 +----------------------------------- .emacs.d/lisp/patch-lispy.el | 11 ++++++++++ 2 files changed, 12 insertions(+), 40 deletions(-) create mode 100644 .emacs.d/lisp/patch-lispy.el diff --git a/.emacs.d/lisp/init-lispy.el b/.emacs.d/lisp/init-lispy.el index 709fddfa..f4612e76 100644 --- a/.emacs.d/lisp/init-lispy.el +++ b/.emacs.d/lisp/init-lispy.el @@ -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) diff --git a/.emacs.d/lisp/patch-lispy.el b/.emacs.d/lisp/patch-lispy.el new file mode 100644 index 00000000..3df2ed61 --- /dev/null +++ b/.emacs.d/lisp/patch-lispy.el @@ -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)