aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-inspect.el
diff options
context:
space:
mode:
authorH Durer <h.duerer@gmail.com>2018-03-30 05:03:02 +0100
committerJohnson Denen <johnson.denen@gmail.com>2018-08-10 22:20:04 -0400
commitdd4752a8e04d5ecb0828318ea86aeb564ce702a3 (patch)
tree825e0991e1c4f8998605db91a76b6cc94e0411fe /lisp/mastodon-inspect.el
parent4eaab0252c154ba4651125b7984d36a7474179ff (diff)
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.
Diffstat (limited to 'lisp/mastodon-inspect.el')
-rw-r--r--lisp/mastodon-inspect.el9
1 files changed, 5 insertions, 4 deletions
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"))