Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra readline commands not working #14687

Closed
kwankyu opened this issue Jun 5, 2013 · 16 comments
Closed

Extra readline commands not working #14687

kwankyu opened this issue Jun 5, 2013 · 16 comments

Comments

@kwankyu
Copy link
Collaborator

kwankyu commented Jun 5, 2013

After #12719, the extra readline commands do not work in Sage even though the IPython configuration file is updated according to a new format.

Apply to the scripts:

Apply (to the sage library):

CC: @dimpase

Component: user interface

Author: Kwankyu Lee

Reviewer: Dmitrii Pasechnik

Merged: sage-5.11.beta1

Issue created by migration from https://trac.sagemath.org/ticket/14687

@kwankyu
Copy link
Collaborator Author

kwankyu commented Jun 5, 2013

Attachment: trac_14687-scripts.patch.gz

To scripts repository

@kwankyu
Copy link
Collaborator Author

kwankyu commented Jun 5, 2013

Author: Kwankyu Lee

@kwankyu

This comment has been minimized.

@kwankyu kwankyu added the t: bug label Jun 5, 2013
@kwankyu

This comment has been minimized.

@dimpase
Copy link
Member

dimpase commented Jun 6, 2013

comment:5

I am trying to follow the instructions on #12503 (as I removed my ~/.sage/ at some point lately), but it does not seem to work (using Sage 5.9 on OSX 10.6.8).

Hitting control-o results in cursor moving forward in the line few spaces, similar to TAB. (after I do stty discard undef before starting Sage).

history-search-forward-and-save does not work at all.

Same with Sage 5.10.rc0 on Linux.

@dimpase
Copy link
Member

dimpase commented Jun 6, 2013

comment:6

Replying to @dimpase:

I am trying to follow the instructions on #12503 (as I removed my ~/.sage/ at some point lately), but it does not seem to work (using Sage 5.9 on OSX 10.6.8).

Hitting control-o results in cursor moving forward in the line few spaces, similar to TAB. (after I do stty discard undef before starting Sage).

history-search-forward-and-save does not work at all.

Oops, I am stupid. Now I see that the instructions on enabling this have changed!

Will report shortly.

@dimpase
Copy link
Member

dimpase commented Jun 6, 2013

comment:7

Please be more specific in your patch about ipython_config.py?
Currently you just say

IPython configuration file  ``ipython_config.py``

Is it still supposed to be in $DOT_SAGE/ipython/ ?

I do not have a file so named there. On OSX 10.6.8 system the only .py files are

$ ls -l ~/.sage/ipython/*.py
-rw-r--r--  1 dima  staff  2361 Nov 24  2012 /Users/dima/.sage/ipython/ipy_profile_sh.py
-rw-r--r--  1 dima  staff   836 Nov 24  2012 /Users/dima/.sage/ipython/ipy_user_conf.py

And a very similar picture on Linux.

@kwankyu
Copy link
Collaborator Author

kwankyu commented Jun 6, 2013

comment:9

The specific location for the IPython configuration file is

.sage/ipython-0.12/profile_sage/ipython_config.py

and you need to create the configuration file if it is absent.

I was reluctant to be this specific about the location since it seems to me that the directory name "ipython-0.12" is doomed to change someday, and the exact location, I think, should be documented elsewhere.

@dimpase
Copy link
Member

dimpase commented Jun 6, 2013

comment:10

Replying to @kwankyu:

The specific location for the IPython configuration file is

.sage/ipython-0.12/profile_sage/ipython_config.py

and you need to create the configuration file if it is absent.

I was reluctant to be this specific about the location since it seems to me that the directory name "ipython-0.12" is doomed to change someday, and the exact location, I think, should be documented elsewhere.

Well, replace lines 26-27 of your patch of readline_extra_commands.pyx with the following.

 To bind these commands with keys, insert the relevant lines into the IPython config file 
 ``$DOT_SAGE/ipython-<version_number>/profile_sage/ipython_config.py``.  
Note that ``$DOT_SAGE`` is ``$HOME/.sage`` by default. At the time of this patch, 
in Sage 5.11, ``<version_number>`` is 0.12. For example, 

After this, I'll be happy to give it positive review (it actually works just fine).

Feel free to open a ticket on documenting the location of ipython_config.py properly.

@kwankyu
Copy link
Collaborator Author

kwankyu commented Jun 7, 2013

comment:11

Replying to @dimpase:

Well, replace lines 26-27 of your patch of readline_extra_commands.pyx with the following.

 To bind these commands with keys, insert the relevant lines into the IPython config file 
 ``$DOT_SAGE/ipython-<version_number>/profile_sage/ipython_config.py``.  
Note that ``$DOT_SAGE`` is ``$HOME/.sage`` by default. At the time of this patch, 
in Sage 5.11, ``<version_number>`` is 0.12. For example, 

The directory name is fixed as "ipython-0.12". On a discussion about the name, "ipython-0.12-or-later" was suggested, but the final name was settled to as it is now. My opinion is that the name was ill-chosen, as it confuses users, at least you and me. :-) Anyway, currently it is officially "ipython-0.12".

So I will update the patch just now accepting the official location.

@kwankyu
Copy link
Collaborator Author

kwankyu commented Jun 7, 2013

To sage library

@dimpase

This comment has been minimized.

@dimpase
Copy link
Member

dimpase commented Jun 7, 2013

comment:13

Attachment: trac_14687.patch.gz

@jdemeyer
Copy link

jdemeyer commented Jun 7, 2013

Reviewer: Dmitrii Pasechnik

@jdemeyer
Copy link

Merged: sage-5.11.beta1

@dimpase
Copy link
Member

dimpase commented Jun 17, 2013

comment:16

it looks as if ipython_config.py is removed each time Sage is updated.
This is not good. There should be some other location for persistent settings like this one...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants