From dd4752a8e04d5ecb0828318ea86aeb564ce702a3 Mon Sep 17 00:00:00 2001 From: H Durer Date: Fri, 30 Mar 2018 05:03:02 +0100 Subject: Tiny fixes to `mastodon-inspect--dump-json-in-buffer` (#195) - Erase buffer before adding new contents - Don't globally set `print-level` and `print-length`; just temporarily let them to the locally desired values. --- lisp/mastodon-inspect.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lisp/mastodon-inspect.el') diff --git a/lisp/mastodon-inspect.el b/lisp/mastodon-inspect.el index 61cb1e3..b3541e2 100644 --- a/lisp/mastodon-inspect.el +++ b/lisp/mastodon-inspect.el @@ -44,10 +44,11 @@ (defun mastodon-inspect--dump-json-in-buffer (name json) "Buffer NAME is opened and JSON in printed into it." (switch-to-buffer-other-window name) - (setf print-level nil - print-length nil) - (insert (pp json t)) - (goto-char 1) + (erase-buffer) + (let ((print-level nil) + (print-length nil)) + (insert (pp json t))) + (goto-char (point-min)) (emacs-lisp-mode) (message "success")) -- cgit v1.2.3