Giter Site home page Giter Site logo

Comments (10)

felko avatar felko commented on June 14, 2024

Normally neuron-mode should be enabled automatically whenever one opens a markdown file in a zettelkasten, assuming the directory has a neuron.dhall file at its root.
However, manually enabling neuron-mode shouldn't give an error, regardless of the existence of neuron.dhall.
Could you provide the backtrace?

from neuron-mode.

peti avatar peti commented on June 14, 2024

How do I generate a backtrace?

from neuron-mode.

felko avatar felko commented on June 14, 2024

Running M-x toggle-debug-on-error should open a buffer with the backtrace when an error occurs.

from neuron-mode.

peti avatar peti commented on June 14, 2024

I get this error:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  intern(nil)
  #f(compiled-function (zettel) #<bytecode 0x16ce4d1>)(((zettelTags . ["learning"]) (zettelDay . "2020-07-25") (zettelID . "bb86db02") (zettelError (Right . [])) (zettelContent . []) (zettelQueries . [["ZettelQuery_ZettelByID" ["e692b9e8" nil]]]) (zettelFormat . "markdown") (zettelPath . "bb86db02.md") (zettelTitle . "How to Use the Zettelkasten System?") (zettelTitleInBody . t)))
  mapcar(#f(compiled-function (zettel) #<bytecode 0x16ce4d1>) [((zettelTags . ["learning"]) (zettelDay . "2020-07-25") (zettelID . "bb86db02") (zettelError (Right . [])) (zettelContent . []) (zettelQueries . [["ZettelQuery_ZettelByID" ["e692b9e8" nil]]]) (zettelFormat . "markdown") (zettelPath . "bb86db02.md") (zettelTitle . "How to Use the Zettelkasten System?") (zettelTitleInBody . t)) ((zettelTags . ["learning"]) (zettelDay) (zettelID . "e692b9e8") (zettelError (Right . [])) (zettelContent . []) (zettelQueries . []) (zettelFormat . "markdown") (zettelPath . "e692b9e8.md") (zettelTitle . "Using Feynman Notes for Learning") (zettelTitleInBody . t))])
  neuron--rebuild-cache()
  byte-code("\301\010!\203\011\0\302 \210\303\304!\207" [neuron-zettelkasten f-directory\? neuron--rebuild-cache provide neuron-mode] 2)
  autoload-do-load((autoload "neuron-mode" "A major mode to edit Zettelkasten notes with neuron.\n\n(fn)" t nil) neuron-mode)
  command-execute(neuron-mode record)
  execute-extended-command(nil "neuron-mode")
  smex-read-and-run(("toggle-debug-on-error" "neuron-mode" "R" "cd" "5x5" "arp" "dbx" "dig" "erc" "ert" "eww" "ftp" "gdb" "irc" "jdb" "man" "mpc" "pdb" "pwd" "rsh" "sdb" "xdb" "bbdb" "calc" "diff" "dirs" "ffap" "gnus" "grep" "help" "ielm" "info" "life" "mail" "mpuz" "ping" "pong" "smex" "talk" "term" "undo" "yank" "zone" "align" "chmod" "debug" "diary" "dired" "ediff" "edirs" ...))
  smex()
  funcall-interactively(smex)
  #<subr call-interactively>(smex nil nil)
  apply(#<subr call-interactively> smex (nil nil))
  call-interactively@ido-cr+-record-current-command(#<subr call-interactively> smex nil nil)
  apply(call-interactively@ido-cr+-record-current-command #<subr call-interactively> (smex nil nil))
  call-interactively(smex nil nil)
  command-execute(smex)

from neuron-mode.

felko avatar felko commented on June 14, 2024

That is odd. I'm almost certain that the compiled function that gives the error is assoc-id defined here:

(defun neuron--rebuild-cache ()
  "Rebuild the zettel cache with the current zettelkasten."
  (let ((zettels (neuron--query-url-command "z:zettels"))
        (assoc-id (lambda (zettel) (cons (intern (map-elt zettel 'zettelID)) zettel))))
    (setq neuron--zettel-cache (mapcar assoc-id zettels))))

But this would mean that (map-elt zettel 'zettelID) returns nil, which sounds impossible given that the list of zettels in te backtrace provide a zettelID field for each entry.

What is the value of neuron-default-zettelkasten-directory? Also, do you have the neuron.dhall file at the root of your zettelkasten?

from neuron-mode.

peti avatar peti commented on June 14, 2024

What is the value of neuron-default-zettelkasten-directory?

neuron-default-zettelkasten-directory’s value is "/home/simons/zettelkasten", which is where the zettelkasten lives. I used to have it at ~/src/zettelkasten, but eventually moved it because keeping the directory in a non-default place caused all kinds of trouble with neuron itself, etc.

Also, do you have the neuron.dhall file at the root of your zettelkasten?

Yes, I do:

$ cat neuron.dhall
{ siteTitle     = "Peter Simons' Zettelkasten"
, siteBaseUrl   = Some "http://cryp.to"
}

from neuron-mode.

peti avatar peti commented on June 14, 2024

Do you have any idea what might be causing this issue?

from neuron-mode.

felko avatar felko commented on June 14, 2024

Sorry for the late response, unfortunately I wasn't able to reproduce the bug.
Could you try updating both neuron and neuron-mode just to be sure? (<id> links are still supported for now, I'll do wikilinks next)
And then try reproducing the error and backtrace without compiling your config so that I can be sure where the error comes from
Not sure how to run emacs without using the precompiled files though

from neuron-mode.

peti avatar peti commented on June 14, 2024

I usually install these Emacs modes via Nix, which means that I get whatever version of these that Nixpkgs currently contains. Nix snapshots ELPA and other repositories every couple of weeks, so it's possible that these versions are not completely up-to-date. Anyhow, the errors I experience come from the Nix-based installation. So I tried something else and installed neuron-mode via package.el in Emacs. Lo and behold, that installation works just fine.

So it's safe to say that this issue is not caused by a bug in neuron-mode itself. Rather, it's some kind of incompatibility between neuron-mode and some older version of some other library that it uses.

from neuron-mode.

felko avatar felko commented on June 14, 2024

I usually install these Emacs modes via Nix

Interesting, how does it work? I think you can also do declarative builds directly in emacs using something like straight (doom emacs configs are more or less declarative for example, it is based on straight). The only issue is that you can't install external software this way.

I'll leave the issue open in case someone finds a fix

from neuron-mode.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.