# Can't get sage-mode to load with emacs 24.2.1

Apologies for a rather newbie question, but I'm just getting started with Sage. I'd like to be able to use it in my favorite editor -- emacs. Sage seems to work just fine; I'm using it from the command line with no problems. But when I attempt to use sage-mode in emacs, I get this error at startup:

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

A little history to show how I got here/replication:

2. From within sage, did: install_package('sage-mode').

3. Appeared that sage-mode 0.7 was installed.

4. Started emacs, got this error: "Unknown button type help-xref'"

5. Looking at threads, saw it might be a problem solved in the new "experimental" version of sage-mode 0.8. (threads: https://groups.google.com/forum/?from...)

6. From command line, did: sage -i http://boxen.math.washington.edu/home...

My .init file has:

(add-to-list 'load-path  "/Applications/sage/local/share/emacs")
(require 'sage "sage")
(setq sage-command "/Applications/sage/sage")


I've tried a number of things at the command-line level (symbolic link to sage file, editing PATH, editing the SAGE_ROOT directory, etc), but nothing seems to get me past the current error.

Any help is greatly appreciated.

edit retag close merge delete

I've had the problem at 4 before. Haven't tried using v0.8. I usually just comment the "offending" line. It is located in \$SAGE_ROOT/local/share/emacs/sage-mode.el it is line 1161. So change it from :supertype 'help-xref to ;;:supertype 'help-xref

( 2013-02-03 17:57:10 +0200 )edit

Just installed sage_mode-0.8 and it works fine. In [this question](http://ask.sagemath.org/question/1567/sage-mode-does-not-work) (last answer) it is mentioned that Ergoemacs gets on the way when loading some packages. Perhaps this applies to your emacs configuration?

( 2013-02-03 18:27:22 +0200 )edit

Sort by » oldest newest most voted

Are you sure that's all that's in your .emacs? Please check to see if you are referencing sage-command before you (require 'sage "sage"). Does the problem go away if you comment out the require? Another thing you might trying is completely deleting /Applications/sage/local/share/emacs and reinstalling. You can also run emacs --debug-init` to see where exactly the error is occurring.

Please let me know what the problem was so that I can fix it if I need to (e.g. deleting the directory first). Also, feel free to open a ticket on bitbucket for this or any other issue.

There is also a new version sage_mode-0.9. Unfortunately, I'm having a difficult time getting it reviewed to upgrade the spkg so that's it installed by default.

more