diff --git a/oni-elisp/oni-elisp.el b/oni-elisp/oni-elisp.el index 80834f3..30475ef 100644 --- a/oni-elisp/oni-elisp.el +++ b/oni-elisp/oni-elisp.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemse ;; Keywords: local -;; Version: 2023.0314.001059 +;; Version: 2023.0411.133217 ;; Package-Requires: (oni-company oni-flycheck oni-paredit oni-yasnippet oni-hydra rainbow-delimiters nameless erefactor flycheck-relint handle elisp-format) ;; This program is free software; you can redistribute it and/or modify @@ -84,6 +84,16 @@ (:eval (buffer-name ielm-working-buffer)) mode-line-end-spaces))) +(defun oni-elisp-ielm-remove-paredit-newline-keys () + "Disable ‘C-j’ and ‘RET’ keybindings from ‘paredit-mode’." + (let ((oldmap (map-elt minor-mode-map-alist 'paredit-mode)) + (newmap (make-sparse-keymap))) + (set-keymap-parent newmap oldmap) + (define-key newmap (kbd "RET") nil) + (define-key newmap (kbd "C-j") nil) + (make-local-variable 'minor-mode-overriding-map-alist) + (push `(paredit-mode . ,newmap) minor-mode-overriding-map-alist))) + (defhydra oni-elisp-hydra (:color teal :hint nil) " ^Eval^ @@ -102,6 +112,7 @@ _eb_: Buffer (add-hook 'emacs-lisp-mode-hook 'paredit-mode) (add-hook 'emacs-lisp-mode-hook 'rainbow-delimiters-mode) +(add-hook 'ielm-mode-hook #'oni-elisp-ielm-remove-paredit-newline-keys) (add-hook 'ielm-mode-hook #'oni-elisp-setup-ielm-mode-line) (add-hook 'ielm-mode-hook 'company-mode) (add-hook 'ielm-mode-hook 'paredit-mode)