Questions tagged [json]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
50 views

Manage JSON (comments) with org literate programming and tangle

I would like to manage a JSON config file with added comments on some key-value-pairs and explain options. Since it is not possible to comment in JSON, I thought about using org-mode literate ...
0
votes
1answer
537 views

How to make Emacs edit JSON data in `json-mode`?

I am working with GNU Emacs 23.1.1. When working with a .json file it is treated in the Fundamental mode: How can I have the json file treated in the json mode? I note that GNU Emacs 24.3.1 opens ...
0
votes
2answers
608 views

Json - get count of elements

Emacs 26.1 Here json file: [ { "id": 11, "name": "my name" }, { "id": 22, "name": "my name3" }, { "id": 33, "name": "my name3" } ] As you can see the count of ...
2
votes
1answer
232 views

Org export to html

I tried exporting several org files to HTML without success. That came as a surprise, since I've done that tons of times. The message I was getting on the minibuffer shed some light. End of file ...
0
votes
1answer
118 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
390 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
203 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 ...
1
vote
1answer
342 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
774 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-...
3
votes
2answers
1k 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
965 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
389 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
1k 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
82 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
91 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 ...
6
votes
1answer
5k views

Accessing JSON data in elisp

JSON: { "name": "xxxxx", "job": "xxxxxx", "projects": [ { "name": "xxxxx", "date": "xxxxx", "about": "xxxxxxxxxx" }, { "name": "xxxxx", "date": "xxxxx",...
6
votes
2answers
860 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 ...
15
votes
2answers
2k 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
282 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
896 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
312 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
74 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
71 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
319 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
1k 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
1k 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/...
18
votes
2answers
5k 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 ...