From 289babe14bacfda0a936cea711df9a86a7560ecc Mon Sep 17 00:00:00 2001 From: Andreas Gerler Date: Fri, 26 Feb 2016 14:06:38 +0100 Subject: [PATCH] adding beautify-json --- bba.org | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bba.org b/bba.org index 744e5f53..989fb692 100644 --- a/bba.org +++ b/bba.org @@ -2307,6 +2307,18 @@ we use that as default: (global-set-key (kbd "C-M-r") 'isearch-backward) #+END_SRC +* Beautifying JSON + +#+BEGIN_SRC emacs-lisp + (defun beautify-json () + "Use python to prettyprint JSON." + (interactive) + (let ((b (if mark-active (min (point) (mark)) (point-min))) + (e (if mark-active (max (point) (mark)) (point-max)))) + (shell-command-on-region b e + "python -mjson.tool" (current-buffer) t))) +#+END_SRC + * configure some default values [2014-10-02 Thu 00:27] -- 2.47.3