Timeline for Get the path to the JSON element at point
Current License: CC BY-SA 4.0
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Nov 11, 2018 at 16:22 | comment | added | user12563 | I can't reproduce it even with no init file. Can you post this as an issue on github? Long discussions don't belong in comments. | |
| Nov 11, 2018 at 14:16 | comment | added | izkon | I'm not reporting that an empty buffer results in an error message saying that it's not valid JSON. Rather, I'm reporting that if I (1) create an empty buffer (with M-x switch-to-buffer <RETURN> foo and then (2) fill that buffer with the JSON example in my question above and finally (3) turn json-mode on by M-x json-mode in that very same buffer that's full of the example JSON, that's when I get an "Invaild JSON" error. Also, I do have the latest json-mode. I only downloaded it for the first time a few minutes before posting my comment to you above. | |
| Nov 11, 2018 at 11:52 | comment | added | user12563 | I can't reproduce either of your problems. An empty buffer doesn't contain a valid JSON, so the error makes sense, and your example with /bar/0/qux seems to work flawlessly for me. Have you tried updating json-mode to the newest version? | |
| Nov 11, 2018 at 10:07 | vote | accept | izkon | ||
| Nov 11, 2018 at 10:07 | comment | added | izkon | Thank you for your hard work. Though this only works with raw JSON and not with sexps of the kind generated by json.el, as far as I can see, and so is only half an answer to my question, I will accept your answer as it's the closest one yet to what I need. It does have some issues, though: first, when pasting the above JSON test in to a new buffer and activating json-mode, it tells me "Invalid JSON", though running json-mode-validate-buffer tells me "Buffer contains a valid JSON". Also, when point is on "hello", I should get "/bar/0/qux" but I get only "/bar/0". | |
| Oct 27, 2018 at 23:52 | history | answered | user12563 | CC BY-SA 4.0 |