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

Jump to a specific node from command line? #63

Open
jcguu95 opened this issue May 23, 2022 · 6 comments
Open

Jump to a specific node from command line? #63

jcguu95 opened this issue May 23, 2022 · 6 comments

Comments

@jcguu95
Copy link

jcguu95 commented May 23, 2022

Question

Is it possible to jump to a specific node of an sgf file from
command line. Of course, a domain specific language for
specifying a node is required, or we may use regex matching to
find the nodes with comments. For example,

$> q5go --load "game.sgf" --node "E5[1]"

Usage

This will be useful because people can then take notes
for GO easily. For example, in org-mode (a la emacs) one can
custimize link protocols as follows.

* Lesson 1: Vital points

A Vital Point is an important shape point for both players, e.g.

+ [[go:~/game.sgf:E5[1]]]

The [[..]] would be turned into a link, which is then bound to
the command (non-existent?) above.

Related

@bernds
Copy link
Owner

bernds commented May 26, 2022

Hmm. The obvious problem is that there might be more than one move at E5, either because of captures or in variations. A simple solution might be to allow a "jump to move N in the main line" option.

On the other hand, the idea of having an SGF editor is to edit Go positions and diagrams directly rather than using emacs. It might be more productive to discuss what you feel is missing and why you'd want to go into emacs instead.

@jcguu95
Copy link
Author

jcguu95 commented May 26, 2022

A more sophisticated domain specific language can resolve the first issue.. e.g. E5[1] means the first node where E5 occurs, and E5[G7][1] could mean the first occurence of E5 in the branch spit from G7.. etc.

I used emacs just as an example. In general, we can drop some links as comments in sgf files, and ask the links to bring us to certain nodes while being clicked. Of course, we don't want to be limited within the single editor, and a way to resolve it is to have the editors be able to be controlled through command lines (e.g. treating the running sgf editors as servers).

@bernds
Copy link
Owner

bernds commented May 26, 2022

So the idea is to link to other nodes in the same sgf file? I think it would be best if multiple sgf editors would just support that in the same way. The idea of doing this with command lines sounds really clunky to me.

@Trevoke
Copy link
Contributor

Trevoke commented May 30, 2022

OP has a good idea (I am also an emacs and org-mode user) but I think "jump to move N in main line" is probably the simpler, most straightforward option to ask q5go to implement (e.g. OGS has something similar, follow this link to get to the ear-reddening move: https://online-go.com/game/33720239/127 )

The idea of treating SGF editors as servers and clicking on links to follow them to specific nodes is interesting but unfortunately the SGF standard doesn't make a ton of room for this as-is; it might be worth bringing this up to the SGF format maintainers / people working on SGF version 5.

In general, anything that one editor does, specific to that editor, is bad for the go community -- e.g. OGS does not handle "adding stones" the correct way, so it can't parse some SGF files correctly, and as of the time of writing it doesn't handle the X marking correctly either... And its freeform drawing is very nice but it can't be stored effectively in SGF because other editors can't handle this, either.

So, if we want to improve the SGF standard, we should do that :D

@jcguu95
Copy link
Author

jcguu95 commented May 31, 2022

Thanks @Trevoke for your idea. However, I think the data in sgf is enough for us to specify a certain node already, so this can be done without asking the upstream of sgf development. And I'm pretty sure q5go has the ability to jump to a specific node. I just need to know how to do it via commands, not GUI interactions.

@Trevoke
Copy link
Contributor

Trevoke commented May 31, 2022 via email

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

3 participants