Sage: Ticket #21227: sage-mode broken in Sage 7.4. sage-shell-mode is the future?
https://trac.sagemath.org/ticket/21227
<p>
On sage 7.4 beta0, emacs GNU Emacs 24.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.7) of 2014-03-07 on lamiak, modified by Debian, beloved sage_mode 0.14 is broken. All in and output except the banner is unreadable!
</p>
<pre class="wiki">┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 7.4.beta0, Release Date: 2016-08-10 │
│ Type "notebook()" for the browser-based notebook interface. │
│ Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Warning: this is a prerelease version, and it may be unstable. ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
[?12l [?25h1+1
[J [?7h [?12l [?25h [?2004l [?7h2
[?12l [?25h
</pre>en-usSagehttps://trac.sagemath.org/chrome/site/logo_sagemath_trac.png
https://trac.sagemath.org/ticket/21227
Trac 1.1.6mantepseThu, 11 Aug 2016 21:49:39 GMT
https://trac.sagemath.org/ticket/21227#comment:1
https://trac.sagemath.org/ticket/21227#comment:1
<p>
Leif mentioned on sage-devel:
</p>
<pre class="wiki">3) Probably disable the color mode.
</pre><p>
I'm not sure what he means with that, but just typing <code></code><code>%colors NoColor</code><code></code> after the weird sage prompt doesn't help.
</p>
TicketleifThu, 11 Aug 2016 22:15:47 GMT
https://trac.sagemath.org/ticket/21227#comment:2
https://trac.sagemath.org/ticket/21227#comment:2
<p>
You may play with (settings in)
</p>
<pre class="wiki">sage: %config SageTerminalInteractiveShell
</pre>
TicketleifThu, 11 Aug 2016 22:17:54 GMT
https://trac.sagemath.org/ticket/21227#comment:3
https://trac.sagemath.org/ticket/21227#comment:3
<p>
(Sage 7.4.beta0 upgraded IPython to 5.0, see <a class="closed ticket" href="https://trac.sagemath.org/ticket/21006" title="enhancement: Upgrade to IPython 5.0 (closed: fixed)">#21006</a>.)
</p>
TicketjsrnSun, 14 Aug 2016 17:50:23 GMTcc changed
https://trac.sagemath.org/ticket/21227#comment:4
https://trac.sagemath.org/ticket/21227#comment:4
<ul>
<li><strong>cc</strong>
<em>jsrn</em> added
</li>
</ul>
TicketmkoeppeThu, 18 Aug 2016 19:50:13 GMTcc changed
https://trac.sagemath.org/ticket/21227#comment:5
https://trac.sagemath.org/ticket/21227#comment:5
<ul>
<li><strong>cc</strong>
<em>vbraun</em> added
</li>
</ul>
<p>
Here's a simple change that enables "simple prompts" when sage is run within an Emacs inferior shell.
However, as has been noted <a class="ext-link" href="http://emacs.stackexchange.com/questions/24453/weird-shell-output-when-using-ipython-5"><span class="icon"></span>here</a>, the "simple prompts" mode lacks multi-line support, so one gets this:
</p>
<pre class="wiki">In [1]: def f(x):
File "<ipython-input-1-cde3fd95d55b>", line 1
def f(x):
^
SyntaxError: unexpected EOF while parsing
</pre><div class="wiki-code"><div xmlns="http://www.w3.org/1999/xhtml" class="diff">
<ul class="entries">
<li class="entry">
<h2>
<a>src/sage/repl/interpreter.py</a>
</h2>
<pre>diff --git a/src/sage/repl/interpreter.py b/src/sage/repl/interpreter.py
index 1f4eda7..1d69829 100644</pre>
<table class="trac-diff inline" summary="Differences" cellspacing="0">
<colgroup><col class="lineno" /><col class="lineno" /><col class="content" /></colgroup>
<thead>
<tr>
<th title="File a/src/sage/repl/interpreter.py">
a
</th>
<th title="File b/src/sage/repl/interpreter.py">
b
</th>
<td><em> class SageTerminalInteractiveShell(SageShellOverride, TerminalInteractiveShell):</em> </td>
</tr>
</thead>
<tbody class="unmod">
<tr>
<th>248</th><th>248</th><td class="l"><span> <sage.repl.interpreter.SageNotebookInteractiveShell object at 0x...></span></td>
</tr><tr>
<th>249</th><th>249</th><td class="l"><span> """</span></td>
</tr><tr>
<th>250</th><th>250</th><td class="l"><span></span></td>
</tr>
</tbody><tbody class="add">
<tr class="first">
<th> </th><th>251</th><td class="r"><ins> def init_prompt_toolkit_cli(self):</ins></td>
</tr><tr>
<th> </th><th>252</th><td class="r"><ins> """</ins></td>
</tr><tr>
<th> </th><th>253</th><td class="r"><ins> Use plain non-interactive output if TERM=dumb (as in an Emacs inferior shell)</ins></td>
</tr><tr>
<th> </th><th>254</th><td class="r"><ins> """</ins></td>
</tr><tr>
<th> </th><th>255</th><td class="r"><ins> if os.environ['TERM'] == 'dumb':</ins></td>
</tr><tr>
<th> </th><th>256</th><td class="r"><ins> self.simple_prompt = True</ins></td>
</tr><tr>
<th> </th><th>257</th><td class="r"><ins> return super(SageTerminalInteractiveShell, self).init_prompt_toolkit_cli()</ins></td>
</tr><tr class="last">
<th> </th><th>258</th><td class="r"><ins></ins></td>
</tr>
</tbody><tbody class="unmod">
<tr>
<th>251</th><th>259</th><td class="l"><span> def init_display_formatter(self):</span></td>
</tr><tr>
<th>252</th><th>260</th><td class="l"><span> """</span></td>
</tr><tr>
<th>253</th><th>261</th><td class="l"><span> Switch to the Sage IPython commandline rich output backend</span></td>
</tr>
</tbody>
</table>
</li>
</ul>
</div></div>
TicketmantepseThu, 18 Aug 2016 20:12:04 GMT
https://trac.sagemath.org/ticket/21227#comment:6
https://trac.sagemath.org/ticket/21227#comment:6
<p>
Thank you for this! At least I can work again!
</p>
TicketmkoeppeThu, 18 Aug 2016 20:59:06 GMTbranch set
https://trac.sagemath.org/ticket/21227#comment:7
https://trac.sagemath.org/ticket/21227#comment:7
<ul>
<li><strong>branch</strong>
set to <em>u/mkoeppe/sage_mode_for_emacs_has_display_problem_in_sage_7_4_beta0</em>
</li>
</ul>
TicketmkoeppeThu, 18 Aug 2016 21:32:48 GMTupstream changed; commit set
https://trac.sagemath.org/ticket/21227#comment:8
https://trac.sagemath.org/ticket/21227#comment:8
<ul>
<li><strong>commit</strong>
set to <em>92378caa0c1a030b9399e889f42edb5afc8c6d87</em>
</li>
<li><strong>upstream</strong>
changed from <em>N/A</em> to <em>Reported upstream. No feedback yet.</em>
</li>
</ul>
<p>
I've opened an IPython issue for this:
<a class="ext-link" href="https://github.com/ipython/ipython/issues/9886"><span class="icon"></span>https://github.com/ipython/ipython/issues/9886</a>
</p>
<hr />
<p>
New commits:
</p>
<table class="wiki">
<tr><td><a class="ext-link" href="https://git.sagemath.org/sage.git/commit?id=92378caa0c1a030b9399e889f42edb5afc8c6d87"><span class="icon"></span>92378ca</a></td><td><code>Fix for sage shell with TERM=dumb</code>
</td></tr></table>
TicketmkoeppeThu, 18 Aug 2016 21:35:18 GMTcc changed
https://trac.sagemath.org/ticket/21227#comment:9
https://trac.sagemath.org/ticket/21227#comment:9
<ul>
<li><strong>cc</strong>
<em>dimpase</em> <em>fbissey</em> added
</li>
</ul>
TicketcharpentMon, 22 Aug 2016 15:07:58 GMTcc changed
https://trac.sagemath.org/ticket/21227#comment:10
https://trac.sagemath.org/ticket/21227#comment:10
<ul>
<li><strong>cc</strong>
<em>charpent</em> added
</li>
</ul>
TicketcharpentMon, 22 Aug 2016 15:47:00 GMT
https://trac.sagemath.org/ticket/21227#comment:11
https://trac.sagemath.org/ticket/21227#comment:11
<p>
A few remarks :
</p>
<ul><li>The <a class="ext-link" href="https://git.sagemath.org/sage.git/commit?id=92378caa0c1a030b9399e889f42edb5afc8c6d87"><span class="icon"></span>current patch</a> waits endlessly for a prompt.
</li><li>When interrupted (C-G), it gives a functional prompt : the Sage REPL is working.
</li><li>When inline plots are enabled, they are displayed, but the sustems claims (falsely) to have launced a png viewer.
</li><li>When tyepeset output is enabled in the menu, the output is displayed as text :
<pre class="wiki">In [24]: integrate(arctan(x),x)
BEGIN_TEXT:x*arctan(x) - 1/2*log(x^2 + 1):END_TEXT
BEGIN_LATEX:\newcommand{\Bold}[1]{\mathbf{#1}}x \arctan\left(x\right) - \frac{1}{2} \, \log\left(x^{2} + 1\right):END_LATEX
</pre></li><li>Ditto when using the <code>%display typeset</code> magic...
</li></ul><p>
<em>"Oooohhh, so clooose..."</em>
</p>
<p>
HTH,
</p>
TicketmantepseTue, 30 Aug 2016 07:33:51 GMTpriority changed
https://trac.sagemath.org/ticket/21227#comment:12
https://trac.sagemath.org/ticket/21227#comment:12
<ul>
<li><strong>priority</strong>
changed from <em>major</em> to <em>blocker</em>
</li>
</ul>
<p>
I'm making this a blocker, because without fix sage would loose a frontend which is used by not so few. I also tried the ipython 5.0 branch of <a class="ext-link" href="https://github.com/stakemori/sage-shell-mode"><span class="icon"></span>https://github.com/stakemori/sage-shell-mode</a>, but could not (yet) get it to work. (Install went OK, but I cannot even evaluate 1+1.)
</p>
TicketmantepseTue, 30 Aug 2016 10:52:50 GMTsummary changed
https://trac.sagemath.org/ticket/21227#comment:13
https://trac.sagemath.org/ticket/21227#comment:13
<ul>
<li><strong>summary</strong>
changed from <em>sage_mode for emacs has display problem in sage 7.4 beta0</em> to <em>No emacs interface anymore in sage 7.4 beta0: both sage_mode and sage-shell-mode broken</em>
</li>
</ul>
TicketstakemoriTue, 06 Sep 2016 22:54:20 GMT
https://trac.sagemath.org/ticket/21227#comment:14
https://trac.sagemath.org/ticket/21227#comment:14
<p>
I've pushed fixes to the master branch of sage-shell-mode. sage-shell-mode was fixed. To use sage-shell-mode with Sage7.4 beta0, please set <code>sage-shell:use-prompt-toolkit</code> to <code>t</code>.
</p>
<p>
As for the patch, could you use an environment variable other than <code>TERM</code>? (IPython uses <code>IPY_TEST_SIMPLE_PROMPT</code> for the same purpose). If this is merged, <code>sage-shell-mode</code> is forced to use the simple prompt. And I don't want to use the simple prompt inside Emacs.
</p>
<p>
I think sage-mode (or inferior-python-mode) has to implement its own process filter function to fix this bug (without using simple prompt). IPython sends escape sequences that delete text or move the cursor position. So just ignoring escape sequences doesn't work. <code>comint-mode</code> cannot handle escape sequences well, but <code>term-mode</code> can handle them very well. So I imitated <code>term-mode</code>.
</p>
TicketstakemoriTue, 06 Sep 2016 23:02:14 GMTcc changed
https://trac.sagemath.org/ticket/21227#comment:15
https://trac.sagemath.org/ticket/21227#comment:15
<ul>
<li><strong>cc</strong>
<em>stakemori</em> added
</li>
</ul>
TicketmkoeppeTue, 06 Sep 2016 23:03:45 GMT
https://trac.sagemath.org/ticket/21227#comment:16
https://trac.sagemath.org/ticket/21227#comment:16
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/21227#comment:14" title="Comment 14">stakemori</a>:
</p>
<blockquote class="citation">
<p>
I've pushed fixes to the master branch of sage-shell-mode. sage-shell-mode was fixed. To use sage-shell-mode with Sage7.4 beta0, please set <code>sage-shell:use-prompt-toolkit</code> to <code>t</code>.
</p>
<p>
As for the patch, could you use an environment variable other than <code>TERM</code>? (IPython uses <code>IPY_TEST_SIMPLE_PROMPT</code> for the same purpose). If this is merged, <code>sage-shell-mode</code> is forced to use the simple prompt. And I don't want to use the simple prompt inside Emacs.
</p>
<p>
I think sage-mode (or inferior-python-mode) has to implement its own process filter function to fix this bug (without using simple prompt). IPython sends escape sequences that delete text or move the cursor position. So just ignoring escape sequences doesn't work. <code>comint-mode</code> cannot handle escape sequences well, but <code>term-mode</code> can handle them very well. So I imitated <code>term-mode</code>.
</p>
</blockquote>
<p>
Well, term-mode does not set <code>TERM=dumb</code>. It sets <code>TERM=eterm-color</code>. So?
</p>
TicketstakemoriTue, 06 Sep 2016 23:19:17 GMT
https://trac.sagemath.org/ticket/21227#comment:17
https://trac.sagemath.org/ticket/21227#comment:17
<p>
Sorry. I don't understand your question. What I meant is that the process filter function in <code>term-mode</code> (<code>term-emulate-terminal</code>) handles escape sequences very well. <code>sage-shell-mode</code> is also derived from <code>comint-mode</code>.
</p>
TicketmkoeppeTue, 06 Sep 2016 23:30:34 GMT
https://trac.sagemath.org/ticket/21227#comment:18
https://trac.sagemath.org/ticket/21227#comment:18
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/21227#comment:17" title="Comment 17">stakemori</a>:
</p>
<blockquote class="citation">
<p>
Sorry. I don't understand your question. What I meant is that the process filter function in <code>term-mode</code> (<code>term-emulate-terminal</code>) handles escape sequences very well. <code>sage-shell-mode</code> is also derived from <code>comint-mode</code>.
</p>
</blockquote>
<p>
What I'm saying is that:
</p>
<ul><li>term-mode sets <code>TERM=eterm-color</code> and so, even with the patch on this ticket, no "simple prompts" are used.
</li><li><code>comint-mode</code> does not handle escape sequences. Therefore it sets <code>TERM=dumb</code> to inform the applications running under it about this fact.
</li><li>If your mode, derived from <code>comint-mode</code>, handles escape sequences, then it should not be using <code>TERM=dumb</code> but rather something else; perhaps <code>TERM=vt100</code>.
</li></ul>
TicketstakemoriTue, 06 Sep 2016 23:40:43 GMT
https://trac.sagemath.org/ticket/21227#comment:19
https://trac.sagemath.org/ticket/21227#comment:19
<p>
Thanks for your explanation. I will change it to other than <code>dumb</code>.
</p>
TicketmkoeppeTue, 06 Sep 2016 23:49:10 GMT
https://trac.sagemath.org/ticket/21227#comment:20
https://trac.sagemath.org/ticket/21227#comment:20
<p>
Unfortunately IPython/Prompt Toolkit don't handle the TERM variable. I've just reported another upstream issue here (in addition to the IPython one, which so far has been ignored): <a class="ext-link" href="https://github.com/jonathanslenders/python-prompt-toolkit/issues/390"><span class="icon"></span>https://github.com/jonathanslenders/python-prompt-toolkit/issues/390</a>
</p>
TicketmantepseWed, 07 Sep 2016 07:17:59 GMT
https://trac.sagemath.org/ticket/21227#comment:21
https://trac.sagemath.org/ticket/21227#comment:21
<p>
I am so grateful that you are working on this! I'm documenting here how it went, following <code>Installation and Setup</code> in <code>README.org</code>:
</p>
<ol><li>perfect
</li><li>perfect
</li><li><code>set sage-shell:use-prompt-toolkit to non-nil</code> I wanted to use customize, but it complains:
<pre class="wiki">Creating customization items...
widget-apply: Symbol's function definition is void: nil
</pre></li><li>doing <code>M-x sage-shell:run-sage</code> I get <code>sage-shell:-window-max-chars-per-line: Wrong number of arguments: window-body-width, 2</code>
</li></ol>
TicketstakemoriWed, 07 Sep 2016 07:51:40 GMT
https://trac.sagemath.org/ticket/21227#comment:22
https://trac.sagemath.org/ticket/21227#comment:22
<p>
Thanks. I've pushed fix to master. But it will take a few hours for Melpa to rebuild the recipe.
As for 3, please put <code>(setq sage-shell:use-prompt-toolkit t)</code> in your configuration file.
</p>
<p>
According to the error message, it seems that you are using Emacs older than 24.4. Please use Emacs 24.4 or later.
</p>
TicketmantepseWed, 07 Sep 2016 08:03:45 GMT
https://trac.sagemath.org/ticket/21227#comment:23
https://trac.sagemath.org/ticket/21227#comment:23
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/21227#comment:22" title="Comment 22">stakemori</a>:
</p>
<blockquote class="citation">
<p>
Thanks. I've pushed fix to master. But it will take a few hours for Melpa to rebuild the recipe.
As for 3, please put <code>(setq sage-shell:use-prompt-toolkit t)</code> in your configuration file.
</p>
<p>
According to the error message, it seems that you are using Emacs older than 24.4. Please use Emacs 24.4 or later.
</p>
</blockquote>
<p>
Indeed, 24.3.1...
</p>
<p>
I'm a bit afraid of upgrading, but I guess I'll do it :-)
</p>
TicketmantepseWed, 07 Sep 2016 13:17:55 GMT
https://trac.sagemath.org/ticket/21227#comment:24
https://trac.sagemath.org/ticket/21227#comment:24
<p>
I did it (not quite sure yet whether I like Ubuntu 16.04...)
</p>
<p>
Anyway: <code>M-x sage-shell:run-sage</code> starts sage and I can evaluate stuff.
</p>
<ul><li>I have no tab-completion (the modeline says: "No match")
</li><li>sending a buffer to the <code>*sage*</code> buffer breaks emacs <code>(Error running timer: (wrong-type-argument bufferp nil)</code> occupies the modeline and won't go away anymore.
</li></ul><p>
thanks for helping!
</p>
TicketstakemoriWed, 07 Sep 2016 15:06:04 GMT
https://trac.sagemath.org/ticket/21227#comment:25
https://trac.sagemath.org/ticket/21227#comment:25
<p>
<code>tab-completion</code> and sending buffer work for me (<a class="ext-link" href="http://i.imgur.com/LL6vm3b.png"><span class="icon"></span>http://i.imgur.com/LL6vm3b.png</a>). I am not sure why such an error occurs.
</p>
TicketstakemoriWed, 07 Sep 2016 15:36:02 GMT
https://trac.sagemath.org/ticket/21227#comment:26
https://trac.sagemath.org/ticket/21227#comment:26
<p>
Can you reproduce this even if only <code>sage-shell-mode</code> is loaded? If so, could you tell me the Emacs version and a recipe for reproducing?
</p>
TicketmantepseWed, 07 Sep 2016 15:46:42 GMT
https://trac.sagemath.org/ticket/21227#comment:27
https://trac.sagemath.org/ticket/21227#comment:27
<p>
I am using sage 7.4.beta1 with the patch on this ticket applied, emacs is 24.5.1. Running <code>emacs -q</code> and then in <code>*scratch*</code>:
</p>
<pre class="wiki">(require 'package)
package
(add-to-list 'package-archives
'("melpa" . "https://melpa.org/packages/"))
(("melpa" . "https://melpa.org/packages/") ("gnu" . "http://elpa.gnu.org/packages/"))
(package-initialize)
t
(setq sage-shell:use-prompt-toolkit 'T)
T
(setq sage-shell:sage-root "~/SAGE")
"~/SAGE"
</pre><p>
and finally
</p>
<pre class="wiki">M-x sage-shell:run-sage
</pre><p>
gives
</p>
<pre class="wiki">┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 7.4.beta1, Release Date: 2016-08-17 │
│ Type "notebook()" for the browser-based notebook interface. │
│ Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Warning: this is a prerelease version, and it may be unstable. ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
In [1]: 12.is
</pre><p>
but no tab-completion.
</p>
TicketstakemoriWed, 07 Sep 2016 22:03:52 GMT
https://trac.sagemath.org/ticket/21227#comment:28
https://trac.sagemath.org/ticket/21227#comment:28
<p>
Thanks. I have not implemented the simple prompts feature. So <code>sage-shell-mode</code> does not work well with the patch. The latest <code>sage-shell-mode</code> in MELPA sets <code>TERM</code> to <code>emacs</code>. Please upgrade <code>sage-shell-mode</code> by <code>M-x package-list-packages</code>, <code>U</code> and <code>x</code>. The problem still persists?
</p>
TicketstakemoriWed, 07 Sep 2016 23:44:59 GMT
https://trac.sagemath.org/ticket/21227#comment:29
https://trac.sagemath.org/ticket/21227#comment:29
<p>
It seems that <code>sage-shell-mode</code> must set <code>TERM</code> to <code>dumb</code>. <code>sage-shell-mode</code> is not a full terminal emulator. It can handle a part of escape sequences but not all. Also it doesn't handle pager. I set <code>TERM</code> to <code>emacs</code>, but the <code>clear</code> command shows an error message. Again, could you use an environment variable other than <code>TERM</code> in the patch?
</p>
TicketmantepseThu, 08 Sep 2016 04:29:29 GMT
https://trac.sagemath.org/ticket/21227#comment:30
https://trac.sagemath.org/ticket/21227#comment:30
<p>
I'm confused now. Is <code>sage-shell-mode</code> working on your computer without the patch in this ticket? (I thought that "simple prompts" is not a feature, but a workaround.)
</p>
TicketstakemoriThu, 08 Sep 2016 04:43:05 GMT
https://trac.sagemath.org/ticket/21227#comment:31
https://trac.sagemath.org/ticket/21227#comment:31
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/21227#comment:30" title="Comment 30">mantepse</a>:
</p>
<blockquote class="citation">
<p>
I'm confused now. Is <code>sage-shell-mode</code> working on your computer without the patch in this ticket? (I thought that "simple prompts" is not a feature, but a workaround.)
</p>
</blockquote>
<p>
Yes. So <code>sage-shell-mode</code> support multi-line input (though there exits a minor issue. See <a class="ext-link" href="https://github.com/stakemori/sage-shell-mode/issues/7"><span class="icon"></span>https://github.com/stakemori/sage-shell-mode/issues/7</a>).
</p>
<p>
<code>sage-shell-mode</code> can handle a part of escape sequences related to text modification and cursor movement. If <code>sage-shell:use-prompt-toolkit</code> is non-nil, then I assume Sage is not using <code>simple prompt</code> or <code>GNU readline</code>. I will also support <code>simple prompt</code> in future.
</p>
TicketmantepseThu, 08 Sep 2016 06:55:37 GMT
https://trac.sagemath.org/ticket/21227#comment:32
https://trac.sagemath.org/ticket/21227#comment:32
<p>
Wow! I think you are getting very close!
</p>
<ul><li>tab completion works
</li><li>sending a buffer with <code>C-c C-c</code> to the sage buffer works, also loading a file with <code>C-c C-l</code> works.
</li></ul><p>
A little suggestion: if the current buffer is a visited file in sage mode, it would be nice to have <code>C-c C-c</code> load the file instead, asking whether to save the buffer if necessary. Because:
</p>
<pre class="wiki">sage: load('/tmp/sage_shell_mode17030j9Q/sage_shell_mode_temp.sage')
</pre><p>
doesn't give me a clue which file I actually loaded!
</p>
<ul><li>unfortunately, sending a line to sage does not work correctly:
<pre class="wiki">sage: load('/tmp/sage_shell_mode17030j9Q/sage_shell_mode_temp.py')
File "/tmp/sage_shell_mode17030j9Q/sage_shell_mode_temp.py", line 3
sage: fricas('3 * 5') # optional - fricas
^
SyntaxError: invalid syntax
</pre></li></ul><p>
I think it doesn't strip the "sage:" anymore - was this done by ipython before?
</p>
TicketstakemoriThu, 08 Sep 2016 07:22:35 GMT
https://trac.sagemath.org/ticket/21227#comment:33
https://trac.sagemath.org/ticket/21227#comment:33
<p>
Thank you for trying.
</p>
<p>
To fix this issue, I had to changed basic functions of this mode. So there may be such problems. Sorry.
</p>
<blockquote class="citation">
<p>
unfortunately, sending a line to sage does not work correctly:
</p>
</blockquote>
<p>
<code>M-x sage-shell-edit:send-line*</code> doesn't work? If it works, I will replace the command.
</p>
<blockquote class="citation">
<p>
A little suggestion: if the current buffer is a visited file in sage mode, it would be nice to have C-c C-c load the file instead, asking whether to save the buffer if necessary.
</p>
</blockquote>
<p>
Thank you for the suggestion. I will consider about it.
</p>
TicketmantepseThu, 08 Sep 2016 07:37:09 GMT
https://trac.sagemath.org/ticket/21227#comment:34
https://trac.sagemath.org/ticket/21227#comment:34
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/21227#comment:33" title="Comment 33">stakemori</a>:
</p>
<blockquote class="citation">
<p>
Thank you for trying.
</p>
<p>
To fix this issue, I had to changed basic functions of this mode. So there may be such problems. Sorry.
</p>
</blockquote>
<p>
Hey, your work is fantastic! I have no idea what I would have done without you!
</p>
<blockquote class="citation">
<blockquote class="citation">
<p>
unfortunately, sending a line to sage does not work correctly:
</p>
</blockquote>
<p>
<code>M-x sage-shell-edit:send-line*</code> doesn't work? If it works, I will replace the command.
</p>
</blockquote>
<p>
Great! <code>M-x sage-shell-edit:send-line*</code> (with the asterisk!) does the right thing!
</p>
TicketstakemoriThu, 08 Sep 2016 08:00:20 GMT
https://trac.sagemath.org/ticket/21227#comment:35
https://trac.sagemath.org/ticket/21227#comment:35
<blockquote class="citation">
<p>
Hey, your work is fantastic! I have no idea what I would have done without you!
</p>
</blockquote>
<p>
Thank you very much! I am very glad that <code>sage-shell-mode</code> works on your computer.
</p>
<p>
By the way, it would be great if I (or someone) could write a process filter function for <code>sage-mode</code> (or <code>python-mode</code>) that handles escape sequence. In future, I may write one (but to be honest, I do not want to fix this twice. It was harder than I thought).
</p>
TicketmantepseThu, 08 Sep 2016 08:16:01 GMT
https://trac.sagemath.org/ticket/21227#comment:36
https://trac.sagemath.org/ticket/21227#comment:36
<p>
why would you want to handle escape sequences?
</p>
TicketjsrnThu, 08 Sep 2016 08:40:31 GMT
https://trac.sagemath.org/ticket/21227#comment:37
https://trac.sagemath.org/ticket/21227#comment:37
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/21227#comment:35" title="Comment 35">stakemori</a>:
</p>
<blockquote class="citation">
<p>
By the way, it would be great if I (or someone) could write a process filter function for <code>sage-mode</code> (or <code>python-mode</code>) that handles escape sequence. In future, I may write one (but to be honest, I do not want to fix this twice. It was harder than I thought).
</p>
</blockquote>
<p>
I'm currently a <code>sage-mode</code> user and would be interested in getting it to work again. But my knowledge of terminals and the details of <code>comint-mode</code> is not very extensive, and I've lost track of what changes were necessary to make <code>sage-shell-mode</code> work again. How difficult would you estimate porting your fixes would be?
</p>
<p>
But perhaps rather: should we take this as a cue to merge the efforts of <code>sage-shell-mode</code> and <code>sage-mode</code>; after all, they're trying to do more or less the same. The current maintainer of <code>sage-mode</code> is Ivan Andrus but my impression is that he is really only maintaining - not developing. <code>sage-shell-mode</code> is much more vibrant in comparison! My impression is that <code>sage-shell-mode</code> currently does completion better than <code>sage-mode</code>, but <code>sage-mode</code> can render latex and images. There might also be small differences in how editing directly in the shell works?
</p>
<p>
My own contributions to <code>sage-mode</code> are modest: I've written the current help file/landing page, I wrote a small set of functions, <code>sage-blocks.el</code>, for giving light-weight notebook-like editing, and I've helped report and track down some bugs. Rather than porting fixes to <code>sage-mode</code>, I would be interested in trying out <code>sage-shell-mode</code> and lending a hand on implementing the features that would make it a great alternative for current <code>sage-mode</code> users. I'm also an <code>eVil</code>-user, so I would naturally be testing/modding <code>sage-shell-mode</code> to work under those conditions.
</p>
<p>
Best,
Johan
</p>
TicketstakemoriThu, 08 Sep 2016 11:32:25 GMT
https://trac.sagemath.org/ticket/21227#comment:38
https://trac.sagemath.org/ticket/21227#comment:38
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/21227#comment:36" title="Comment 36">mantepse</a>:
</p>
<blockquote class="citation">
<p>
why would you want to handle escape sequences?
</p>
</blockquote>
<p>
I don't want to handle escape sequences if possible. But developers of IPython choose <code>prompt_toolkit</code> rather than <code>readline</code> and <code>prompt_toolkit</code> uses a lot of escape sequences. Therefore I think <code>sage-shell-mode</code> should handle them. And I don't want to use the simple prompt workaround at the moment.
</p>
TicketstakemoriThu, 08 Sep 2016 11:38:40 GMT
https://trac.sagemath.org/ticket/21227#comment:39
https://trac.sagemath.org/ticket/21227#comment:39
<blockquote class="citation">
<p>
I'm currently a sage-mode user and would be interested in getting it to work again. But my knowledge of terminals and the details of comint-mode is not very extensive, and I've lost track of what changes were necessary to make sage-shell-mode work again. How difficult would you estimate porting your fixes would be?
</p>
</blockquote>
<p>
If you use the simple prompt workaround, then I guess it would be easy to fix <code>sage-mode</code>. But you might lose some features because of the workaround (Above, charpent remarked that
</p>
<blockquote>
<p>
"When inline plots are enabled, they are displayed, but the sustems claims (falsely) to have launced a png viewer."
</p>
</blockquote>
<p>
I am not sure if it is because of the workaround).
</p>
<p>
If you don't use the workaround, then it would be not so easy to fix it. Most important point is to implement a process filter function. <code>comint-output-filter</code> doesn't work. If you want to implement it, you could copy code in <code>sage-shell-mode</code> and I could help you.
</p>
<blockquote class="citation">
<p>
But perhaps rather: should we take this as a cue to merge the efforts of sage-shell-mode and sage-mode; after all, they're trying to do more or less the same. The current maintainer of sage-mode is Ivan Andrus but my impression is that he is really only maintaining - not developing. sage-shell-mode is much more vibrant in comparison! My impression is that sage-shell-mode currently does completion better than sage-mode, but sage-mode can render latex and images. There might also be small differences in how editing directly in the shell works?
</p>
</blockquote>
<p>
I am OK with merging. I would be glad if <code>sage-shell-mode</code> could render latex and images. I have exchanged email with Ivan Andrus a few years ago. He was also writing about merging. I guess he also might agree with merging.
</p>
<p>
I do not understand <code>sage-blocks.el</code> very well. Is it similar to ob-sagemath (<a class="ext-link" href="https://github.com/stakemori/ob-sagemath"><span class="icon"></span>https://github.com/stakemori/ob-sagemath</a>)? And I would be very happy if you contributed to <code>sage-shell-mode</code>.
</p>
TicketjsrnThu, 08 Sep 2016 13:08:21 GMT
https://trac.sagemath.org/ticket/21227#comment:40
https://trac.sagemath.org/ticket/21227#comment:40
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/21227#comment:39" title="Comment 39">stakemori</a>:
</p>
<blockquote class="citation">
<p>
If you don't use the workaround, then it would be not so easy to fix it. Most important point is to implement a process filter function. <code>comint-output-filter</code> doesn't work. If you want to implement it, you could copy code in <code>sage-shell-mode</code> and I could help you.
</p>
</blockquote>
<p>
OK, thanks. I'll first try to see if <code>sage-shell-mode</code> could be a replacement for me.
</p>
<blockquote class="citation">
<p>
I am OK with merging. I would be glad if <code>sage-shell-mode</code> could render latex and images. I have exchanged email with Ivan Andrus a few years ago. He was also writing about merging. I guess he also might agree with merging.
</p>
</blockquote>
<p>
OK.
</p>
<blockquote class="citation">
<p>
I do not understand <code>sage-blocks.el</code> very well. Is it similar to ob-sagemath (<a class="ext-link" href="https://github.com/stakemori/ob-sagemath"><span class="icon"></span>https://github.com/stakemori/ob-sagemath</a>)?
</p>
</blockquote>
<p>
It's much simpler than that: it simply assumes that the user has logically separated his source file using markers (<code>###</code> by default), each of which we call a "block". Then there are keybindings for dealing with these: moving up/down block-wise and sending the current block to the shell. This is extremely handy for the way I develop Sage. It's so simple that it would be easy to port to <code>sage-shell-mode</code>, I'm sure.
</p>
<blockquote class="citation">
<p>
And I would be very happy if you contributed to <code>sage-shell-mode</code>.
</p>
</blockquote>
<p>
As a first approximation, I've cloned <code>sage-shell-mode</code> and I'm trying it out. As you've already seen I'll post Issues when I hit funky behaviour ;-)
</p>
<p>
Thanks for your hard work on this!
</p>
<p>
Best,
Johan
</p>
TicketmantepseThu, 08 Sep 2016 15:40:43 GMT
https://trac.sagemath.org/ticket/21227#comment:41
https://trac.sagemath.org/ticket/21227#comment:41
<blockquote class="citation">
<blockquote class="citation">
<p>
unfortunately, sending a line to sage does not work correctly:
</p>
</blockquote>
<p>
<code>M-x sage-shell-edit:send-line*</code> doesn't work? If it works, I will replace the command.
</p>
</blockquote>
<p>
That would be great!
</p>
<p>
Another tiny problem: saying
</p>
<pre class="wiki">(sage-shell:define-alias)
</pre><p>
in <code>.emacs</code> doesn't work - must it be in <code>.emacs.d/init.el</code>?
</p>
<pre class="wiki">Warning (initialization): An error occurred while loading `/home/martin/.emacs':
Symbol's function definition is void: sage-shell:define-alias
</pre>
TicketmkoeppeThu, 08 Sep 2016 17:08:56 GMT
https://trac.sagemath.org/ticket/21227#comment:42
https://trac.sagemath.org/ticket/21227#comment:42
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/21227#comment:29" title="Comment 29">stakemori</a>:
</p>
<blockquote class="citation">
<p>
It seems that <code>sage-shell-mode</code> must set <code>TERM</code> to <code>dumb</code>. <code>sage-shell-mode</code> is not a full terminal emulator. It can handle a part of escape sequences but not all. Also it doesn't handle pager. I set <code>TERM</code> to <code>emacs</code>, but the <code>clear</code> command shows an error message. Again, could you use an environment variable other than <code>TERM</code> in the patch?
</p>
</blockquote>
<p>
But I don't have control over the environment variables that are set within a <code>M-x shell</code> in emacs.
</p>
TicketmkoeppeThu, 08 Sep 2016 17:30:53 GMT
https://trac.sagemath.org/ticket/21227#comment:43
https://trac.sagemath.org/ticket/21227#comment:43
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/21227#comment:42" title="Comment 42">mkoeppe</a>:
</p>
<blockquote class="citation">
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/21227#comment:29" title="Comment 29">stakemori</a>:
</p>
<blockquote class="citation">
<p>
It seems that <code>sage-shell-mode</code> must set <code>TERM</code> to <code>dumb</code>. <code>sage-shell-mode</code> is not a full terminal emulator. It can handle a part of escape sequences but not all. Also it doesn't handle pager. I set <code>TERM</code> to <code>emacs</code>, but the <code>clear</code> command shows an error message. Again, could you use an environment variable other than <code>TERM</code> in the patch?
</p>
</blockquote>
<p>
But I don't have control over the environment variables that are set within a <code>M-x shell</code> in emacs.
</p>
</blockquote>
<p>
Here's a reference that may be helpful in choosing the right TERM that reflects what you implemented. <a class="ext-link" href="http://invisible-island.net/ncurses/terminfo.src.html"><span class="icon"></span>http://invisible-island.net/ncurses/terminfo.src.html</a>
</p>
TicketstakemoriThu, 08 Sep 2016 23:35:07 GMT
https://trac.sagemath.org/ticket/21227#comment:44
https://trac.sagemath.org/ticket/21227#comment:44
<blockquote class="citation">
<p>
It's much simpler than that: it simply assumes that the user has logically separated his source file using markers (### by default), each of which we call a "block". Then there are keybindings for dealing with these: moving up/down block-wise and sending the current block to the shell. This is extremely handy for the way I develop Sage. It's so simple that it would be easy to port to sage-shell-mode, I'm sure.
</p>
</blockquote>
<p>
Thank you for explanation. It looks very convenient.
</p>
TicketstakemoriThu, 08 Sep 2016 23:41:42 GMT
https://trac.sagemath.org/ticket/21227#comment:45
https://trac.sagemath.org/ticket/21227#comment:45
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/21227#comment:41" title="Comment 41">mantepse</a>:
</p>
<blockquote class="citation">
<blockquote class="citation">
<blockquote class="citation">
<p>
unfortunately, sending a line to sage does not work correctly:
</p>
</blockquote>
<p>
<code>M-x sage-shell-edit:send-line*</code> doesn't work? If it works, I will replace the command.
</p>
</blockquote>
<p>
That would be great!
</p>
<p>
Another tiny problem: saying
</p>
<pre class="wiki">(sage-shell:define-alias)
</pre><p>
in <code>.emacs</code> doesn't work - must it be in <code>.emacs.d/init.el</code>?
</p>
<pre class="wiki">Warning (initialization): An error occurred while loading `/home/martin/.emacs':
Symbol's function definition is void: sage-shell:define-alias
</pre></blockquote>
<p>
It is OK to use <code>.emacs</code>. Place is not a problem, the order of evaluation is a problem. You should evaluate <code>(package-initialize)</code> before evaluating <code>(sage-shell:define-alias)</code>. I hope this helps.
</p>
TicketstakemoriThu, 08 Sep 2016 23:43:23 GMT
https://trac.sagemath.org/ticket/21227#comment:46
https://trac.sagemath.org/ticket/21227#comment:46
<blockquote class="citation">
<p>
Here's a reference that may be helpful in choosing the right TERM that reflects what you implemented. <a class="ext-link" href="http://invisible-island.net/ncurses/terminfo.src.html"><span class="icon"></span>http://invisible-island.net/ncurses/terminfo.src.html</a>
</p>
</blockquote>
<p>
Thank you. It looks very helpful. I will read it carefully.
</p>
TicketmantepseFri, 09 Sep 2016 06:05:50 GMT
https://trac.sagemath.org/ticket/21227#comment:47
https://trac.sagemath.org/ticket/21227#comment:47
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/21227#comment:45" title="Comment 45">stakemori</a>:
</p>
<blockquote class="citation">
<p>
It is OK to use <code>.emacs</code>. Place is not a problem, the order of evaluation is a problem. You should evaluate <code>(package-initialize)</code> before evaluating <code>(sage-shell:define-alias)</code>. I hope this helps.
</p>
</blockquote>
<p>
Yes, it does! You are my emacs 24 hero!
</p>
<p>
Martin
</p>
TicketiandrusMon, 12 Sep 2016 15:54:14 GMT
https://trac.sagemath.org/ticket/21227#comment:48
https://trac.sagemath.org/ticket/21227#comment:48
<p>
I would be happy to combine sage-mode and sage-shell-mode. I quite like sage-mode, but I haven't had much time for working on it, and don't forsee that I will in the future either. Sage users deserve something that's maintained.
</p>
<p>
Long ago I wrote a feature comparison at <a class="ext-link" href="https://wiki.sagemath.org/SageModeComparison"><span class="icon"></span>https://wiki.sagemath.org/SageModeComparison</a> but it's probably out of date. For example, I think sage-shell-mode recently got blocks. If that's the case then the things to port from sage-mode to
</p>
<ul><li>AUCTeX integration
<ul><li>This can probably be copied as-is or moved to a separate package entirely. I think it only references sage-mode once.
</li></ul></li><li>Inline plots and typeset output
<ul><li>This is somewhat intricate, but could probably be simplified by dropping support for ancient versions of Sage.
</li></ul></li><li>Doctesting and Building help
<ul><li>I'm less sure about how much work this will be.
</li></ul></li></ul><p>
If I get some time I'll start looking at sage-shell-mode's code to see if I can submit a pull request or something.
</p>
TicketstakemoriTue, 13 Sep 2016 04:51:51 GMT
https://trac.sagemath.org/ticket/21227#comment:49
https://trac.sagemath.org/ticket/21227#comment:49
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/21227#comment:48" title="Comment 48">iandrus</a>:
</p>
<p>
Thank you very much! I also would be very glad if you could port those features to <code>sage-shell-mode</code>.
</p>
TicketmantepseWed, 14 Sep 2016 17:34:18 GMT
https://trac.sagemath.org/ticket/21227#comment:50
https://trac.sagemath.org/ticket/21227#comment:50
<p>
I suggest to close the ticket, since <code>sage-shell-mode</code> now works very well, as far as I can tell.
</p>
<p>
<strong>Thank you stakemori!
</strong></p>
<p>
The optional package <code>sage-mode</code> does not work anymore, so it probably should be moved to experimental or something similar.
</p>
<p>
I have no idea how to do any of this, though.
</p>
TicketmkoeppeWed, 14 Sep 2016 18:27:40 GMT
https://trac.sagemath.org/ticket/21227#comment:51
https://trac.sagemath.org/ticket/21227#comment:51
<p>
Let's keep this ticket open to keep track of the issues that I reported upstream with IPython and python-prompt-toolkit.
</p>
TicketjsrnThu, 15 Sep 2016 06:51:04 GMT
https://trac.sagemath.org/ticket/21227#comment:52
https://trac.sagemath.org/ticket/21227#comment:52
<p>
Considering the excellent state of <code>sage-shell-mode</code> and the Comment 48 by Ivan, perhaps we should also open a ticket for making <code>sage-shell-mode</code> the default package in Sage for Emacs, and move <code>sage-mode</code> to experimental or remove it.
</p>
TicketstakemoriThu, 15 Sep 2016 09:05:52 GMT
https://trac.sagemath.org/ticket/21227#comment:53
https://trac.sagemath.org/ticket/21227#comment:53
<p>
mantepse, you are welcome!
</p>
<p>
jsrn, thanks for the suggestion.
</p>
<blockquote class="citation">
<p>
making sage-shell-mode the default package in Sage for Emacs
</p>
</blockquote>
<p>
What does it exactly mean? It means editing the wiki or the link in <a href="http://www.sagemath.org/download-linux.html">http://www.sagemath.org/download-linux.html</a>?
</p>
TicketjsrnThu, 15 Sep 2016 12:16:42 GMT
https://trac.sagemath.org/ticket/21227#comment:54
https://trac.sagemath.org/ticket/21227#comment:54
<blockquote class="citation">
<blockquote class="citation">
<p>
making sage-shell-mode the default package in Sage for Emacs
</p>
</blockquote>
<p>
What does it exactly mean? It means editing the wiki or the link in <a href="http://www.sagemath.org/download-linux.html">http://www.sagemath.org/download-linux.html</a>?
</p>
</blockquote>
<p>
Yes, something like:
</p>
<ol><li>Modify the link <a href="http://www.sagemath.org/download-linux.html">http://www.sagemath.org/download-linux.html</a>.
</li><li>Modify any other mention of <code>sage-mode</code> on sagemath.org.
</li><li>Modify any mention of <code>sage-mode</code> on the Sage wiki.
</li><li>Don't ship <code>sage-mode</code> together with Sage.
</li><li>Start shipping <code>sage-emacs-mode</code> with Sage? I vote yes.
</li><li>Modify references to <code>sage-mode</code> in source code (a grep found e.g. <code>src/sage/repl/rich_output/backend_emacs.py</code> which might be necessary for porting <code>sage-view</code> to <code>sage-shell-mode</code>).
</li></ol><p>
Apart from that one could consider:
</p>
<ol><li>In future <code>sage-shell-mode</code> releases, consider activating the aliases by default.
</li><li>Put a warning on the <code>sage-mode</code> bitbucket page that it no longer works?
</li></ol>
TicketmantepseThu, 15 Sep 2016 12:26:55 GMT
https://trac.sagemath.org/ticket/21227#comment:55
https://trac.sagemath.org/ticket/21227#comment:55
<p>
Actually, given that iandrus agrees and is interested in having the remaining features of <code>sage-mode</code> merged into <code>sage-shell-mode</code>, and given that <code>sage-mode</code> is unlikely to be resurrected, wouldn't it be easier to make <code>sage-mode</code> an alias for <code>sage-shell-mode</code>?
</p>
TicketstakemoriThu, 15 Sep 2016 22:34:57 GMT
https://trac.sagemath.org/ticket/21227#comment:56
https://trac.sagemath.org/ticket/21227#comment:56
<p>
Thanks for making the list, jsrn.
</p>
<blockquote class="citation">
<p>
Modify any other mention of sage-mode on sagemath.org.
</p>
</blockquote>
<p>
Do you know how to do this? I don't know.
</p>
<blockquote class="citation">
<p>
In future sage-shell-mode releases, consider activating the aliases by default.
</p>
</blockquote>
<p>
To do this, <code>sage-shell-mode</code> has to renamed to <code>sage-mode</code> or <code>sage</code>. This is convention of elisp.
</p>
<blockquote class="citation">
<p>
given that sage-mode is unlikely to be resurrected
</p>
</blockquote>
<p>
If mkoeppe's request to <code>prompt_toolkit</code> is accepted, <code>sage-mode</code> will be resurrected. So concerning with alias or renaming, I will see how it goes for a while.
</p>
TicketmkoeppeThu, 15 Sep 2016 22:57:22 GMT
https://trac.sagemath.org/ticket/21227#comment:57
https://trac.sagemath.org/ticket/21227#comment:57
<p>
Renaming software is usually not a good idea, because it causes confusion.
</p>
TicketmkoeppeFri, 16 Sep 2016 07:03:57 GMT
https://trac.sagemath.org/ticket/21227#comment:58
https://trac.sagemath.org/ticket/21227#comment:58
<p>
Is sage-shell-mode available on MELPA?
</p>
TicketstakemoriFri, 16 Sep 2016 07:06:17 GMT
https://trac.sagemath.org/ticket/21227#comment:59
https://trac.sagemath.org/ticket/21227#comment:59
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/21227#comment:58" title="Comment 58">mkoeppe</a>:
</p>
<blockquote class="citation">
<p>
Is sage-shell-mode available on MELPA?
</p>
</blockquote>
<p>
Yes. <a class="ext-link" href="https://melpa.org/#/sage-shell-mode"><span class="icon"></span>https://melpa.org/#/sage-shell-mode</a>
</p>
TicketmkoeppeFri, 16 Sep 2016 07:09:25 GMT
https://trac.sagemath.org/ticket/21227#comment:60
https://trac.sagemath.org/ticket/21227#comment:60
<p>
Great. Then there's probably no need to ship it with Sage (step 5 above), as installing via MELPA is probably the easiest way for users.
</p>
TicketstakemoriFri, 16 Sep 2016 07:10:45 GMT
https://trac.sagemath.org/ticket/21227#comment:61
https://trac.sagemath.org/ticket/21227#comment:61
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/21227#comment:60" title="Comment 60">mkoeppe</a>:
I agree.
</p>
TicketjsrnMon, 19 Sep 2016 06:48:14 GMT
https://trac.sagemath.org/ticket/21227#comment:62
https://trac.sagemath.org/ticket/21227#comment:62
<blockquote class="citation">
<blockquote class="citation">
<p>
Modify any other mention of sage-mode on sagemath.org.
</p>
</blockquote>
<p>
Do you know how to do this? I don't know.
</p>
</blockquote>
<p>
Hmm, no, sorry.
</p>
TicketstakemoriMon, 19 Sep 2016 07:42:56 GMT
https://trac.sagemath.org/ticket/21227#comment:63
https://trac.sagemath.org/ticket/21227#comment:63
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/21227#comment:62" title="Comment 62">jsrn</a>:
</p>
<p>
There is no need to apologize. Thanks.
</p>
<p>
I will ask how to do it at sage-devel. But before doing this, I would like iandrus's agreement with making <code>sage-shell-mode</code> the default package.
</p>
TicketdimpaseTue, 20 Sep 2016 22:19:44 GMT
https://trac.sagemath.org/ticket/21227#comment:64
https://trac.sagemath.org/ticket/21227#comment:64
<p>
to request updates to sagemath.org, submit a pull request with the proposed changes at <a class="ext-link" href="https://github.com/sagemath/website"><span class="icon"></span>https://github.com/sagemath/website</a>
</p>
TicketstakemoriWed, 21 Sep 2016 01:29:56 GMT
https://trac.sagemath.org/ticket/21227#comment:65
https://trac.sagemath.org/ticket/21227#comment:65
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/21227#comment:64" title="Comment 64">dimpase</a>:
</p>
<blockquote class="citation">
<p>
to request updates to sagemath.org, submit a pull request with the proposed changes at <a class="ext-link" href="https://github.com/sagemath/website"><span class="icon"></span>https://github.com/sagemath/website</a>
</p>
</blockquote>
<p>
Thank you very much for your information!
</p>
TicketjsrnWed, 21 Sep 2016 07:36:11 GMT
https://trac.sagemath.org/ticket/21227#comment:66
https://trac.sagemath.org/ticket/21227#comment:66
<p>
I think that Ivan was pretty clear on his stance: "Sage users deserve something that's maintained". In any case, thank you for your hard work on maintaining <code>sage-mode</code> these years, Ivan!
</p>
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/21227#comment:54" title="Comment 54">jsrn</a>:
</p>
<blockquote class="citation">
<ol start="3"><li>Modify any mention of <code>sage-mode</code> on the Sage wiki.
</li></ol></blockquote>
<p>
I modified the pages <a class="ext-link" href="https://wiki.sagemath.org/sage-mode"><span class="icon"></span>https://wiki.sagemath.org/sage-mode</a>, <a class="ext-link" href="https://wiki.sagemath.org/Emacs"><span class="icon"></span>https://wiki.sagemath.org/Emacs</a> and <a class="ext-link" href="https://wiki.sagemath.org/SageModeComparison"><span class="icon"></span>https://wiki.sagemath.org/SageModeComparison</a>, but kept all of them for now. Later on we might prune and/or clean them further.
</p>
<blockquote class="citation">
<ol start="4"><li>Don't ship <code>sage-mode</code> together with Sage.
</li><li>Start shipping <code>sage-emacs-mode</code> with Sage? I vote yes.
</li></ol></blockquote>
<p>
I opened <a class="closed ticket" href="https://trac.sagemath.org/ticket/21549" title="task: Remove `sage-mode` as an optional package (closed: fixed)">#21549</a> for this.
</p>
<blockquote class="citation">
<ol start="6"><li>Modify references to <code>sage-mode</code> in source code (a grep found e.g. <code>src/sage/repl/rich_output/backend_emacs.py</code> which might be necessary for porting <code>sage-view</code> to <code>sage-shell-mode</code>).
</li></ol></blockquote>
<p>
Until the <code>sage-view</code> features of <code>sage-mode</code> have been ported to <code>sage-shell-mode</code>, it is unclear to me how much of this will be used. I vote for just leaving it for now.
</p>
<blockquote class="citation">
<p>
Apart from that one could consider:
</p>
<ol><li>In future <code>sage-shell-mode</code> releases, consider activating the aliases by default.
</li></ol></blockquote>
<p>
As pointed out by stakemori, this is against Elisp conventions.
</p>
<p>
Best,
Johan
</p>
TicketjsrnWed, 21 Sep 2016 07:39:33 GMTpriority, summary changed
https://trac.sagemath.org/ticket/21227#comment:67
https://trac.sagemath.org/ticket/21227#comment:67
<ul>
<li><strong>priority</strong>
changed from <em>blocker</em> to <em>major</em>
</li>
<li><strong>summary</strong>
changed from <em>No emacs interface anymore in sage 7.4 beta0: both sage_mode and sage-shell-mode broken</em> to <em>sage_mode broken in Sage 7.4. sage-shell-mode is the future?</em>
</li>
</ul>
<p>
I removed the "blocker" status since stakemori's hard work means we have a Sage mode again!
</p>
<p>
I also updated the title of the ticket. Perhaps this ticket will contain the changes to Sage documentation for making <code>sage-shell-mode</code> the official Emacs mode?
</p>
TicketmantepseWed, 21 Sep 2016 07:48:06 GMTkeywords, summary changed
https://trac.sagemath.org/ticket/21227#comment:68
https://trac.sagemath.org/ticket/21227#comment:68
<ul>
<li><strong>keywords</strong>
<em>sage-mode</em> added
</li>
<li><strong>summary</strong>
changed from <em>sage_mode broken in Sage 7.4. sage-shell-mode is the future?</em> to <em>sage-mode broken in Sage 7.4. sage-shell-mode is the future?</em>
</li>
</ul>
TicketmantepseWed, 21 Sep 2016 07:50:15 GMT
https://trac.sagemath.org/ticket/21227#comment:69
https://trac.sagemath.org/ticket/21227#comment:69
<p>
I am quite sure it would be good (with iandrus permission, of course) to make sage-shell-mode the successor of sage-mode and rename it. The current function names are terrible to type.
</p>
TicketstakemoriWed, 21 Sep 2016 10:48:10 GMT
https://trac.sagemath.org/ticket/21227#comment:70
https://trac.sagemath.org/ticket/21227#comment:70
<p>
Thank you for your good work, Johan!
</p>
<p>
I sent a PR (<a class="ext-link" href="https://github.com/sagemath/website/pull/95"><span class="icon"></span>https://github.com/sagemath/website/pull/95</a>) to <a class="ext-link" href="https://github.com/sagemath/website"><span class="icon"></span>https://github.com/sagemath/website</a>.
</p>
<blockquote class="citation">
<p>
The current function names are terrible to type.
</p>
</blockquote>
<p>
I try to make interactive function names shorter or define more aliases.
</p>
TicketmantepseWed, 21 Sep 2016 11:31:03 GMT
https://trac.sagemath.org/ticket/21227#comment:71
https://trac.sagemath.org/ticket/21227#comment:71
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/21227#comment:70" title="Comment 70">stakemori</a>:
</p>
<blockquote class="citation">
<blockquote class="citation">
<p>
The current function names are terrible to type.
</p>
</blockquote>
<p>
I try to make interactive function names shorter or define more aliases.
</p>
</blockquote>
<p>
Sorry, I was unclear. What I meant is: without the aliases it's terrible, and it's easier for the user if she doesn't need to modify <code>.emacs</code>. But it's only a suggestion, personally I have no problem. Indeed, I am very happy. (special thanks for <code>send-doctest</code>, which I immediately bound to <code>C-c C-j</code> :-)
</p>
TicketmkoeppeWed, 21 Sep 2016 23:00:44 GMT
https://trac.sagemath.org/ticket/21227#comment:72
https://trac.sagemath.org/ticket/21227#comment:72
<p>
Replying to <a class="ticket" href="https://trac.sagemath.org/ticket/21227#comment:51" title="Comment 51">mkoeppe</a>:
</p>
<blockquote class="citation">
<p>
Let's keep this ticket open to keep track of the issues that I reported upstream with IPython and python-prompt-toolkit.
</p>
</blockquote>
<p>
I've actually created a new ticket <a class="new ticket" href="https://trac.sagemath.org/ticket/21558" title="defect: IPython 5 / python-prompt-toolkit not usable on dumb terminals (inside ... (new)">#21558</a> for that purpose.
So it's OK with me if the present ticket is closed when items 1--3 are done.
</p>
Ticket