summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2021-04-10 14:29:05 -0500
committerCase Duckworth2021-04-10 14:29:05 -0500
commit9a0dbf505c044f427eb629ef7f324e165dbcc1aa (patch)
tree28c41bd8b166a2e768e921a9e9dc9408c12c2cc7
parentFix some comments for `outline-mode' (diff)
downloademacs-9a0dbf505c044f427eb629ef7f324e165dbcc1aa.tar.gz
emacs-9a0dbf505c044f427eb629ef7f324e165dbcc1aa.zip
Fix paredit-mode bindings in SLIME's REPL
I could (a) put these in a different place (in the `setup slime' form, for
example), or (b) streamlined funcitons or ... something, but I did it this way
and it works fine so that's that.  Oh, I also wrote a longish docstring.
-rw-r--r--init.el25
1 files changed, 19 insertions, 6 deletions
diff --git a/init.el b/init.el index 1876aa6..4824b75 100644 --- a/init.el +++ b/init.el
@@ -719,12 +719,25 @@ if ripgrep is installed, otherwise `consult-grep'."
719 ielm-mode 719 ielm-mode
720 lisp-mode 720 lisp-mode
721 lisp-interaction-mode 721 lisp-interaction-mode
722 scheme-mode) 722 scheme-mode
723 723 slime-repl-mode)
724 (defun disable-electric-pair-local-mode () 724
725 (electric-pair-local-mode -1)) 725 (defun paredit-disable-electric-pair-local-mode ()
726 726 "Disable `electric-pair-local-mode' when `paredit-mode' is enabled."
727 (:hook disable-electric-pair-local-mode) 727 (electric-indent-local-mode (if paredit-mode -1 +1)))
728
729 (defun paredit-properly-bind-backspace ()
730 "Properly bind DEL and C-d in `paredit-mode'.
731
732`paredit-mode''s DEL binding is shadowed by that for
733`lisp-mode-shared-map', so in this hook I remove the binding I
734don't want."
735 (define-key lisp-mode-shared-map (kbd "DEL") nil)
736 (define-key paredit-mode-map (kbd "DEL") #'paredit-backward-delete)
737 (define-key paredit-mode-map (kbd "C-d") #'paredit-forward-delete))
738
739 (:hook paredit-disable-electric-pair-local-mode
740 paredit-properly-bind-backspace)
728 741
729 (require 'eldoc) 742 (require 'eldoc)
730 (eldoc-add-command 'paredit-backward-delete 'paredit-close-round)) 743 (eldoc-add-command 'paredit-backward-delete 'paredit-close-round))