Opened 4 years ago
Closed 5 months ago
#21227 closed defect (invalid)
sagemode broken in Sage 7.4. sageshellmode is the future?
Reported by:  mantepse  Owned by:  

Priority:  major  Milestone:  sageduplicate/invalid/wontfix 
Component:  user interface  Keywords:  sage_mode, sagemode 
Cc:  darthandrus@…, jsrn, vbraun, dimpase, fbissey, charpent, stakemori  Merged in:  
Authors:  Reviewers:  Dima Pasechnik  
Report Upstream:  Reported upstream. No feedback yet.  Work issues:  
Branch:  u/mkoeppe/sage_mode_for_emacs_has_display_problem_in_sage_7_4_beta0 (Commits)  Commit:  92378caa0c1a030b9399e889f42edb5afc8c6d87 
Dependencies:  Stopgaps: 
Description
On sage 7.4 beta0, emacs GNU Emacs 24.3.1 (x86_64pclinuxgnu, GTK+ Version 3.10.7) of 20140307 on lamiak, modified by Debian, beloved sage_mode 0.14 is broken. All in and output except the banner is unreadable!
┌────────────────────────────────────────────────────────────────────┐ │ SageMath version 7.4.beta0, Release Date: 20160810 │ │ Type "notebook()" for the browserbased 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
Change History (75)
comment:1 Changed 4 years ago by
comment:2 Changed 4 years ago by
You may play with (settings in)
sage: %config SageTerminalInteractiveShell
comment:3 Changed 4 years ago by
(Sage 7.4.beta0 upgraded IPython to 5.0, see #21006.)
comment:4 Changed 4 years ago by
 Cc jsrn added
comment:5 Changed 4 years ago by
 Cc vbraun added
Here's a simple change that enables "simple prompts" when sage is run within an Emacs inferior shell. However, as has been noted here, the "simple prompts" mode lacks multiline support, so one gets this:
In [1]: def f(x): File "<ipythoninput1cde3fd95d55b>", line 1 def f(x): ^ SyntaxError: unexpected EOF while parsing

src/sage/repl/interpreter.py
diff git a/src/sage/repl/interpreter.py b/src/sage/repl/interpreter.py index 1f4eda7..1d69829 100644
a b class SageTerminalInteractiveShell(SageShellOverride, TerminalInteractiveShell): 248 248 <sage.repl.interpreter.SageNotebookInteractiveShell object at 0x...> 249 249 """ 250 250 251 def init_prompt_toolkit_cli(self): 252 """ 253 Use plain noninteractive output if TERM=dumb (as in an Emacs inferior shell) 254 """ 255 if os.environ['TERM'] == 'dumb': 256 self.simple_prompt = True 257 return super(SageTerminalInteractiveShell, self).init_prompt_toolkit_cli() 258 251 259 def init_display_formatter(self): 252 260 """ 253 261 Switch to the Sage IPython commandline rich output backend
comment:6 Changed 4 years ago by
Thank you for this! At least I can work again!
comment:7 Changed 4 years ago by
 Branch set to u/mkoeppe/sage_mode_for_emacs_has_display_problem_in_sage_7_4_beta0
comment:8 Changed 4 years ago by
 Commit set to 92378caa0c1a030b9399e889f42edb5afc8c6d87
 Report Upstream changed from N/A to Reported upstream. No feedback yet.
I've opened an IPython issue for this: https://github.com/ipython/ipython/issues/9886
New commits:
92378ca  Fix for sage shell with TERM=dumb

comment:9 Changed 4 years ago by
 Cc dimpase fbissey added
comment:10 Changed 4 years ago by
 Cc charpent added
comment:11 Changed 4 years ago by
A few remarks :
 The current patch waits endlessly for a prompt.
 When interrupted (CG), it gives a functional prompt : the Sage REPL is working.
 When inline plots are enabled, they are displayed, but the sustems claims (falsely) to have launced a png viewer.
 When tyepeset output is enabled in the menu, the output is displayed as text :
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
 Ditto when using the
%display typeset
magic...
"Oooohhh, so clooose..."
HTH,
comment:12 Changed 4 years ago by
 Priority changed from major to blocker
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 https://github.com/stakemori/sageshellmode, but could not (yet) get it to work. (Install went OK, but I cannot even evaluate 1+1.)
comment:13 Changed 4 years ago by
 Summary changed from sage_mode for emacs has display problem in sage 7.4 beta0 to No emacs interface anymore in sage 7.4 beta0: both sage_mode and sageshellmode broken
comment:14 followup: ↓ 16 Changed 4 years ago by
I've pushed fixes to the master branch of sageshellmode. sageshellmode was fixed. To use sageshellmode with Sage7.4 beta0, please set sageshell:useprompttoolkit
to t
.
As for the patch, could you use an environment variable other than TERM
? (IPython uses IPY_TEST_SIMPLE_PROMPT
for the same purpose). If this is merged, sageshellmode
is forced to use the simple prompt. And I don't want to use the simple prompt inside Emacs.
I think sagemode (or inferiorpythonmode) 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. comintmode
cannot handle escape sequences, well but termmode
can handle them very well. So I imitated termmode
.
comment:15 Changed 4 years ago by
 Cc stakemori added
comment:16 in reply to: ↑ 14 ; followup: ↓ 17 Changed 4 years ago by
Replying to stakemori:
I've pushed fixes to the master branch of sageshellmode. sageshellmode was fixed. To use sageshellmode with Sage7.4 beta0, please set
sageshell:useprompttoolkit
tot
.As for the patch, could you use an environment variable other than
TERM
? (IPython usesIPY_TEST_SIMPLE_PROMPT
for the same purpose). If this is merged,sageshellmode
is forced to use the simple prompt. And I don't want to use the simple prompt inside Emacs.I think sagemode (or inferiorpythonmode) 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.
comintmode
cannot handle escape sequences well, buttermmode
can handle them very well. So I imitatedtermmode
.
Well, termmode does not set TERM=dumb
. It sets TERM=etermcolor
. So?
comment:17 in reply to: ↑ 16 ; followup: ↓ 18 Changed 4 years ago by
Sorry. I don't understand your question. What I meant is that the process filter function in termmode
(termemulateterminal
) handles escape sequences very well. sageshellmode
is also derived from comintmode
.
comment:18 in reply to: ↑ 17 ; followup: ↓ 19 Changed 4 years ago by
Replying to stakemori:
Sorry. I don't understand your question. What I meant is that the process filter function in
termmode
(termemulateterminal
) handles escape sequences very well.sageshellmode
is also derived fromcomintmode
.
What I'm saying is that:
 termmode sets
TERM=etermcolor
and so, even with the patch on this ticket, no "simple prompts" are used. comintmode
does not handle escape sequences. Therefore it setsTERM=dumb
to inform the applications running under it about this fact. If your mode, derived from
comintmode
, handles escape sequences, then it should not be usingTERM=dumb
but rather something else; perhapsTERM=vt100
.
comment:19 in reply to: ↑ 18 Changed 4 years ago by
Thanks for your explanation. I will change it to other than dumb
.
comment:20 followup: ↓ 29 Changed 4 years ago by
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): https://github.com/jonathanslenders/pythonprompttoolkit/issues/390
comment:21 followup: ↓ 22 Changed 4 years ago by
I am so grateful that you are working on this! I'm documenting here how it went, following Installation and Setup
in README.org
:
 perfect
 perfect
set sageshell:useprompttoolkit to nonnil
I wanted to use customize, but it complains:Creating customization items... widgetapply: Symbol's function definition is void: nil
 doing
Mx sageshell:runsage
I getsageshell:windowmaxcharsperline: Wrong number of arguments: windowbodywidth, 2
comment:22 in reply to: ↑ 21 ; followup: ↓ 23 Changed 4 years ago by
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 (setq sageshell:useprompttoolkit t)
in your configuration file.
According to the error message, it seems that you are using Emacs older than 24.4. Please use Emacs 24.4 or later.
comment:23 in reply to: ↑ 22 Changed 4 years ago by
Replying to stakemori:
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
(setq sageshell:useprompttoolkit t)
in your configuration file.According to the error message, it seems that you are using Emacs older than 24.4. Please use Emacs 24.4 or later.
Indeed, 24.3.1...
I'm a bit afraid of upgrading, but I guess I'll do it :)
comment:24 Changed 4 years ago by
I did it (not quite sure yet whether I like Ubuntu 16.04...)
Anyway: Mx sageshell:runsage
starts sage and I can evaluate stuff.
 I have no tabcompletion (the modeline says: "No match")
 sending a buffer to the
*sage*
buffer breaks emacs(Error running timer: (wrongtypeargument bufferp nil)
occupies the modeline and won't go away anymore.
thanks for helping!
comment:25 Changed 4 years ago by
tabcompletion
and sending buffer work for me (http://i.imgur.com/LL6vm3b.png). I am not sure why such an error occurs.
comment:26 Changed 4 years ago by
Can you reproduce this even if only sageshellmode
is loaded? If so, could you tell me the Emacs version and a recipe for reproducing?
comment:27 followup: ↓ 28 Changed 4 years ago by
I am using sage 7.4.beta1 with the patch on this ticket applied, emacs is 24.5.1. Running emacs q
and then in *scratch*
:
(require 'package) package (addtolist 'packagearchives '("melpa" . "https://melpa.org/packages/")) (("melpa" . "https://melpa.org/packages/") ("gnu" . "http://elpa.gnu.org/packages/")) (packageinitialize) t (setq sageshell:useprompttoolkit 'T) T (setq sageshell:sageroot "~/SAGE") "~/SAGE"
and finally
Mx sageshell:runsage
gives
┌────────────────────────────────────────────────────────────────────┐ │ SageMath version 7.4.beta1, Release Date: 20160817 │ │ Type "notebook()" for the browserbased notebook interface. │ │ Type "help()" for help. │ └────────────────────────────────────────────────────────────────────┘ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Warning: this is a prerelease version, and it may be unstable. ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ In [1]: 12.is
but no tabcompletion.
comment:28 in reply to: ↑ 27 Changed 4 years ago by
Thanks. I have not implemented the simple prompts feature. So sageshellmode
does not work well with the patch. The latest sageshellmode
in MELPA sets TERM
to emacs
. Please upgrade sageshellmode
by Mx packagelistpackages
, U
and x
. The problem still persists?
comment:29 in reply to: ↑ 20 ; followup: ↓ 42 Changed 4 years ago by
It seems that sageshellmode
must set TERM
to dumb
. sageshellmode
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 TERM
to emacs
, but the clear
command shows an error message. Again, could you use an environment variable other than TERM
in the patch?
comment:30 followup: ↓ 31 Changed 4 years ago by
I'm confused now. Is sageshellmode
working on your computer without the patch in this ticket? (I thought that "simple prompts" is not a feature, but a workaround.)
comment:31 in reply to: ↑ 30 Changed 4 years ago by
Replying to mantepse:
I'm confused now. Is
sageshellmode
working on your computer without the patch in this ticket? (I thought that "simple prompts" is not a feature, but a workaround.)
Yes. So sageshellmode
support multiline input (though there exits a minor issue. See https://github.com/stakemori/sageshellmode/issues/7).
sageshellmode
can handle a part of escape sequences related to text modification and cursor movement. If sageshell:useprompttoolkit
is nonnil, then I assume Sage is not using simple prompt
or GNU readline
. I will also support simple prompt
in future.
comment:32 followup: ↓ 33 Changed 4 years ago by
Wow! I think you are getting very close!
 tab completion works
 sending a buffer with
Cc Cc
to the sage buffer works, also loading a file withCc Cl
works.
A little suggestion: if the current buffer is a visited file in sage mode, it would be nice to have Cc Cc
load the file instead, asking whether to save the buffer if necessary. Because:
sage: load('/tmp/sage_shell_mode17030j9Q/sage_shell_mode_temp.sage')
doesn't give me a clue which file I actually loaded!
 unfortunately, sending a line to sage does not work correctly:
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
I think it doesn't strip the "sage:" anymore  was this done by ipython before?
comment:33 in reply to: ↑ 32 ; followups: ↓ 34 ↓ 41 Changed 4 years ago by
Thank you for trying.
To fix this issue, I had to changed basic functions of this mode. So there may be such problems. Sorry.
unfortunately, sending a line to sage does not work correctly:
Mx sageshelledit:sendline*
doesn't work? If it works, I will replace the command.
A little suggestion: if the current buffer is a visited file in sage mode, it would be nice to have Cc Cc load the file instead, asking whether to save the buffer if necessary.
Thank you for the suggestion. I will consider about it.
comment:34 in reply to: ↑ 33 ; followup: ↓ 35 Changed 4 years ago by
Replying to stakemori:
Thank you for trying.
To fix this issue, I had to changed basic functions of this mode. So there may be such problems. Sorry.
Hey, your work is fantastic! I have no idea what I would have done without you!
unfortunately, sending a line to sage does not work correctly:
Mx sageshelledit:sendline*
doesn't work? If it works, I will replace the command.
Great! Mx sageshelledit:sendline*
(with the asterisk!) does the right thing!
comment:35 in reply to: ↑ 34 ; followup: ↓ 37 Changed 4 years ago by
Hey, your work is fantastic! I have no idea what I would have done without you!
Thank you very much! I am very glad that sageshellmode
works on your computer.
By the way, it would be great if I (or someone) could write a process filter function for sagemode
(or pythonmode
) 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).
comment:36 followup: ↓ 38 Changed 4 years ago by
why would you want to handle escape sequences?
comment:37 in reply to: ↑ 35 ; followup: ↓ 39 Changed 4 years ago by
Replying to stakemori:
By the way, it would be great if I (or someone) could write a process filter function for
sagemode
(orpythonmode
) 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).
I'm currently a sagemode
user and would be interested in getting it to work again. But my knowledge of terminals and the details of comintmode
is not very extensive, and I've lost track of what changes were necessary to make sageshellmode
work again. How difficult would you estimate porting your fixes would be?
But perhaps rather: should we take this as a cue to merge the efforts of sageshellmode
and sagemode
; after all, they're trying to do more or less the same. The current maintainer of sagemode
is Ivan Andrus but my impression is that he is really only maintaining  not developing. sageshellmode
is much more vibrant in comparison! My impression is that sageshellmode
currently does completion better than sagemode
, but sagemode
can render latex and images. There might also be small differences in how editing directly in the shell works?
My own contributions to sagemode
are modest: I've written the current help file/landing page, I wrote a small set of functions, sageblocks.el
, for giving lightweight notebooklike editing, and I've helped report and track down some bugs. Rather than porting fixes to sagemode
, I would be interested in trying out sageshellmode
and lending a hand on implementing the features that would make it a great alternative for current sagemode
users. I'm also an eVil
user, so I would naturally be testing/modding sageshellmode
to work under those conditions.
Best, Johan
comment:38 in reply to: ↑ 36 Changed 4 years ago by
Replying to mantepse:
why would you want to handle escape sequences?
I don't want to handle escape sequences if possible. But developers of IPython choose prompt_toolkit
rather than readline
and prompt_toolkit
uses a lot of escape sequences. Therefore I think sageshellmode
should handle them. And I don't want to use the simple prompt workaround at the moment.
comment:39 in reply to: ↑ 37 ; followup: ↓ 40 Changed 4 years ago by
I'm currently a sagemode user and would be interested in getting it to work again. But my knowledge of terminals and the details of comintmode is not very extensive, and I've lost track of what changes were necessary to make sageshellmode work again. How difficult would you estimate porting your fixes would be?
If you use the simple prompt workaround, then I guess it would be easy to fix sagemode
. But you might lose some features because of the workaround (Above, charpent remarked that
"When inline plots are enabled, they are displayed, but the sustems claims (falsely) to have launced a png viewer."
I am not sure if it is because of the workaround).
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. comintoutputfilter
doesn't work. If you want to implement it, you could copy code in sageshellmode
and I could help you.
But perhaps rather: should we take this as a cue to merge the efforts of sageshellmode and sagemode; after all, they're trying to do more or less the same. The current maintainer of sagemode is Ivan Andrus but my impression is that he is really only maintaining  not developing. sageshellmode is much more vibrant in comparison! My impression is that sageshellmode currently does completion better than sagemode, but sagemode can render latex and images. There might also be small differences in how editing directly in the shell works?
I am OK with merging. I would be glad if sageshellmode
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.
I do not understand sageblocks.el
very well. Is it similar to obsagemath (https://github.com/stakemori/obsagemath)? And I would be very happy if you contributed to sageshellmode
.
comment:40 in reply to: ↑ 39 ; followup: ↓ 44 Changed 4 years ago by
Replying to stakemori:
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.
comintoutputfilter
doesn't work. If you want to implement it, you could copy code insageshellmode
and I could help you.
OK, thanks. I'll first try to see if sageshellmode
could be a replacement for me.
I am OK with merging. I would be glad if
sageshellmode
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.
OK.
I do not understand
sageblocks.el
very well. Is it similar to obsagemath (https://github.com/stakemori/obsagemath)?
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 blockwise 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 sageshellmode
, I'm sure.
And I would be very happy if you contributed to
sageshellmode
.
As a first approximation, I've cloned sageshellmode
and I'm trying it out. As you've already seen I'll post Issues when I hit funky behaviour ;)
Thanks for your hard work on this!
Best, Johan
comment:41 in reply to: ↑ 33 ; followup: ↓ 45 Changed 4 years ago by
unfortunately, sending a line to sage does not work correctly:
Mx sageshelledit:sendline*
doesn't work? If it works, I will replace the command.
That would be great!
Another tiny problem: saying
(sageshell:definealias)
in .emacs
doesn't work  must it be in .emacs.d/init.el
?
Warning (initialization): An error occurred while loading `/home/martin/.emacs': Symbol's function definition is void: sageshell:definealias
comment:42 in reply to: ↑ 29 ; followup: ↓ 43 Changed 4 years ago by
Replying to stakemori:
It seems that
sageshellmode
must setTERM
todumb
.sageshellmode
is not a full terminal emulator. It can handle a part of escape sequences but not all. Also it doesn't handle pager. I setTERM
toemacs
, but theclear
command shows an error message. Again, could you use an environment variable other thanTERM
in the patch?
But I don't have control over the environment variables that are set within a Mx shell
in emacs.
comment:43 in reply to: ↑ 42 ; followup: ↓ 46 Changed 4 years ago by
Replying to mkoeppe:
Replying to stakemori:
It seems that
sageshellmode
must setTERM
todumb
.sageshellmode
is not a full terminal emulator. It can handle a part of escape sequences but not all. Also it doesn't handle pager. I setTERM
toemacs
, but theclear
command shows an error message. Again, could you use an environment variable other thanTERM
in the patch?But I don't have control over the environment variables that are set within a
Mx shell
in emacs.
Here's a reference that may be helpful in choosing the right TERM that reflects what you implemented. http://invisibleisland.net/ncurses/terminfo.src.html
comment:44 in reply to: ↑ 40 Changed 4 years ago by
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 blockwise 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 sageshellmode, I'm sure.
Thank you for explanation. It looks very convenient.
comment:45 in reply to: ↑ 41 ; followup: ↓ 47 Changed 4 years ago by
Replying to mantepse:
unfortunately, sending a line to sage does not work correctly:
Mx sageshelledit:sendline*
doesn't work? If it works, I will replace the command.That would be great!
Another tiny problem: saying
(sageshell:definealias)in
.emacs
doesn't work  must it be in.emacs.d/init.el
?Warning (initialization): An error occurred while loading `/home/martin/.emacs': Symbol's function definition is void: sageshell:definealias
It is OK to use .emacs
. Place is not a problem, the order of evaluation is a problem. You should evaluate (packageinitialize)
before evaluating (sageshell:definealias)
. I hope this helps.
comment:46 in reply to: ↑ 43 Changed 4 years ago by
Here's a reference that may be helpful in choosing the right TERM that reflects what you implemented. http://invisibleisland.net/ncurses/terminfo.src.html
Thank you. It looks very helpful. I will read it carefully.
comment:47 in reply to: ↑ 45 Changed 4 years ago by
Replying to stakemori:
It is OK to use
.emacs
. Place is not a problem, the order of evaluation is a problem. You should evaluate(packageinitialize)
before evaluating(sageshell:definealias)
. I hope this helps.
Yes, it does! You are my emacs 24 hero!
Martin
comment:48 followup: ↓ 49 Changed 4 years ago by
I would be happy to combine sagemode and sageshellmode. I quite like sagemode, 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.
Long ago I wrote a feature comparison at https://wiki.sagemath.org/SageModeComparison but it's probably out of date. For example, I think sageshellmode recently got blocks. If that's the case then the things to port from sagemode to
 AUCTeX integration
 This can probably be copied asis or moved to a separate package entirely. I think it only references sagemode once.
 Inline plots and typeset output
 This is somewhat intricate, but could probably be simplified by dropping support for ancient versions of Sage.
 Doctesting and Building help
 I'm less sure about how much work this will be.
If I get some time I'll start looking at sageshellmode's code to see if I can submit a pull request or something.
comment:49 in reply to: ↑ 48 Changed 4 years ago by
Replying to iandrus:
Thank you very much! I also would be very glad if you could port those features to sageshellmode
.
comment:50 Changed 4 years ago by
I suggest to close the ticket, since sageshellmode
now works very well, as far as I can tell.
Thank you stakemori!
The optional package sagemode
does not work anymore, so it probably should be moved to experimental or something similar.
I have no idea how to do any of this, though.
comment:51 followup: ↓ 72 Changed 4 years ago by
Let's keep this ticket open to keep track of the issues that I reported upstream with IPython and pythonprompttoolkit.
comment:52 Changed 4 years ago by
Considering the excellent state of sageshellmode
and the Comment 48 by Ivan, perhaps we should also open a ticket for making sageshellmode
the default package in Sage for Emacs, and move sagemode
to experimental or remove it.
comment:53 followup: ↓ 54 Changed 4 years ago by
mantepse, you are welcome!
jsrn, thanks for the suggestion.
making sageshellmode the default package in Sage for Emacs
What does it exactly mean? It means editing the wiki or the link in http://www.sagemath.org/downloadlinux.html?
comment:54 in reply to: ↑ 53 ; followup: ↓ 66 Changed 4 years ago by
making sageshellmode the default package in Sage for Emacs
What does it exactly mean? It means editing the wiki or the link in http://www.sagemath.org/downloadlinux.html?
Yes, something like:
 Modify the link http://www.sagemath.org/downloadlinux.html.
 Modify any other mention of
sagemode
on sagemath.org.  Modify any mention of
sagemode
on the Sage wiki.  Don't ship
sagemode
together with Sage.  Start shipping
sageemacsmode
with Sage? I vote yes.  Modify references to
sagemode
in source code (a grep found e.g.src/sage/repl/rich_output/backend_emacs.py
which might be necessary for portingsageview
tosageshellmode
).
Apart from that one could consider:
 In future
sageshellmode
releases, consider activating the aliases by default.  Put a warning on the
sagemode
bitbucket page that it no longer works?
comment:55 Changed 4 years ago by
Actually, given that iandrus agrees and is interested in having the remaining features of sagemode
merged into sageshellmode
, and given that sagemode
is unlikely to be resurrected, wouldn't it be easier to make sagemode
an alias for sageshellmode
?
comment:56 followup: ↓ 62 Changed 4 years ago by
Thanks for making the list, jsrn.
Modify any other mention of sagemode on sagemath.org.
Do you know how to do this? I don't know.
In future sageshellmode releases, consider activating the aliases by default.
To do this, sageshellmode
has to renamed to sagemode
or sage
. This is convention of elisp.
given that sagemode is unlikely to be resurrected
If mkoeppe's request to prompt_toolkit
is accepted, sagemode
will be resurrected. So concerning with alias or renaming, I will see how it goes for a while.
comment:57 Changed 4 years ago by
Renaming software is usually not a good idea, because it causes confusion.
comment:58 followup: ↓ 59 Changed 4 years ago by
Is sageshellmode available on MELPA?
comment:59 in reply to: ↑ 58 Changed 4 years ago by
Replying to mkoeppe:
Is sageshellmode available on MELPA?
comment:60 followup: ↓ 61 Changed 4 years ago by
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.
comment:61 in reply to: ↑ 60 Changed 4 years ago by
Replying to mkoeppe: I agree.
comment:62 in reply to: ↑ 56 ; followup: ↓ 63 Changed 4 years ago by
Modify any other mention of sagemode on sagemath.org.
Do you know how to do this? I don't know.
Hmm, no, sorry.
comment:63 in reply to: ↑ 62 Changed 4 years ago by
Replying to jsrn:
There is no need to apologize. Thanks.
I will ask how to do it at sagedevel. But before doing this, I would like iandrus's agreement with making sageshellmode
the default package.
comment:64 followup: ↓ 65 Changed 4 years ago by
to request updates to sagemath.org, submit a pull request with the proposed changes at https://github.com/sagemath/website
comment:65 in reply to: ↑ 64 Changed 4 years ago by
Replying to dimpase:
to request updates to sagemath.org, submit a pull request with the proposed changes at https://github.com/sagemath/website
Thank you very much for your information!
comment:66 in reply to: ↑ 54 Changed 4 years ago by
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 sagemode
these years, Ivan!
Replying to jsrn:
 Modify any mention of
sagemode
on the Sage wiki.
I modified the pages https://wiki.sagemath.org/sagemode, https://wiki.sagemath.org/Emacs and https://wiki.sagemath.org/SageModeComparison, but kept all of them for now. Later on we might prune and/or clean them further.
 Don't ship
sagemode
together with Sage. Start shipping
sageemacsmode
with Sage? I vote yes.
I opened #21549 for this.
 Modify references to
sagemode
in source code (a grep found e.g.src/sage/repl/rich_output/backend_emacs.py
which might be necessary for portingsageview
tosageshellmode
).
Until the sageview
features of sagemode
have been ported to sageshellmode
, it is unclear to me how much of this will be used. I vote for just leaving it for now.
Apart from that one could consider:
 In future
sageshellmode
releases, consider activating the aliases by default.
As pointed out by stakemori, this is against Elisp conventions.
Best, Johan
comment:67 Changed 4 years ago by
 Priority changed from blocker to major
 Summary changed from No emacs interface anymore in sage 7.4 beta0: both sage_mode and sageshellmode broken to sage_mode broken in Sage 7.4. sageshellmode is the future?
I removed the "blocker" status since stakemori's hard work means we have a Sage mode again!
I also updated the title of the ticket. Perhaps this ticket will contain the changes to Sage documentation for making sageshellmode
the official Emacs mode?
comment:68 Changed 4 years ago by
 Keywords sagemode added
 Summary changed from sage_mode broken in Sage 7.4. sageshellmode is the future? to sagemode broken in Sage 7.4. sageshellmode is the future?
comment:69 Changed 4 years ago by
I am quite sure it would be good (with iandrus permission, of course) to make sageshellmode the successor of sagemode and rename it. The current function names are terrible to type.
comment:70 followup: ↓ 71 Changed 4 years ago by
Thank you for your good work, Johan!
I sent a PR (https://github.com/sagemath/website/pull/95) to https://github.com/sagemath/website.
The current function names are terrible to type.
I try to make interactive function names shorter or define more aliases.
comment:71 in reply to: ↑ 70 Changed 4 years ago by
Replying to stakemori:
The current function names are terrible to type.
I try to make interactive function names shorter or define more aliases.
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 .emacs
. But it's only a suggestion, personally I have no problem. Indeed, I am very happy. (special thanks for senddoctest
, which I immediately bound to Cc Cj
:)
comment:72 in reply to: ↑ 51 Changed 4 years ago by
comment:73 Changed 6 months ago by
 Milestone set to sageduplicate/invalid/wontfix
 Status changed from new to needs_review
time to close this ticket
comment:74 Changed 6 months ago by
 Reviewers set to Dima Pasechnik
 Status changed from needs_review to positive_review
comment:75 Changed 5 months ago by
 Resolution set to invalid
 Status changed from positive_review to closed
Leif mentioned on sagedevel:
I'm not sure what he means with that, but just typing
%colors NoColor
after the weird sage prompt doesn't help.