Ask Your Question

sage-mode does not work

asked 2012-06-28 10:08:23 +0200

Maksim Zholudev gravatar image

updated 2012-06-28 10:48:17 +0200

System information

64-bit Linux OS
GNU Emacs 24.1.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw scroll bars) of 2012-06-25


On sage-mode project page it is said that sage-mode should be installed with the following command:

sage -f sage-mode-0.7.spkg

This does not work though sage-mode-0.6.spkg can be installed this way without any problems.

In order to install this package I had to download it manually. Here is the correct installation command:

sage -f ~/Downloads/sage-mode-0.7.spkg

I have put the following code into my emacs.el:

(add-to-list 'load-path (expand-file-name
(require 'sage "sage")
(setq sage-command "/home/maksim/Applications/sage/sage")

Syntax highlighting

Running M-x sage-mode in Emacs leads to the following error message:

Symbol's value as variable is void: python-source-modes

though package python is a built-in one and works well.

In order to avoid this problem I have added the following code:

(setq python-source-modes 'python-mode)

This made sage-mode work properly (at least syntax highlighting).


run-sage command does not work. It reports

Symbol's value as variable is void: sage-buffer

Setting this variable to nil does not help:

Symbol's function definition is void: python-args-to-list

The file .../lisp/progmodes/python.el in the Emacs distribution does contain this function.

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2012-07-02 06:51:32 +0200

Maksim Zholudev gravatar image

Ergoemacs changes load-path variable and makes Emacs load some packages from wrong place, i.e. ergoemacs_1.9.3.1/packages.

Ergoemacs contains old version of python-related modules. The problem can be solved by [re]moving some files from ergoemacs_1.9.3.1/packages directory. For this particular issue they are python.el, python.elc, python-mode.el and python-mode.elc.

edit flag offensive delete link more

answered 2012-06-28 10:34:13 +0200

kcrisman gravatar image

updated 2012-06-28 11:03:59 +0200

I can't help with the rest, but the "current" Sage-mode is still 0.6, as listed at the list of optional spkgs. That is what this will do without a URL.

But if you specify a URL for sage -f http://url/for/sage-mode-0.7.spkg, that should work fine. I've opened Trac 13176 for upgrading the optional spkg to this.

edit flag offensive delete link more


I have also tried 0.6 and saw no difference

Maksim Zholudev gravatar imageMaksim Zholudev ( 2012-06-28 10:49:45 +0200 )edit

You mean no difference in the other problems? Unfortunately, I can't help with those :( but I'll note them at the relevant ticket.

kcrisman gravatar imagekcrisman ( 2012-06-28 11:04:56 +0200 )edit

answered 2012-06-28 18:01:03 +0200

Ivan Andrus gravatar image

It sounds like (based on the python-source-modes error) you are using fgallina's new python.el. Sadly, sage-mode doesn't support that yet. I have an experimental spkg with some support. If you want to try and report any problems to bitbucket (or even better submit patches/pull requests), that would be great. You can comment on the fgallina ticket, or create new ones.

edit flag offensive delete link more


Ok, I *thought* you were the maintainer. Can you update accordingly? I guess just updating the contact, bitbucket link (in the sense that yours is now the "official" repository) and maybe making sure to continue to attach old versions there, if we deem that useful. Otherwise people will keep contacting Nick.

kcrisman gravatar imagekcrisman ( 2012-06-28 18:28:30 +0200 )edit

New version is hard to install if Sage was installed as normal user. SAGE_ROOT and SAGE_DATA are not defined (incorrect Sage installation?) and one have to set them for the user and also for root (the installation script requires root privileges to do something with Python).

Maksim Zholudev gravatar imageMaksim Zholudev ( 2012-06-29 05:00:54 +0200 )edit

New version does not have `python-source-modes` problem but still reports about undefined `sage-buffer` variable after `M-x run-sage`. Setting `sage-buffer` to nil lets me run Sage but it reports "`Symbol's function definition is void: python-send-string`". The buffer with Sage appears but I can not type anything there.

Maksim Zholudev gravatar imageMaksim Zholudev ( 2012-06-29 05:04:33 +0200 )edit

I can move cursor in that buffer. When I try to type numbers there is no response. Attempt to type letters make Emacs behave like I do something wrong (e.g. move up when at the top of buffer).

Maksim Zholudev gravatar imageMaksim Zholudev ( 2012-06-29 05:23:16 +0200 )edit

I've updated the wiki, and SPKG.txt.

Ivan Andrus gravatar imageIvan Andrus ( 2012-06-29 07:45:31 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2012-06-28 10:08:23 +0200

Seen: 901 times

Last updated: Jul 02 '12