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

sage-shell-mode versus sage-view #28

Closed
DrWaleedAYousef opened this issue Nov 20, 2016 · 9 comments
Closed

sage-shell-mode versus sage-view #28

DrWaleedAYousef opened this issue Nov 20, 2016 · 9 comments

Comments

@DrWaleedAYousef
Copy link

Thanks for your great package;

For Sage 7.3 and lowever, I used to use sage-view which enabled me to do inline-graphics within emacs by adding these in .emacs :
(add-hook 'sage-startup-after-prompt-hook 'sage-view-enable-inline-output)
(add-hook 'sage-startup-after-prompt-hook 'sage-view-enable-inline-plots)

My questions:
1- Why a new package, i.e., sage-shell-mode and not elaborating on the existing one (sage-view)?
2- How can I do inline graphics in sage-shell-mode as it was in sage-view?
3- How can I do debugin for sage and python in emacs?

Thanks so much.

@stakemori
Copy link
Collaborator

1- Why a new package, i.e., sage-shell-mode and not elaborating on the existing one (sage-view)?

Because sage-view doesn't work with sage-shell-mode out of the box currently.

2- How can I do inline graphics in sage-shell-mode as it was in sage-view?

We have to make some effort to use sage-view in sage-shell-mode. This is related to #5. I will implement it in a month. Of course pull requests are very welcome.

3- How can I do debugin for sage and python in emacs?

For Python functions/methods, you can use pdb like in Sage in terminal. I think it is a little more convenient in Emacs because sage-shell-mode shows tracked files and lines.

@DrWaleedAYousef
Copy link
Author

thanks so much;

one more question: can we split a .sage file to cells like those in
Matlab (where each cell starts with %% and evaluates separately from the
whole file)

Thanks

Sho Takemori notifications@github.com writes:

1- Why a new package, i.e., sage-shell-mode and not elaborating on the existing one (sage-view)?

Because sage-view doesn't work with sage-shell-mode out of the box currently.

2- How can I do inline graphics in sage-shell-mode as it was in sage-view?

We have to make some effort to use sage-view in sage-shell-mode. This is related to #5. I will implement it in a month. Of course pull requests are very welcome.

3- How can I do debugin for sage and python in emacs?

For Python functions/methods, you can use pdb like in Sage in terminal. I think it is a little more convenient in Emacs because sage-shell-mode shows tracked files and
lines.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.*

@stakemori
Copy link
Collaborator

I don't know cells in Matlab very well, but code-blocks written by Johan Rosenkilde or ob-sagemath might be useful.

@stakemori
Copy link
Collaborator

I have just ported sage-view. You can enable sage-shell-view minor mode as follows.

(add-hook 'sage-shell-after-prompt-hook #'sage-shell-view)

And I close this issue because it is a duplicate of #5.

@DrWaleedAYousef
Copy link
Author

DrWaleedAYousef commented Dec 27, 2016 via email

@stakemori
Copy link
Collaborator

BTW, "show" launches jmol to play interactively with the figure. Can I
show inside emacs.

The method show for 3d graph objects launches jmol. They can be embedded inside Emacs by a_3d_graph_obj.show(viewer='tachyon').

For example, the following code shows a 2D graph inside Emacs.

sage: implicit_plot3d(x^2+y^2+z^2==4, (x, -3, 3), (y, -3,3), (z, -3,3)).show(viewer='tachyon')

Alternatively, you can change the viewer globally.

sage: sage.plot.plot3d.base.SHOW_DEFAULTS['viewer']  = 'tachyon'

See http://doc.sagemath.org/html/en/reference/plot3d/sage/plot/plot3d/base.html for detail.

@DrWaleedAYousef
Copy link
Author

DrWaleedAYousef commented Dec 28, 2016 via email

@stakemori
Copy link
Collaborator

I opened a Sage notebook with xwidget-webkit-browse-url. See the image below. I can rotate the sphere by mouse. Perhaps, by the xwidgets feature, it might be possible to embed the jmol viewer inside Emacs. But I'm not sure at the moment.

sage_notebook_in_emacs

@stakemori
Copy link
Collaborator

I opened a new issue (#29).

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

2 participants