Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notespace assumes any source files will live under src directory #50

Open
jonadelson opened this issue Dec 15, 2020 · 3 comments
Open

Comments

@jonadelson
Copy link

I was trying to make a mixed java/clojure project in which the java files would be under src/main/java and the clojure files would be under src/main/clojure and found that Notespace assumes that any namespaces would be in the src directory. I'm not sure if this is really an issue but was wondering if you recommended some workaround. Also, really love the library!

@daslu
Copy link
Member

daslu commented Dec 16, 2020

Hi @jonadelson, thanks!

Following your comment, I now deployed a small change that allows configuring the source base path.

(notespace.api/update-config
  #(assoc % :source-base-path "src/main/clojure"))

should make it work in your case.

Does it seem to work?

@jonadelson
Copy link
Author

jonadelson commented Dec 16, 2020

Thanks for such a quick response! It seems to work, but I did accidentally stumble on one issue.

Everything works fine if I run the following namespace by first evaluating the forms in the comment and then using the notespace/eval-this-notespace emacs command.

(comment
  (notespace.api/init-with-browser)
  (notespace.api/update-config
    #(assoc % :source-base-path "src/main/clojure"))
)

(+ 1 2)

However, the following seems to hang after evaluating the comment forms and running the notespace/eval-this-notespace emacs command.

(comment
  (notespace.api/init-with-browser)
  (notespace.api/update-config
    #(assoc % :source-base-path "src/main/clojure"))
)

(notespace.api/update-config
  #(assoc % :source-base-path "src/main/clojure"))

(+ 1 2)

I'm not sure if this is a legitimate problem or a misunderstanding of the library on my part. Thanks.

@daslu
Copy link
Member

daslu commented Dec 16, 2020

Thanks @jonadelson !

In general, notespace API function calls are not recommended to be part of the notespace itself, but rather live inside comments (or be called from the REPL by some other method).

For some of the API functions, this may result in an infinite loop (for example, when the function is trying to evaluate the note that contains itself).

In the case of this function, I am not sure why this hangs. It seems like a good idea to understand that, so let us leave the issue open for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants