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

Convenient history fetch facilities #10289

Closed
kwankyu opened this issue Nov 18, 2010 · 11 comments
Closed

Convenient history fetch facilities #10289

kwankyu opened this issue Nov 18, 2010 · 11 comments

Comments

@kwankyu
Copy link
Collaborator

kwankyu commented Nov 18, 2010

Using Sage, you are missing a feature of the Magma command line interface. In Magma, if you enter a line found in history using up arrow key and then press down arrow key, then the next line in history is fetched. This feature allows you to fetch as many successive lines in history as you like. However, Sage does not have a similar feature. The IPython command prompt uses the readline library (via pyreadline), which evidently does not support this feature. Magma has its own custom “readline-like” library, which does support this feature. (Since so many people have requested this feature, if anybody can figure out how to implement it, then such an implementation would certainly be welcome!)

See instead #12503.

Component: user interface

Reviewer: Kwankyu Lee

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

@kwankyu
Copy link
Collaborator Author

kwankyu commented Nov 18, 2010

comment:1

From Chet Ramey:

This is very similar to the operate-and-get-next feature bash adds to the readline interface.  I am not inclined to add this to readline in its current form because it manipulates state managed by the calling application (rl_startup_hook) and requires that state to be kept between calls to readline().  It's a feature that should be provided by the calling application -- it's implementation is not complicated.

@kwankyu
Copy link
Collaborator Author

kwankyu commented Nov 18, 2010

comment:2

A developer of R attempted to pull the part of the Bash source code
responsible for the "operate-and-get-next" feature into R interface.
See the following link:

http://r.789695.n4.nabble.com/readline-operate-and-get-next-td2317208...

@kwankyu
Copy link
Collaborator Author

kwankyu commented Nov 23, 2010

comment:3

A preliminary version of the patch was uploaded. See the doc in the patch for how to bind the new readline commands with keys.

I am wondering how to doctest this module.

Things to do: add more comments and doctests.

I copied some programming logic from the Bash shell source files, in particular, from"bashline.c", and the GNU Readline source files, in particular from the file "misc.c". Check the copyright things, although I think there is no problem.

@kwankyu
Copy link
Collaborator Author

kwankyu commented Nov 23, 2010

comment:4

Note the last two commands in the patch implements the up and down arrow keys in Magma.

@kwankyu
Copy link
Collaborator Author

kwankyu commented Nov 27, 2010

Author: Kwankyu Lee

@kwankyu kwankyu added this to the sage-4.6.1 milestone Nov 27, 2010
@kwankyu
Copy link
Collaborator Author

kwankyu commented Apr 29, 2011

comment:9

This patch needs work as it does not work on Ubuntu machines. There is no problem with my Mac. On Ubuntu, the patch is compiled well, but produces "no symbol: history_length" error when it is imported on Sage startsup. Cython experts, please help me fix this problem.

@kwankyu
Copy link
Collaborator Author

kwankyu commented Feb 12, 2012

Attachment: trac_10289.patch.gz

rebased on 4.8

@kwankyu
Copy link
Collaborator Author

kwankyu commented Feb 13, 2012

comment:12

I created the ticket #12503 duplicating this ticket, as the patchbot does not work for the patch uploaded here.

Further discussion on this ticket should be continued on #12503.

@kwankyu kwankyu removed this from the sage-5.0 milestone Feb 16, 2012
@jdemeyer

This comment has been minimized.

@jdemeyer
Copy link

Reviewer: Kwankyu Lee

@jdemeyer
Copy link

Changed author from Kwankyu Lee to none

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

3 participants