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

add racket-pcomplete #90

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

add racket-pcomplete #90

wants to merge 2 commits into from

Conversation

zwild
Copy link

@zwild zwild commented Feb 10, 2015

When you use eshell-mode or shell-mode as your main shell, racket and raco command completion is convenient. Emacs use pcomplete for command completion, so I add this.

For now, I just add pcomplete/raco. If you think the code should be merged, I will add pcomplete/racket.

@greghendershott
Copy link
Owner

Thank you very much for this pull request. I like the idea of providing shell completion.

Before I merge, may I ask about another idea, how to do this?

It would be elegant to discover all the raco commands and their options, programmatically. That way, as users install more tools, and/or the tools add more options, it would be correct automatically (compared to updating the static list).

How to find the tools? It looks like the following returns a list of information about all installed tools:

(require raco/all-tools)
(all-tools)

How about the command-line options for each tool? This is trickier. Two ideas:

  1. Probably most tools use the command-line form. It might not be too difficult to find that in the tool's source? (Weak point: Not all tools use command-line at all. Some use it only via some fancy macros, which I think is the case for raco pkg.)
  2. Run the tools with the -h flag and parse the text output. Weak point: Parsing text is a bit kludgy. Good point: It works for all tools that provide help. If they use command-line, the help format is very consistent.

However. Maybe I'm over-thinking this. If you think this idea is too complicated or too difficult, then I should simply merge the PR as-is. :)

@zwild
Copy link
Author

zwild commented Feb 13, 2015

Hi.
Thanks your advices.
I came to racket recently, and I can't get the big picture of racket now. For me now, it's not convenient to type in eshell when there is no completion.
I will make the code better when I get family with it.

@greghendershott greghendershott self-assigned this Feb 13, 2015
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

Successfully merging this pull request may close these issues.

2 participants