Skip to content

Instantly share code, notes, and snippets.

@jackrusher
Created April 16, 2020 13:26
Show Gist options
  • Save jackrusher/e628abb653429c22bc6330752b3e49a5 to your computer and use it in GitHub Desktop.
Save jackrusher/e628abb653429c22bc6330752b3e49a5 to your computer and use it in GitHub Desktop.
Convert the current region in emacs from JSON to EDN using Bork's Jet.
;; Uses https://github.com/borkdude/jet
;; On OSX, install jet with:
;; brew install borkdude/brew/jet
;; I invoke this with M-x, you might want to bind it to a key
(defun json->edn ()
(interactive)
(shell-command-on-region (region-beginning)
(region-end)
"jet --pretty --keywordize keyword --from json --to edn"
(current-buffer)
t))
@jimmy-alvarez
Copy link

How can I install this function in my emacs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment