Skip to main content

Questions tagged [json]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
3 answers
98 views

How to convert an org-table to JSON?

Here is a minimal example of an org-table: #+NAME: radar |----------+------| | Variable | Val | |----------+------| | Red | 43.3 | | Blue | 83.1 | | Yellow | 86.4 | |----------+------| I ...
crocefisso's user avatar
  • 1,306
0 votes
1 answer
53 views

Loss of latex-mode Fontification When Loading Libraries in latex-mode-hook That Require json-mode

My actual scenario involves using latex-mode-hook to load some libraries that require json-mode. I replicated my issue in a MWE: I have a LaTeX file: \documentclass{article} \usepackage{mwe} \begin{...
Gabriele's user avatar
  • 1,608
0 votes
0 answers
53 views

With org-babel, how can I reference a JSON code block with noweb?

Using noweb, I'm trying to reference a JSON block #+name: gazonk #+begin_src json { xyzzy " } #+end_src #+begin_src shell :results verbatim :noweb yes gazonk="${<<gazonk>>@Q}&...
Jason Hunter's user avatar
0 votes
0 answers
36 views

Emacs copy JSON Value

For a JSON block, is there any way to extract the value with a simple keybinding?;) For example, the function should return foo:bar "hukarz": "foo:bar",
Jason Hunter's user avatar
0 votes
1 answer
111 views

JSON parsing fails: json-parse-error "too big integer"

I'm trying to parse a JSON file which contains large numbers: { "uuid": "c73b470a-5efb-4d53-9ac6-c5f6487f227b", "description": "grains on square 64&...
fap's user avatar
  • 141
0 votes
2 answers
184 views

Regex to find and replace a specific character inside of multiple quoted strings in a string

Given an example string of JSON (formatted here for reading, actual input may or may not be formatted): { "page":1, "per_page":6, "total":12, "...
David's user avatar
  • 126
2 votes
0 answers
1k views

Emacs with JSON support

I'm trying to compile emacs 28.2 (from https://ftp.gnu.org/gnu/emacs/) with json support on a Ubuntu-based system (Linux Mint). But I don't get it to work meaning that json-available-p is void and I ...
dmw64's user avatar
  • 177
1 vote
2 answers
382 views

How to read JSON file in emacs and display it in the scratch buffers?

I've a json data returned by endpoint which is as below: { "id":"1383", "entryPoint":"Stranger in the night.", "Source":"music" } What I ...
user1146081's user avatar
1 vote
1 answer
130 views

How to use ediff with JSON, so it abstracts from member order in objects?

Currently I use ediff a lot for diffing all sorts of text files. I also use it for looking at diffs between JSON files. The problem is that a lot of differences appear which are semantically ...
Richard Wheeldon's user avatar
0 votes
1 answer
198 views

LSP: Bad JSON object: ":", 97

I am using gccemacs, where emacs is build with --with-native-compilation configuration option. After compilation is done,when I run M-x lsp: I start to have following error: Bad JSON object: ":&...
alper's user avatar
  • 1,370
1 vote
2 answers
133 views

How to customize the delimiter in the minor mode Hideshow for use with JSON data?

The documentation of hs-minor-mode explains: In C mode and related modes, blocks are delimited by braces, while in Lisp mode they are delimited by parentheses. I use the mode to collapse objects ...
ceving's user avatar
  • 1,368
3 votes
1 answer
489 views

How do i create a nested list from a json data?

From JSON, I'm trying to build a nested list of nodes which should look like the expected result below: (html (head (meta title)) (body (ul (div) (div) (div))) ; I guess this is the right approach for ...
alexander's user avatar
  • 133
0 votes
1 answer
141 views

Extract JSON from multi-line string, removing leading/trailing garbage

I am struggling to come up with a universal regexp that will remove/isolate all leading/trailing garbage from a multi-line string, leaving only the JSON. Without opening up a temporary buffer to re-...
lawlist's user avatar
  • 19.1k
0 votes
3 answers
112 views

Why am I getting this error, saying that a comma is not a function?

In a related thread https://emacs.stackexchange.com/a/34336/2287, a string (containing JSON data) is converted using json-read-from-string. The value returned in that example looks like this: ((1 ...
lawlist's user avatar
  • 19.1k
5 votes
1 answer
2k views

Insert json or XML blocks in org mode

I often have to insert blocks of json or XML code into my org documents. What is the preferred way of doing so? I see that for the standard: #+BEGIN_SRC ... #+END_SRC ... there is no json or xml in ...
Ricky Robinson's user avatar
3 votes
1 answer
377 views

How can I work around json-encode error with key "t"

While working with JSON in Emacs Lisp, I got an error json-encode-key: Bad JSON object key: t. It made sense to me that the key was "t" but not necessarily why, or what I can do about it. ...
John Nelson's user avatar
1 vote
1 answer
359 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 ...
breathe_in_breathe_out's user avatar
1 vote
1 answer
2k 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 ...
Viesturs's user avatar
  • 825
0 votes
2 answers
752 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 ...
a_subscriber's user avatar
  • 4,084
2 votes
1 answer
495 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 ...
aadcg's user avatar
  • 1,248
0 votes
1 answer
205 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 ...
David J.'s user avatar
  • 163
0 votes
1 answer
728 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 . ...
anquegi's user avatar
  • 749
1 vote
1 answer
441 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 ...
a_subscriber's user avatar
  • 4,084
2 votes
1 answer
752 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-...
izkon's user avatar
  • 1,878
8 votes
2 answers
2k 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-...
halloleo's user avatar
  • 1,341
4 votes
2 answers
2k 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 ...
Quarky Quanta's user avatar
3 votes
1 answer
2k 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, ...
chaseme's user avatar
  • 33
0 votes
1 answer
766 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 ...
daeda's user avatar
  • 439
4 votes
1 answer
2k 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 ...
Flint's user avatar
  • 292
0 votes
2 answers
114 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) (...
Sean Allred's user avatar
  • 6,921
0 votes
0 answers
131 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 ...
John Kitchin's user avatar
  • 11.9k
7 votes
1 answer
7k views

Accessing JSON data in elisp

JSON: { "name": "xxxxx", "job": "xxxxxx", "projects": [ { "name": "xxxxx", "date": "xxxxx", "about": "xxxxxxxxxx" }, { "name": "xxxxx", "date": "xxxxx",...
I'm Mo's user avatar
  • 73
6 votes
2 answers
1k 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 ...
lookyhooky's user avatar
16 votes
2 answers
3k 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 ...
Robin Green's user avatar
1 vote
0 answers
469 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 ...
mast's user avatar
  • 11
4 votes
1 answer
1k 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: (...
Gracjan Polak's user avatar
4 votes
1 answer
456 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-...
Marcus Junius Brutus's user avatar
0 votes
1 answer
81 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 ...
Alexander Baier's user avatar
1 vote
1 answer
94 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 ...
Kittenmittons's user avatar
1 vote
1 answer
449 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?
Robin Green's user avatar
5 votes
2 answers
2k 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\"}, {\"...
andreas-h's user avatar
  • 1,559
1 vote
1 answer
2k 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/...
Javier's user avatar
  • 197
20 votes
2 answers
6k 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 ...
Pradhan's user avatar
  • 2,370