srid / neuron

Future-proof note-taking and publishing based on Zettelkasten (superseded by Emanote: https://github.com/srid/emanote)
https://neuron.zettel.page
GNU Affero General Public License v3.0
1.52k stars 150 forks source link

Unable to create new Zettel with neuron-mode #503

Closed ednolan closed 3 years ago

ednolan commented 3 years ago

I know that neuron-mode is a separate project but I'm filing the bug here anyway because this issue appears to me to be a regression in neuron, not in neuron-mode.

Steps to reproduce (neuron-mode):

Debugger entered--Lisp error: (json-readtable-error 80)
  signal(json-readtable-error (80))
  json-read()
  json-read-from-string("Plugins enabled: [Some PluginData_DirTree,Some Plu...")
  neuron--read-query-result("Plugins enabled: [Some PluginData_DirTree,Some Plu...")
  neuron--query-url-command("z:zettels")
  neuron--rebuild-cache()
  neuron--update-current-zettelkasten("/home/eddie/zettelkasten/")
  neuron-zettelkasten()
  neuron-check-if-zettelkasten-exists()
  neuron-create-zettel-buffer("Test")
  funcall-interactively(neuron-create-zettel-buffer "Test")
  call-interactively(neuron-create-zettel-buffer t [nil nil])
  neuron-new-zettel()
  funcall-interactively(neuron-new-zettel)
  call-interactively(neuron-new-zettel nil nil)
  command-execute(neuron-new-zettel)

When looking through the emacs lisp code, it looks like neuron-mode is expecting the output of the following command to be JSON, but instead it is producing unrelated log messages to stdout:

$ neuron -d ~/zettelkasten/ query --uri z:zettels 2>/dev/null
Plugins enabled: [Some PluginData_DirTree,Some PluginData_NeuronIgnore]
Ignore patterns: [".*/**"]
Loading directory tree (2 files) ...
{"skipped":{},"result":[],"query":["ZettelQuery_ZettelsByTag",[{"tag":"TagQuery_Or","contents":[]},"OrdinaryConnection",{"zettelsViewLinkView":"LinkView_Default","zettelsViewLimit":null,"zettelsViewGroupByTag":false}]]}
srid commented 3 years ago

Note to self: do logging properly whilst working on #321

ednolan commented 3 years ago

I just retried this with the new commit and unfortunately it's still broken in neuron-mode. It looks like they include output from stderr as well as stdout when they parse the result of neuron query. However, since there's now a proper way to disregard the log messages, which neuron-mode hasn't implemented, I think I'll just file a new issue in neuron-mode instead of reopening this issue. Thanks for the quick response!

ednolan commented 3 years ago

Created https://github.com/felko/neuron-mode/issues/68