ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sun, 01 Jul 2012 23:51:32 -0500sage-mode does not workhttp://ask.sagemath.org/question/9118/sage-mode-does-not-work/## 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
sage-mode-0.7
## Installation
On [sage-mode project page](http://wiki.sagemath.org/sage-mode?action=PackagePages) 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
"/home/maksim/Applications/sage/data/emacs"))
(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
`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.Thu, 28 Jun 2012 03:08:23 -0500http://ask.sagemath.org/question/9118/sage-mode-does-not-work/Answer by Ivan Andrus for <h2>System information</h2>
<p>64-bit Linux OS <br/>
GNU Emacs 24.1.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw scroll bars) of 2012-06-25 <br/>
sage-mode-0.7</p>
<h2>Installation</h2>
<p>On <a href="http://wiki.sagemath.org/sage-mode?action=PackagePages">sage-mode project page</a> it is said that sage-mode should be installed with the following command:</p>
<pre><code>sage -f sage-mode-0.7.spkg
</code></pre>
<p>This does not work though <code>sage-mode-0.6.spkg</code> can be installed this way without any problems.</p>
<p>In order to install this package I had to download it manually. Here is the correct installation command:</p>
<pre><code>sage -f ~/Downloads/sage-mode-0.7.spkg
</code></pre>
<p>I have put the following code into my <code>emacs.el</code>:</p>
<pre><code>(add-to-list 'load-path (expand-file-name
"/home/maksim/Applications/sage/data/emacs"))
(require 'sage "sage")
(setq sage-command "/home/maksim/Applications/sage/sage")
</code></pre>
<h2>Syntax highlighting</h2>
<p>Running <code>M-x sage-mode</code> in Emacs leads to the following error message:</p>
<pre><code>Symbol's value as variable is void: python-source-modes
</code></pre>
<p>though package <code>python</code> is a built-in one and works well.</p>
<p>In order to avoid this problem I have added the following code:</p>
<pre><code>(setq python-source-modes 'python-mode)
</code></pre>
<p>This made sage-mode work properly (at least syntax highlighting).</p>
<h2>run-sage</h2>
<p><code>run-sage</code> command does not work. It reports</p>
<pre><code>Symbol's value as variable is void: sage-buffer
</code></pre>
<p>Setting this variable to <code>nil</code> does not help:</p>
<pre><code>Symbol's function definition is void: python-args-to-list
</code></pre>
<p>The file <code>.../lisp/progmodes/python.el</code> in the Emacs distribution does contain this function.</p>
http://ask.sagemath.org/question/9118/sage-mode-does-not-work/?answer=13773#post-id-13773It 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](http://boxen.math.washington.edu/home/iandrus/sage_mode-0.8.spkg) with some support.
If you want to try and report any problems to [bitbucket](https://bitbucket.org/gvol/sage-mode) (or even better submit patches/pull requests), that would be great. You can comment on the [fgallina ticket](https://bitbucket.org/gvol/sage-mode/issue/1/support-pythonel-by-fgallina), or create new ones.Thu, 28 Jun 2012 11:01:03 -0500http://ask.sagemath.org/question/9118/sage-mode-does-not-work/?answer=13773#post-id-13773Comment by Ivan Andrus for <p>It sounds like (based on the <code>python-source-modes</code> error) you are using fgallina's new python.el. Sadly, <code>sage-mode</code> doesn't support that yet. I have an <a href="http://boxen.math.washington.edu/home/iandrus/sage_mode-0.8.spkg">experimental spkg</a> with some support.
If you want to try and report any problems to <a href="https://bitbucket.org/gvol/sage-mode">bitbucket</a> (or even better submit patches/pull requests), that would be great. You can comment on the <a href="https://bitbucket.org/gvol/sage-mode/issue/1/support-pythonel-by-fgallina">fgallina ticket</a>, or create new ones.</p>
http://ask.sagemath.org/question/9118/sage-mode-does-not-work/?comment=19475#post-id-19475SAGE_ROOT and SAGE_DATA should not be defined as environment variables outside of a running Sage. They are meant to be placeholders for you to fill in. I just uploaded a new 0.8 spkg. After you install it, it will say expand them for you in the console giving what you already put in your .emacs i.e. "/home/maksim/Applications/...".Fri, 29 Jun 2012 00:49:00 -0500http://ask.sagemath.org/question/9118/sage-mode-does-not-work/?comment=19475#post-id-19475Comment by kcrisman for <p>It sounds like (based on the <code>python-source-modes</code> error) you are using fgallina's new python.el. Sadly, <code>sage-mode</code> doesn't support that yet. I have an <a href="http://boxen.math.washington.edu/home/iandrus/sage_mode-0.8.spkg">experimental spkg</a> with some support.
If you want to try and report any problems to <a href="https://bitbucket.org/gvol/sage-mode">bitbucket</a> (or even better submit patches/pull requests), that would be great. You can comment on the <a href="https://bitbucket.org/gvol/sage-mode/issue/1/support-pythonel-by-fgallina">fgallina ticket</a>, or create new ones.</p>
http://ask.sagemath.org/question/9118/sage-mode-does-not-work/?comment=19483#post-id-19483Ok, I *thought* you were the maintainer. Can you update http://wiki.sagemath.org/sage-mode 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.Thu, 28 Jun 2012 11:28:30 -0500http://ask.sagemath.org/question/9118/sage-mode-does-not-work/?comment=19483#post-id-19483Comment by Maksim Zholudev for <p>It sounds like (based on the <code>python-source-modes</code> error) you are using fgallina's new python.el. Sadly, <code>sage-mode</code> doesn't support that yet. I have an <a href="http://boxen.math.washington.edu/home/iandrus/sage_mode-0.8.spkg">experimental spkg</a> with some support.
If you want to try and report any problems to <a href="https://bitbucket.org/gvol/sage-mode">bitbucket</a> (or even better submit patches/pull requests), that would be great. You can comment on the <a href="https://bitbucket.org/gvol/sage-mode/issue/1/support-pythonel-by-fgallina">fgallina ticket</a>, or create new ones.</p>
http://ask.sagemath.org/question/9118/sage-mode-does-not-work/?comment=19473#post-id-19473I have removed `sage/data/emacs` and installed `sage_mode-0.8.spkg`. There is no errors in `*Messages*` on Emacs startup. The only error is "`Symbol's value as variable is void: sage-buffer`" when I run `M-x run-sage`.Fri, 29 Jun 2012 02:17:46 -0500http://ask.sagemath.org/question/9118/sage-mode-does-not-work/?comment=19473#post-id-19473Comment by Maksim Zholudev for <p>It sounds like (based on the <code>python-source-modes</code> error) you are using fgallina's new python.el. Sadly, <code>sage-mode</code> doesn't support that yet. I have an <a href="http://boxen.math.washington.edu/home/iandrus/sage_mode-0.8.spkg">experimental spkg</a> with some support.
If you want to try and report any problems to <a href="https://bitbucket.org/gvol/sage-mode">bitbucket</a> (or even better submit patches/pull requests), that would be great. You can comment on the <a href="https://bitbucket.org/gvol/sage-mode/issue/1/support-pythonel-by-fgallina">fgallina ticket</a>, or create new ones.</p>
http://ask.sagemath.org/question/9118/sage-mode-does-not-work/?comment=19477#post-id-19477I 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).Thu, 28 Jun 2012 22:23:16 -0500http://ask.sagemath.org/question/9118/sage-mode-does-not-work/?comment=19477#post-id-19477Comment by Ivan Andrus for <p>It sounds like (based on the <code>python-source-modes</code> error) you are using fgallina's new python.el. Sadly, <code>sage-mode</code> doesn't support that yet. I have an <a href="http://boxen.math.washington.edu/home/iandrus/sage_mode-0.8.spkg">experimental spkg</a> with some support.
If you want to try and report any problems to <a href="https://bitbucket.org/gvol/sage-mode">bitbucket</a> (or even better submit patches/pull requests), that would be great. You can comment on the <a href="https://bitbucket.org/gvol/sage-mode/issue/1/support-pythonel-by-fgallina">fgallina ticket</a>, or create new ones.</p>
http://ask.sagemath.org/question/9118/sage-mode-does-not-work/?comment=19476#post-id-19476I've updated the wiki, and SPKG.txt.Fri, 29 Jun 2012 00:45:31 -0500http://ask.sagemath.org/question/9118/sage-mode-does-not-work/?comment=19476#post-id-19476Comment by Maksim Zholudev for <p>It sounds like (based on the <code>python-source-modes</code> error) you are using fgallina's new python.el. Sadly, <code>sage-mode</code> doesn't support that yet. I have an <a href="http://boxen.math.washington.edu/home/iandrus/sage_mode-0.8.spkg">experimental spkg</a> with some support.
If you want to try and report any problems to <a href="https://bitbucket.org/gvol/sage-mode">bitbucket</a> (or even better submit patches/pull requests), that would be great. You can comment on the <a href="https://bitbucket.org/gvol/sage-mode/issue/1/support-pythonel-by-fgallina">fgallina ticket</a>, or create new ones.</p>
http://ask.sagemath.org/question/9118/sage-mode-does-not-work/?comment=19478#post-id-19478New 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.Thu, 28 Jun 2012 22:04:33 -0500http://ask.sagemath.org/question/9118/sage-mode-does-not-work/?comment=19478#post-id-19478Comment by Maksim Zholudev for <p>It sounds like (based on the <code>python-source-modes</code> error) you are using fgallina's new python.el. Sadly, <code>sage-mode</code> doesn't support that yet. I have an <a href="http://boxen.math.washington.edu/home/iandrus/sage_mode-0.8.spkg">experimental spkg</a> with some support.
If you want to try and report any problems to <a href="https://bitbucket.org/gvol/sage-mode">bitbucket</a> (or even better submit patches/pull requests), that would be great. You can comment on the <a href="https://bitbucket.org/gvol/sage-mode/issue/1/support-pythonel-by-fgallina">fgallina ticket</a>, or create new ones.</p>
http://ask.sagemath.org/question/9118/sage-mode-does-not-work/?comment=19479#post-id-19479New 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).Thu, 28 Jun 2012 22:00:54 -0500http://ask.sagemath.org/question/9118/sage-mode-does-not-work/?comment=19479#post-id-19479Comment by Maksim Zholudev for <p>It sounds like (based on the <code>python-source-modes</code> error) you are using fgallina's new python.el. Sadly, <code>sage-mode</code> doesn't support that yet. I have an <a href="http://boxen.math.washington.edu/home/iandrus/sage_mode-0.8.spkg">experimental spkg</a> with some support.
If you want to try and report any problems to <a href="https://bitbucket.org/gvol/sage-mode">bitbucket</a> (or even better submit patches/pull requests), that would be great. You can comment on the <a href="https://bitbucket.org/gvol/sage-mode/issue/1/support-pythonel-by-fgallina">fgallina ticket</a>, or create new ones.</p>
http://ask.sagemath.org/question/9118/sage-mode-does-not-work/?comment=19470#post-id-19470There is no errors but "variable is void: sage-buffer". Even if `sage-mode` is not loaded, it contains the `run-sage` function which calls `sage-new-sage-p` function which causes the error.Fri, 29 Jun 2012 03:14:58 -0500http://ask.sagemath.org/question/9118/sage-mode-does-not-work/?comment=19470#post-id-19470Comment by Maksim Zholudev for <p>It sounds like (based on the <code>python-source-modes</code> error) you are using fgallina's new python.el. Sadly, <code>sage-mode</code> doesn't support that yet. I have an <a href="http://boxen.math.washington.edu/home/iandrus/sage_mode-0.8.spkg">experimental spkg</a> with some support.
If you want to try and report any problems to <a href="https://bitbucket.org/gvol/sage-mode">bitbucket</a> (or even better submit patches/pull requests), that would be great. You can comment on the <a href="https://bitbucket.org/gvol/sage-mode/issue/1/support-pythonel-by-fgallina">fgallina ticket</a>, or create new ones.</p>
http://ask.sagemath.org/question/9118/sage-mode-does-not-work/?comment=19472#post-id-19472It looks like error is caused by `(null sage-buffer)` operator at line 560 in `sage-mode.el`. If `sage-buffer` is not defined at all then `null` fails.
[https://bitbucket.org/gvol/sage-mode/issue/7/sage-buffer-variable-is-void]Fri, 29 Jun 2012 02:57:45 -0500http://ask.sagemath.org/question/9118/sage-mode-does-not-work/?comment=19472#post-id-19472Comment by Ivan Andrus for <p>It sounds like (based on the <code>python-source-modes</code> error) you are using fgallina's new python.el. Sadly, <code>sage-mode</code> doesn't support that yet. I have an <a href="http://boxen.math.washington.edu/home/iandrus/sage_mode-0.8.spkg">experimental spkg</a> with some support.
If you want to try and report any problems to <a href="https://bitbucket.org/gvol/sage-mode">bitbucket</a> (or even better submit patches/pull requests), that would be great. You can comment on the <a href="https://bitbucket.org/gvol/sage-mode/issue/1/support-pythonel-by-fgallina">fgallina ticket</a>, or create new ones.</p>
http://ask.sagemath.org/question/9118/sage-mode-does-not-work/?comment=19471#post-id-19471What about errors after `run-sage`? The file `sage-mode` is not actually loaded at startup.Fri, 29 Jun 2012 03:10:03 -0500http://ask.sagemath.org/question/9118/sage-mode-does-not-work/?comment=19471#post-id-19471Comment by Ivan Andrus for <p>It sounds like (based on the <code>python-source-modes</code> error) you are using fgallina's new python.el. Sadly, <code>sage-mode</code> doesn't support that yet. I have an <a href="http://boxen.math.washington.edu/home/iandrus/sage_mode-0.8.spkg">experimental spkg</a> with some support.
If you want to try and report any problems to <a href="https://bitbucket.org/gvol/sage-mode">bitbucket</a> (or even better submit patches/pull requests), that would be great. You can comment on the <a href="https://bitbucket.org/gvol/sage-mode/issue/1/support-pythonel-by-fgallina">fgallina ticket</a>, or create new ones.</p>
http://ask.sagemath.org/question/9118/sage-mode-does-not-work/?comment=19474#post-id-19474If sage-mode is properly installed then `sage-buffer` should definitely be defined! Are there any errors in the `*Messages*` buffer (accessible with C-h e)?Fri, 29 Jun 2012 00:51:29 -0500http://ask.sagemath.org/question/9118/sage-mode-does-not-work/?comment=19474#post-id-19474Answer by kcrisman for <h2>System information</h2>
<p>64-bit Linux OS <br/>
GNU Emacs 24.1.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw scroll bars) of 2012-06-25 <br/>
sage-mode-0.7</p>
<h2>Installation</h2>
<p>On <a href="http://wiki.sagemath.org/sage-mode?action=PackagePages">sage-mode project page</a> it is said that sage-mode should be installed with the following command:</p>
<pre><code>sage -f sage-mode-0.7.spkg
</code></pre>
<p>This does not work though <code>sage-mode-0.6.spkg</code> can be installed this way without any problems.</p>
<p>In order to install this package I had to download it manually. Here is the correct installation command:</p>
<pre><code>sage -f ~/Downloads/sage-mode-0.7.spkg
</code></pre>
<p>I have put the following code into my <code>emacs.el</code>:</p>
<pre><code>(add-to-list 'load-path (expand-file-name
"/home/maksim/Applications/sage/data/emacs"))
(require 'sage "sage")
(setq sage-command "/home/maksim/Applications/sage/sage")
</code></pre>
<h2>Syntax highlighting</h2>
<p>Running <code>M-x sage-mode</code> in Emacs leads to the following error message:</p>
<pre><code>Symbol's value as variable is void: python-source-modes
</code></pre>
<p>though package <code>python</code> is a built-in one and works well.</p>
<p>In order to avoid this problem I have added the following code:</p>
<pre><code>(setq python-source-modes 'python-mode)
</code></pre>
<p>This made sage-mode work properly (at least syntax highlighting).</p>
<h2>run-sage</h2>
<p><code>run-sage</code> command does not work. It reports</p>
<pre><code>Symbol's value as variable is void: sage-buffer
</code></pre>
<p>Setting this variable to <code>nil</code> does not help:</p>
<pre><code>Symbol's function definition is void: python-args-to-list
</code></pre>
<p>The file <code>.../lisp/progmodes/python.el</code> in the Emacs distribution does contain this function.</p>
http://ask.sagemath.org/question/9118/sage-mode-does-not-work/?answer=13766#post-id-13766I can't help with the rest, but the "current" Sage-mode is still 0.6, as listed at [the list of optional spkgs](http://sagemath.org/packages/optional/). 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](http://trac.sagemath.org/sage_trac/ticket/13176) for upgrading the optional spkg to this.Thu, 28 Jun 2012 03:34:13 -0500http://ask.sagemath.org/question/9118/sage-mode-does-not-work/?answer=13766#post-id-13766Comment by kcrisman for <p>I can't help with the rest, but the "current" Sage-mode is still 0.6, as listed at <a href="http://sagemath.org/packages/optional/">the list of optional spkgs</a>. That is what this will do without a URL.</p>
<p>But if you specify a URL for <code>sage -f http://url/for/sage-mode-0.7.spkg</code>, that should work fine. I've opened <a href="http://trac.sagemath.org/sage_trac/ticket/13176">Trac 13176</a> for upgrading the optional spkg to this.</p>
http://ask.sagemath.org/question/9118/sage-mode-does-not-work/?comment=19486#post-id-19486You mean no difference in the other problems? Unfortunately, I can't help with those :( but I'll note them at the relevant ticket.Thu, 28 Jun 2012 04:04:56 -0500http://ask.sagemath.org/question/9118/sage-mode-does-not-work/?comment=19486#post-id-19486Comment by Maksim Zholudev for <p>I can't help with the rest, but the "current" Sage-mode is still 0.6, as listed at <a href="http://sagemath.org/packages/optional/">the list of optional spkgs</a>. That is what this will do without a URL.</p>
<p>But if you specify a URL for <code>sage -f http://url/for/sage-mode-0.7.spkg</code>, that should work fine. I've opened <a href="http://trac.sagemath.org/sage_trac/ticket/13176">Trac 13176</a> for upgrading the optional spkg to this.</p>
http://ask.sagemath.org/question/9118/sage-mode-does-not-work/?comment=19487#post-id-19487I have also tried 0.6 and saw no differenceThu, 28 Jun 2012 03:49:45 -0500http://ask.sagemath.org/question/9118/sage-mode-does-not-work/?comment=19487#post-id-19487Answer by Maksim Zholudev for <h2>System information</h2>
<p>64-bit Linux OS <br/>
GNU Emacs 24.1.1 (x86_64-unknown-linux-gnu, X toolkit, Xaw scroll bars) of 2012-06-25 <br/>
sage-mode-0.7</p>
<h2>Installation</h2>
<p>On <a href="http://wiki.sagemath.org/sage-mode?action=PackagePages">sage-mode project page</a> it is said that sage-mode should be installed with the following command:</p>
<pre><code>sage -f sage-mode-0.7.spkg
</code></pre>
<p>This does not work though <code>sage-mode-0.6.spkg</code> can be installed this way without any problems.</p>
<p>In order to install this package I had to download it manually. Here is the correct installation command:</p>
<pre><code>sage -f ~/Downloads/sage-mode-0.7.spkg
</code></pre>
<p>I have put the following code into my <code>emacs.el</code>:</p>
<pre><code>(add-to-list 'load-path (expand-file-name
"/home/maksim/Applications/sage/data/emacs"))
(require 'sage "sage")
(setq sage-command "/home/maksim/Applications/sage/sage")
</code></pre>
<h2>Syntax highlighting</h2>
<p>Running <code>M-x sage-mode</code> in Emacs leads to the following error message:</p>
<pre><code>Symbol's value as variable is void: python-source-modes
</code></pre>
<p>though package <code>python</code> is a built-in one and works well.</p>
<p>In order to avoid this problem I have added the following code:</p>
<pre><code>(setq python-source-modes 'python-mode)
</code></pre>
<p>This made sage-mode work properly (at least syntax highlighting).</p>
<h2>run-sage</h2>
<p><code>run-sage</code> command does not work. It reports</p>
<pre><code>Symbol's value as variable is void: sage-buffer
</code></pre>
<p>Setting this variable to <code>nil</code> does not help:</p>
<pre><code>Symbol's function definition is void: python-args-to-list
</code></pre>
<p>The file <code>.../lisp/progmodes/python.el</code> in the Emacs distribution does contain this function.</p>
http://ask.sagemath.org/question/9118/sage-mode-does-not-work/?answer=13772#post-id-13772Ergoemacs 1.9.3.1 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`.Sun, 01 Jul 2012 23:51:32 -0500http://ask.sagemath.org/question/9118/sage-mode-does-not-work/?answer=13772#post-id-13772