dwcoates / pygn-mode

An Emacs major-mode for chess PGN files, powered by Python
BSD 2-Clause "Simplified" License
10 stars 3 forks source link

Error: "bad or does not contain working server script (pygn_server.py)" #204

Closed SequentialDesign closed 2 years ago

SequentialDesign commented 2 years ago

I'm getting this error [ ] Bad. The pygn-mode-script-directory ('c:/Users/Alejandro/AppData/Roaming/.emacs.d/elpa/pygn-mode-20211021.2325/') is bad or does not contain working server script (pygn_server.py). after running pygn-mode-run-diagnostic. Any idea why?

pygn_server.py is in the directory. I'm using Windows 10. I don't know what the problem is.

the complete diagnostic is as follows:

[x] Good. We can execute the pygn-mode-python-executable at 'python'

[x] Good. The pygn-mode-python-executable at 'python' is a Python 3 interpreter.

[x] Good. The pygn-mode-python-executable at 'python' is better than or equal to Python version 3.7.

[x] Good. The pygn-mode-python-executable at 'python' can import the Python chess library.

[ ] Bad. The pygn-mode-script-directory ('c:/Users/Alejandro/AppData/Roaming/.emacs.d/elpa/pygn-mode-20211021.2325/') is bad or does not contain working server script (pygn_server.py).
rolandwalker commented 2 years ago

Hi! This hasn't been tried on Windows yet, I think.

Are you able to evaluate

(call-process "python" nil nil nil "c:/Users/Alejandro/AppData/Roaming/.emacs.d/elpa/pygn-mode-20211021.2325/pygn_server.py" "-version")

using Meta-: ?

SequentialDesign commented 2 years ago

thanks for getting back to me.

I get 0 after evaluating that command.

I tried running the server by itself after commenting out signal.signal(signal.SIGPIPE, signal.SIG_DFL), and it worked. So then I tried running the diagnostic again, and the diagnostic was successful. but a board won't load when I middle-click, and the tree-sitter syntax highlight shows no color. so something is broken.

because I got rid of the original error, I'm going to close this issue. but something is wrong. I am not going to dwell on it because I use Emacs mainly on MacOS now, so this is only for academic purposes. Hopefully, it will work when I try it on MacOS.

rolandwalker commented 2 years ago

Thanks for the data points! I would love to get this running on Windows.

Note that after we finished porting the syntax highlight to tree-sitter, syntax highlight started woking perfectly but we also introduced bugs in the navigation commands.

Patches very welcome.

rolandwalker commented 2 years ago

Thanks for the data points! I would love to get this running on Windows.

Note that after we finished porting the syntax highlight to tree-sitter, syntax highlight started woking perfectly but we also introduced bugs in the navigation commands.

Patches very welcome.

On Windows, I think it needs, at minimum

    try:
        signal.signal(signal.SIGPIPE, signal.SIG_DFL)
    except:
        pass
SequentialDesign commented 2 years ago

great! I got the board to work by adding

    try:
        signal.signal(signal.SIGPIPE, signal.SIG_DFL)
    except:
        pass

after the commented out signal.signal(signal.SIGPIPE, signal.SIG_DFL) and adding C:\Users\Alejandro\AppData\Roaming\.emacs.d\elpa\pygn-mode-20211021.2325 to PATH. Middle-click now brings up a board. Very happy about that.

but now tree-sitter doesn't add any color to the notation. do I have to add the faces (colors) myself?

rolandwalker commented 2 years ago

Interesting. What happens when you place the point on a SAN move and do M-x describe-face RET ?