https://www.gnu.org/software/emacs/images/emacs.png

Sage and Emacs

The purpose of this page is to collect tips and tricks for Sage users and developers using the text editor Emacs as an IDE.

sage-shell-mode

sage-shell-mode is the recommended mode for Sage in Emacs. This mode provides two features:

1. Run a Sage shell inside Emacs, fully equipped with command history, completion, dynamic help and opening of source files, etc.

2. A major mode for .sage files along with functionality for sending chunks of code to a running Sage shell.

sage-shell-mode allows extensions for auto-complete, helm, anything, and embedding in org-mode. It was written from scratch by Sho Takemori.

sage-shell-mode is most easily installed using the Emacs package manager MELPA. Alternatively, go to the GitHub page.

See: SageModeComparison, https://github.com/stakemori/sage-shell-mode

emacs-jupyter

- See 2020 blog post: Martin Albrecht: Conda, Jupyter and Emacs

EIN: IPython notebook client in Emacs

https://github.com/tkf/emacs-ipython-notebook

This is currently non functional due to an incompatibility with the ipython shipped with Sage. Yet this sounds promising. See:

- https://github.com/tkf/emacs-ipython-notebook/issues/131 - https://github.com/sagemath/sage/issues/16053

Sage-mode

Note: sage-mode works only for Sage 7.3 and earlier.

This emacs mode allows for running a Sage interpreter inside emacs, and interacting with it sending in chunks of code or doctests, directly opening the appropriate source files from the help, the debugger or the tracebacks. It also provides goodies for running tests, typesetting output, etc.

See: SageModeComparison, sage-mode, http://bitbucket.org/gvol/sage-mode

Miscellaneous

.dir-locals.el, to use spaces instead of tabs. To avoid introducing trailing whitespace, see https://www.emacswiki.org/emacs/DeletingWhitespace for various solutions.

See also

- 2010 blog post on customizing emacs for Python

Emacs (last edited 2023-02-23 20:10:56 by mkoeppe)