gcv / julia-snail

An Emacs development environment for Julia
GNU General Public License v3.0
236 stars 23 forks source link

julia-snail-doc-lookup: show documentation in the REPL or parse it as markdown? #24

Closed christopher-dG closed 4 years ago

christopher-dG commented 4 years ago

When I use C-c C-d, the documentation appears in a separate window with no formatting, meaning that the markdown that most docstrings are written with doesn't look too great. Could we either:

gcv commented 4 years ago

I'm personally not a fan of the @doc <symbol> command in the Julia REPL, since I always find myself fighting the pager. But I'm open to enabling that way of looking at the documentation with a prefix arg for anyone who prefers it.

With regard to rendering the markdown, what about this: if the user has markdown-mode installed, then documentation buffers will turn it on and enable its markdown-hide-markup option? It's not perfect, but easy to do and much better than the current fundamental-mode ugliness.

christopher-dG commented 4 years ago

I like the markdown-mode solution. I didn't know about the markup hiding feature! That would make it more than sufficient to me.

orialb commented 4 years ago

If we are already discussing enhancements for julia-snail-doc-lookup, what do you think about making the buffer where documentation is presented a help buffer so one can easily close it by pressing q ?

gcv commented 4 years ago

julia-snail-doc-lookup opens in its buffers in julia-snail-message-buffer-mode, which binds q to quit-window. Does that not work for you? I'm reluctant to pull in help-mode, since it seems more geared towards Texinfo and integration into the Emacs help system than ad-hoc Markdown.

The Markdown rendering feature is implemented in 4544723, and should now be in MELPA. Let me know what you think.

christopher-dG commented 4 years ago

q work for me to close the doc window. I'm loving the markdown mode, thanks!

orialb commented 4 years ago

julia-snail-doc-lookup opens in its buffers in julia-snail-message-buffer-mode, which binds q to quit-window. Does that not work for you?

Oh, I did not realize that this is the case. I didn't have this binding because I'm using evil-mode so probably I will need to override some evil bindings in julia-snail-message-buffer-mode in my personal config. I'll be more careful next time before commenting about keybindings and look at the source code first :)

Anyway, the markdown looks very nice indeed! Thanks!