emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/racket-mode 2305948874: Prevent newer paredit from stealin


From: ELPA Syncer
Subject: [nongnu] elpa/racket-mode 2305948874: Prevent newer paredit from stealing C-m and C-j; fixes #647
Date: Wed, 30 Nov 2022 13:59:33 -0500 (EST)

branch: elpa/racket-mode
commit 23059488748101dcfddec723da216826d62df075
Author: Greg Hendershott <git@greghendershott.com>
Commit: Greg Hendershott <git@greghendershott.com>

    Prevent newer paredit from stealing C-m and C-j; fixes #647
    
    AFAICT minor-mode-overriding-map-alist is the correct thing to use
    for this situation.
---
 racket-repl.el | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/racket-repl.el b/racket-repl.el
index f1dc8ef4ad..9d260870f2 100644
--- a/racket-repl.el
+++ b/racket-repl.el
@@ -1294,7 +1294,15 @@ identifier bindings and modules from the REPL's 
namespace.
   (add-hook 'kill-emacs-hook #'racket--repl-save-all-histories nil t)
   (add-hook 'xref-backend-functions #'racket-repl-xref-backend-function nil t)
   (add-to-list 'semantic-symref-filepattern-alist
-               '(racket-repl-mode "*.rkt" "*.rktd" "*.rktl")))
+               '(racket-repl-mode "*.rkt" "*.rktd" "*.rktl"))
+  ;; Handle recent versions of paredit that bind C-m and C-j; #647.
+  (when (boundp 'paredit-mode-map)
+    (let ((m (make-sparse-keymap)))
+      (set-keymap-parent m paredit-mode-map)
+      (dolist (k '("C-m" "C-j"))
+        (define-key m (kbd k) (lookup-key racket-repl-mode-map (kbd k))))
+      (push (cons 'paredit-mode m)
+            minor-mode-overriding-map-alist))))
 
 (defun racket--repl-save-all-histories ()
   "Call comint-write-input-ring for all `racket-repl-mode' buffers.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]