Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [json]

The tag has no usage guidance.

0
votes
1answer
28 views

how to generate dynamic json data with emacs (macros)?

I was in a meeting yesterday where I was presenting a program that referenced a certain json file with data like this: [ { id: 1, text: '...', ... }, { id: 2, text: '...', ... } ] In ...
0
votes
1answer
71 views

Emacs, pretty print but showing spaces and \n

I'm making diagrams with plantuml and org mode, when preparing the JSONs, in order to plot well the diagram I need this representation of JSON: (with-temp-buffer (insert (json-encode '((calimero . ...
1
vote
1answer
44 views

Where find good json formater and validation?

Emacs 26.1. Windows 10 It's has function json-pretty-print . But it not enough for me. Has any another better json formater and validator? I mean the next. Suppose I has error on json on line 26. I ...
0
votes
1answer
70 views

Get the path to the JSON element at point

Problem statement Using Elisp, when point is on an element in a JSON datastructure (either raw JSON or an Elisp sexp of the kind generated by json.el), is there an easy way to get a json-pointer-get-...
6
votes
2answers
257 views

JSON file folding and step-by-step unfolding

I need to look at larger, quite deeply nested JSON files in Emacs. Similar to the terminal tool json-view I would like to start with the JSON file completely folded and then open each level step-by-...
2
votes
1answer
394 views

json-readtable-error during org-capture

This problem only arose today and I haven't really changed anything substantial in my init.el so I am sure what the source of the error is. Essentially, when running org-capture (and also during ...
1
vote
1answer
388 views

How do you get data by key from a json list?

I loaded some json data into a string and have elisp parsing it using the json-read-from-string function. Now I want to do is access data from the JSON by key. When I print out the data via message, ...
0
votes
1answer
100 views

json-reformat-region on file open

currently I'm working a lot with json files. They tend to be a little bigger. I'm a little fed up with always marking the whole file and then typing M-x json-reformat-region. Is there a way to do ...
4
votes
1answer
918 views

org export json

I'm using the JSON produced by org-export-json to display it in a virtual DOM (the output is an array like [ element_type, properties{}, children[]... ] very suitable for this). Being not very fluent ...
0
votes
2answers
61 views

How do I filter an alist to just the properties I care about?

To effectively use a service's API, I'm leveraging json-read to turn the JSON response into an understandable data structure: (let ((json-object-type 'alist) (json-array-type 'list) (...
0
votes
0answers
68 views

Get emacs to read unquoted strings in json

I am trying to use emacs-lisp to interact with a MongoDB. Here is an example of a string that mongo returns, that emacs cannot read. The problem is the unquoted ObjectId and ISODate items (if I put ...
3
votes
1answer
1k views

Accessing JSON data in elisp

{ "name": "xxxxx", "job": "xxxxxx", "projects": [ { "name": "xxxxx", "date": "xxxxx", "about": "xxxxxxxxxx" ...
6
votes
2answers
460 views

Is there a way to check whether or not a string is valid json?

I am trying to parse a string with the json.el package, though when the string is not json unexpected things happen. Is there a way in elisp to check whether or not a provided string is actually a ...
16
votes
2answers
1k views

Outline editing, like org-mode, for JSON

I am trying to edit a Swagger JSON file in emacs. It contains large nested JSON objects, so I want to collapse and hide some of them. I have tried origami-mode, configured as origami-c-style-parser ...
1
vote
0answers
149 views

Parsing nested json

I'm using request to grab a json file (here's one for instance: http://gd2.mlb.com/components/game/mlb/year_2015/month_06/day_10/grid.json) and trying to read the data. I'm interesting in looping ...
4
votes
1answer
503 views

How to encode empty json object in elisp?

The json package coming with Emacs 24 has function json-encode that works like this: (json-encode '(("key" . "value"))) "{\"key\":\"value\"}" In case there are no keys (object is empty) I get: (...
2
votes
0answers
220 views

JSON major mode complaining about valid JSON file

I am editing a dead simple JSON file: { "foo": "bar" } Here's what I see: Doing a C-h m I see the following minor modes running alongside JSON mode: Enabled minor modes: Auto-Composition Auto-...
0
votes
1answer
64 views

How to load json.el included in emacs instead of fallback lib included in gnus

I want to use the json.el included in 24.5, but cannot do that, because gnus includes an older version of json.el that is loaded before the one from 24.5. When running list-load-path-shadows I got ...
1
vote
1answer
47 views

hs-minor-mode keybindings are undefined or bring up help window

I installed the json-mode package, then added this to my .emacs: (require 'json-mode) (add-hook 'json-mode-hook 'hs-minor-mode) After opening a json file, I used Describe-variable on hs-minor-mode ...
1
vote
1answer
248 views

json-mode hook not being run

I have (add-hook 'json-mode 'flymake-json-load) in my .emacs file, but it has no effect. I have to do M-x flymake-json-load whenever I visit a .json file. Why doesn't it work?
5
votes
2answers
774 views

How to iterate over JSON list and select one element

Say I have a list of names with ids, in JSON: (let ((json-object-type 'plist)) (setq mylist (json-read-from-string "[{\"name\": \"Adam\", \"id\": \"1\"}, {\"...
1
vote
1answer
791 views

Error when opening IPython notebook list using EIN

I am not entirely sure where to post this question (here, stackoverflow....), but I am sure some emacs experts will be able to help me here. This question is also posted here https://github.com/tkf/...
15
votes
2answers
3k views

Code-folding extensions for json

I am dealing with json files with multiple repeated blocks with just one field value(integer) changed - in fact, every changed value is just the previous corresponding value incremented. To make such ...