From 425497c1dfbc6b6232afd697698565c65f48fb4f Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Mon, 26 Aug 2019 10:11:44 -0400 Subject: [PATCH] pprint-json and better devpi-upload --- emacs/init.org | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/emacs/init.org b/emacs/init.org index 610db65..761a50f 100755 --- a/emacs/init.org +++ b/emacs/init.org @@ -272,6 +272,15 @@ Checking if a buffer contains a string: (search-forward string nil t)))) #+END_SRC +Pretty-print JSON: +#+BEGIN_SRC emacs-lisp + (defun pprint-json (raw-json) + (with-temp-buffer + (insert raw-json) + (json-pretty-print (point-min) (point-max)) + (buffer-substring (point-min) (point-max)))) +#+END_SRC + ** Persisting variables between session The idea behind this is pretty simple - variables get persisted in ~/.emacs.d/ as a plist of (variable-name variable-value). @@ -3044,7 +3053,7 @@ The aws-mfa command: (defun devpi-upload () (interactive) (cl-letf (((symbol-function 'devpi-upload) (make-process-fn "devpi" "upload"))) - (devpi-upload))) + (message (devpi-upload)))) #+END_SRC * StumpWM A handy keybinding to connect to the StumpWM SBCL process via SLIME: