Giter Site home page Giter Site logo

main directory symlink about neuron-mode HOT 4 CLOSED

felko avatar felko commented on June 6, 2024
main directory symlink

from neuron-mode.

Comments (4)

garrett-hopper avatar garrett-hopper commented on June 6, 2024

Err, it should only be expanded if (neuron--detect-zettelkasten pwd) returns non-nil.

(defun neuron--get-zettelkasten (&optional pwd)
  "Return the location of the current zettelkasten.
Assuming the current working directory is PWD, first try to
detect the zettelkasten automatically by traversing the hierarchy
upwards until a neuron.dhall file is found. When no neuron.dhall
file is found, return `neuron-default-zettelkasten-directory'.
Lastly, if the default zettelkasten location doesn't point to
an actual directory, return nil."
  (interactive "P")
  (or
   (if-let ((x (neuron--detect-zettelkasten pwd)))
       (expand-file-name x))
   (let ((root neuron-default-zettelkasten-directory))
     (and (f-exists? root) (f-directory? root) neuron-default-zettelkasten-directory))))

from neuron-mode.

felko avatar felko commented on June 6, 2024

You should be able to expand the path directly when setting neuron-default-zettelkasten-directory, I have tested (setq neuron-default-zettelkasten-directory (expand-file-name "~/zet")) (where ~/zet is a symlink to my actual zk directory) and it appears to work.

I remember voluntarily not expanding the file name automatically, mimicking what I had seen in other emacs lisp code, but actually I don't see any downside to do this, which indeed would be more intuitive.

However, I can't quite reproduce your error. I can see the same error, but it occurs when I am NOT in my actual zettelkasten directory, and it works just fine with neuron--detect-zettelkasten. That is a bit odd, do you mind detailing exactly what were the values of neuron-default-zettelkasten-directory and (pwd)?

from neuron-mode.

felko avatar felko commented on June 6, 2024

Maybe you can try with the latest master. The 18d230c commit expands all file names.

from neuron-mode.

garrett-hopper avatar garrett-hopper commented on June 6, 2024

This appears to be working correctly now, thanks!

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.