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
added chef-shell prompt to inf-ruby-prompt-format #108
Conversation
inf-ruby.el
Outdated
(concat | ||
(mapconcat | ||
#'identity | ||
'("\\(^%s> *\\)" ; Simple | ||
"\\(^chef ([\\.[:digit:]]+)> *\\)" ; Chef Shell: e.g. "chef (13.2.20)> " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does the Chef console prompt look in two cases:
- Right after start
- When you input
2 +
and pressRET
?
[startup]
Ohai2u @chef-node!
chef (13.2.20)>
[line continuation]
Ohai2u @chef-node!
chef (13.2.20)> 2 +
chef > |<- cursor is here
|
And when you finish the expression by typing |
Correct.
|
In that case, its scheme doesn't fit inf-ruby's assumptions about the prompt's behavior. You should probably change |
|
Understood.. this snippet seems to do the trick
|
If both regexps are the same, you won't get protection against completion messing up with the input in the continuation lines, and the "get old input" commands won't be able to fetch multiline inputs (the ones interspersed with continuation prompts). |
Also: you never need to quote a lambda form. |
Thanks for the tips. I tried the following:
However, not sure if I got it right, since I don't get autocomplete working at the second level prompt..
|
That's intentional and a good thing: code completion is implemented by evaluating strings in the same process, and if the REPL has already been sent an incomplete expression, completion will both fail to work and mess up said expression. That's what I meant by "messing up with the input" in a comment above. |
Ok.. so I guess I will close this PR. If you like, I can add a note to the documentation about this approach for those that might be wondering the same as I did. |
Yeah, that sounds like a good idea. |
I've added a comment blurb, and removed the defvar commit (using a rebase that hopefully didn't screw anything up). |
Thanks. I think I'd rather have it in the wiki, though. Along with an explanation why the two prompts regexps should not be the same. The README would have a link to it, under a heading |
Sure.. however I don't see anything yet in the wiki: https://github.com/nonsequitur/inf-ruby/wiki Let me know if there is anything I can help with, or whether you'd rather add it. Fine either way - and thanks for the helpful comments. My elisp is better from having gotten into this discussion. |
Yes, please go ahead. I can edit the result after. And no problem! |
I've added to the wiki and edited the README. |
I don't see the suggested heading in the README. Nor this:
I'd also prefer a dedicated wiki page rather that putting in at Home. |
Made some edits.. please review and edit if needed |
Looks better, thanks. Now waiting for the requested change in the README addition (also, please drop one of the empty lines). |
Not sure what blank line you're referring to. Anyhow, the heading change is in. |
The second of the two empty lines at the end of your diff hunk. But never mind that now. Thanks for the wiki page. |
Also changed to defvar instead of defconst, for easier customization.