Open
Conversation
Like clojure-mode, edn-mode needs to coax paredit to auto-pair curly braces.
bbatsov
reviewed
Mar 17, 2026
Member
bbatsov
left a comment
There was a problem hiding this comment.
Thanks for the PR! The problem diagnosis is correct — edn-mode-map has prog-mode-map as parent, not clojure-mode-map, so the paredit {/} bindings from clojure-paredit-setup don't reach EDN buffers.
However, I think we can fix this without duplicating the setup function. The root cause is that clojure-paredit-setup defaults to clojure-mode-map when no keymap is passed. If we change it to default to (current-local-map) instead, the existing paredit-mode-hook (which edn-mode already inherits from clojure-mode) will just work for all derived modes automatically.
Something like:
(let ((keymap (or keymap (current-local-map))))That single-line change should fix EDN mode (and any future derived modes) without needing edn-paredit-setup at all.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Like clojure-mode, edn-mode needs to coax paredit to auto-pair curly braces.
I've replicated the minimum set of features from the existing
clojure-paredit-setuptoedn-paredit-setupto allow auto-pair functionality for curly braces ({)I tried to a test to confirm the behavior, but my emacs/buttercup testing skills aren't currently up to the task. Here's what I (naïvely) tried (added to edn-mode-indentation-test.el for experimentation).
Before submitting a PR mark the checkboxes for the items you've done (if you
think a checkbox does not apply, then leave it unchecked):
M-x checkdocand fixed any warnings in the code you've written.Thanks!