[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master b93bde1: Fix pretty-printing of {}
From: |
Lars Ingebrigtsen |
Subject: |
[Emacs-diffs] master b93bde1: Fix pretty-printing of {} |
Date: |
Wed, 10 Jul 2019 07:23:55 -0400 (EDT) |
branch: master
commit b93bde184e1e0d21bde34a7fd660888bd04893d7
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>
Fix pretty-printing of {}
* lisp/json.el (json-pretty-print): Fix reading {}, which returns nil.
---
lisp/json.el | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/lisp/json.el b/lisp/json.el
index eae5eda..d664dae 100644
--- a/lisp/json.el
+++ b/lisp/json.el
@@ -764,13 +764,15 @@ With prefix argument MINIMIZE, minimize it instead."
(json-null :json-null)
;; Ensure that ordering is maintained
(json-object-type 'alist)
+ (err (gensym))
json)
(save-restriction
(narrow-to-region begin end)
(goto-char begin)
- (while (setq json (condition-case _
- (json-read)
- (json-error nil)))
+ (while (not (eq (setq json (condition-case _
+ (json-read)
+ (json-error err)))
+ err))
(delete-region begin (point))
(insert (json-encode json))
(setq begin (point))))))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master b93bde1: Fix pretty-printing of {},
Lars Ingebrigtsen <=