Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Described *1-*3,*e in repl-welcome #1310

Merged
merged 1 commit into from Oct 4, 2013

Conversation

3 participants
Contributor

jakubholynet commented Aug 24, 2013

I have learned only by chance about the fact that REPL stores evaluation results in *1 - *3 and the last exception in *e. I am certainly not the only one unaware of this so it would be good to include it in the welcome message.

(For random visitors: they are defined in clojure's ./src/clj/clojure/main.clj.)

Jakub Holy Described *1-*3,*e in repl-welcome
I have learned only by chance about the fact that REPL stores evaluation results in *1 - *3 and the last exception in *e. I am certainly not the only one unaware of this so it would be good to include it in the welcome message.

(For random visitors: they are defined in clojure's [`./src/clj/clojure/main.clj`](https://github.com/clojure/clojure/blob/master/src/clj/clojure/main.clj).)
ac36df6
Collaborator

hyPiRion commented Aug 26, 2013

Hey, (sorry for not chiming in earlier)

My 2 cents: I think this sounds like a reasonable thing to add in. But adding more than this (after it has been merged in) would make the REPL welcome message a bit large.

Owner

technomancy commented Aug 26, 2013

Thanks for submitting this. We've actually been intending to include a more comprehensive repl help, but we were blocked for a while on trptcolin/reply#114. But now that's been fixed, so we should give that another go instead of showing this every time the repl starts up.

Contributor

jakubholynet commented Aug 27, 2013

Great! I am looking forward to that.

Owner

technomancy commented Aug 27, 2013

I'm not sure when I'd get around to doing this, but I'd be happy to take a pull request for it if you want to see it happen sooner.

Contributor

jakubholynet commented Aug 29, 2013

I'd be happy to implement it but am not sure how, could you point me in the right direction?

Contributor

jakubholynet commented Aug 29, 2013

I.e. I suppose that the solution is to supply REPLy with Leiningen-specific help function upon start and to modify the welcome message be removing everything from it and just mentioning that people can run (user/help) to learn more, right?

I suppose that to https://github.com/technomancy/leiningen/blob/master/src/leiningen/repl.clj#L58 I'd need to add :custom help (list 'println (slurp (io/resource "repl-help")))
where custom-help would be a new file with more info than custom-repl. Is that corect?

Collaborator

hyPiRion commented Aug 29, 2013

@jakubholynet That's almost right: The :welcome keyword is renamed to :custom-help, which is always printed on startup. The most "elegant" way to solve this, as far as I know, is by having :custom-init make a form which redefines user/help at startup. Add the following line into ~/.lein/profiles.clj, in your :user: profile, to see the effect:

:repl-options {:custom-init (defn help [] (println "Here's the helper fn."))}

Whenever you now call (help), you should see the changes.

We're doing initialization directly in nREPL, so using :custom-init shouldn't affect the :init option in :repl-options at all.

Not sure if there are better ways to handle that, @trptcolin may have some thoughts on it.

Owner

technomancy commented Sep 10, 2013

Hrm; for some reason I thought reply already supported a help message that isn't shown on repl startup, but it looks like that's not the case. Redefining it in :custom-init might not be the best because IIRC it's not guaranteed to be run in the user namespace. But I could be wrong about that.

Owner

technomancy commented Oct 4, 2013

Sorry for spiralling this out of control; we'll go ahead and merge this and maybe come back to a split help message later.

@technomancy technomancy added a commit that referenced this pull request Oct 4, 2013

@technomancy technomancy Merge pull request #1310 from jakubholynet/patch-1
Described *1-*3,*e in repl-welcome
4d3c46d

@technomancy technomancy merged commit 4d3c46d into technomancy:master Oct 4, 2013

1 check passed

default The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment