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

Addition to readline module to get dictionary of keystrokes and commands #52738

Open
MLModel mannequin opened this issue Apr 21, 2010 · 3 comments
Open

Addition to readline module to get dictionary of keystrokes and commands #52738

MLModel mannequin opened this issue Apr 21, 2010 · 3 comments
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@MLModel
Copy link
Mannequin

MLModel mannequin commented Apr 21, 2010

BPO 8492
Nosy @merwok, @MLModel, @stevendaprano, @asvetlov

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2010-04-21.20:02:06.154>
labels = ['type-feature', 'library']
title = 'Addition to readline module to get dictionary of keystrokes and commands'
updated_at = <Date 2012-10-11.20:59:37.980>
user = 'https://github.com/MLModel'

bugs.python.org fields:

activity = <Date 2012-10-11.20:59:37.980>
actor = 'anand.jeyahar'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2010-04-21.20:02:06.154>
creator = 'MLModel'
dependencies = []
files = []
hgrepos = []
issue_num = 8492
keywords = []
message_count = 3.0
messages = ['103905', '172090', '172692']
nosy_count = 5.0
nosy_names = ['eric.araujo', 'MLModel', 'steven.daprano', 'asvetlov', 'anand.jeyahar']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue8492'
versions = ['Python 3.4']

@MLModel
Copy link
Mannequin Author

MLModel mannequin commented Apr 21, 2010

Requesting a function to be added to the readline module that produces a dictionary of the current keystroke bindings Also, one to write it to a file in readline init file format. This would be a big help for people interested in customizing the behavior of readline inside Python.

@MLModel MLModel mannequin added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Apr 21, 2010
@stevendaprano
Copy link
Member

A question came up on Python-ideas about readline apparently missing a standard function. See:

http://mail.python.org/pipermail/python-ideas/2012-October/016329.html

For debugging issues with readline, it would be be very useful to be able to query the current set of bindings. This would also help people avoid accidentally over-writing existing bindings.

I suggest emulating the three bash commands:

bind -p # List functions and bindings in a form that can be reused as input.
bind -v # As above for variable names and values.
bind -s # As above for macros and values.

@anandjeyahar
Copy link
Mannequin

anandjeyahar mannequin commented Oct 11, 2012

Here's what the original maintainer chet romney had to say about this functionality not being a part of readline, and should be implemented by the calling application. From Chet Ramey:
----------
The answer is that 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.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant