meedstrom / org-node

A notetaking system like Roam using Emacs Org-mode
GNU General Public License v3.0
150 stars 5 forks source link

No, this doesn't work on windows-nt #64

Open JayDugger opened 5 days ago

JayDugger commented 5 days ago

https://github.com/meedstrom/org-node/blob/3241743c4b3d0c69968b301e62cb0602932297da/org-node.el#L1026

Seems to work fine on Linux, but not on the Windows build of emacs where echo is not in the PATH.

What can I do to help?

meedstrom commented 5 days ago

Hi, thanks for reporting! I got that command from here: https://stackoverflow.com/a/32395352

Are you using Emacs through Cygwin or WSL or an Emacs built for Windows? Maybe that affects the PATH.

What happens if you open the Command Prompt in Windows and enter echo %NUMBER_OF_PROCESSORS%?

JayDugger commented 5 days ago

GNU Emacs 29.4 (build 2, x86_64-w64-ming32) of 2024-07-05

Emacs built for Windows Probably affects PATH

In cmd prompt, echo %NUMBER_OF_PROCESSORS% returns 8.

On Wed, Oct 30, 2024, 10:02 Martin Edström @.***> wrote:

Hi, thanks for reporting! I got that command from here: https://stackoverflow.com/a/32395352

Are you using Emacs through Cygwin or WSL or an Emacs built for Windows? Maybe that affects the PATH.

What happens if you open the Command Prompt in Windows and enter echo %NUMBER_OF_PROCESSORS%?

— Reply to this email directly, view it on GitHub https://github.com/meedstrom/org-node/issues/64#issuecomment-2447441552, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAIFL3C2ZOCMTZUFMSFDBLZ6DYHVAVCNFSM6AAAAABQ27B7M2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBXGQ2DCNJVGI . You are receiving this because you authored the thread.Message ID: @.***>

meedstrom commented 4 days ago

Returning 8 is good. How did you conclude that it does not work?

But another idea to try: in Emacs, can you eval the expression (getenv "%NUMBER_OF_PROCESSORS%")? Would simplify the code.

JayDugger commented 3 days ago

Emacs now does something it didn't do for the previous version of the package.

It returns

File error: Spawning child process, Exec format error

Evaluated your suggestion, got

nil

Compared with emacs on WSL, no problem there

On Wed, Oct 30, 2024, 19:08 Martin Edström @.***> wrote:

How did you figure that it does not work?

But another idea to try: in Emacs, can you eval the expression (getenv "%NUMBER_OF_PROCESSORS%")? Would simplify the code.

— Reply to this email directly, view it on GitHub https://github.com/meedstrom/org-node/issues/64#issuecomment-2448706917, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAIFL3UBLRX7UMHCTARGO3Z6FYJLAVCNFSM6AAAAABQ27B7M2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBYG4YDMOJRG4 . You are receiving this because you authored the thread.Message ID: @.***>

meedstrom commented 3 days ago

Thanks.

I assume that this returns the integer 8:

(ignore-errors
  (with-temp-buffer
    (call-process "echo" nil t nil "%NUMBER_OF_PROCESSORS%")
    (buffer-string)))

File error: Spawning child process, Exec format error

When does this error occur? Can you do M-x toggle-debug-on-error and try to trigger it again?

JayDugger commented 3 days ago

The (ignore-errors) returned nothing.

In eshell env returns the whole environment which includes the correct value for the environment variable number of processors

I can trigger the error with org-node-reset. It also appears when starting emacs.

With toggle-debug-error set,

Org-node--scan: Spawning child process: Exec format error

On Fri, Nov 1, 2024, 07:31 Martin Edström @.***> wrote:

Thanks.

I assume that this returns the integer 8:

(ignore-errors (with-temp-buffer (call-process "echo" nil t nil "%NUMBER_OF_PROCESSORS%") (buffer-string)))

File error: Spawning child process, Exec format error

When does this error occur? Can you do M-x toggle-debug-on-error and try to trigger it again?

— Reply to this email directly, view it on GitHub https://github.com/meedstrom/org-node/issues/64#issuecomment-2451798522, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAIFL3L5IFLFODUOUNZD53Z6NYBPAVCNFSM6AAAAABQ27B7M2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJRG44TQNJSGI . You are receiving this because you authored the thread.Message ID: @.***>

meedstrom commented 1 day ago

Hi, sorry for delaying. I've added instructions for how to downgrade org-node version on the README: https://github.com/meedstrom/org-node#how-to-rollback

I'm currently spinning out a part of the codebase into a new library (el-job). Once that's done, it'll be easier for me to look into the error you're having.

By the way, regarding the number of processors. Found a function that's built into Emacs! (num-processors) I hope that one returns an integer 8?

JayDugger commented 7 hours ago

Thank you for your work on this issue. I appreciate the roll back instructions. (num-processors) returns 8

On Sun, Nov 3, 2024, 06:18 Martin Edström @.***> wrote:

Hi, sorry for delaying. I've added instructions for how to downgrade org-node version on the README: https://github.com/meedstrom/org-node#how-to-rollback

I'm currently spinning out a part of the codebase into a new library ( el-job https://github.com/melpa/melpa/pull/9225). Once that's done, it'll be easier for me to look into the error you're having.

By the way, regarding the number of processors. Found a function that's built into Emacs! (num-processors) I hope that one returns an integer 8?

— Reply to this email directly, view it on GitHub https://github.com/meedstrom/org-node/issues/64#issuecomment-2453407507, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAIFL23NV5DHJMUENHOJ3TZ6YIAPAVCNFSM6AAAAABQ27B7M2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINJTGQYDONJQG4 . You are receiving this because you authored the thread.Message ID: @.***>