Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
e7a9796a
Commit
e7a9796a
authored
Sep 20, 2003
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch #800697: Add readline.clear_history.
parent
c6bb6c0f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
0 deletions
+29
-0
Doc/lib/libreadline.tex
Doc/lib/libreadline.tex
+6
-0
Misc/NEWS
Misc/NEWS
+2
-0
Modules/readline.c
Modules/readline.c
+21
-0
No files found.
Doc/lib/libreadline.tex
View file @
e7a9796a
...
...
@@ -42,6 +42,12 @@ Save a readline history file.
The default filename is
\file
{
\~
{}
/.history
}
.
\end{funcdesc}
\begin{funcdesc}
{
clear
_
history
}{}
Clear the current history. (Note: this function is not available if
the installed version of GNU readline doesn't support it.)
\versionadded
{
2.4
}
\end{funcdesc}
\begin{funcdesc}
{
get
_
history
_
length
}{}
Return the desired length of the history file. Negative values imply
unlimited history file size.
...
...
Misc/NEWS
View file @
e7a9796a
...
...
@@ -29,6 +29,8 @@ Core and builtins
Extension
modules
-----------------
-
readline
.
clear_history
was
added
.
-
select
.
select
()
now
accepts
sequences
for
its
first
three
arguments
.
-
cStringIO
now
supports
the
f
.
closed
attribute
.
...
...
Modules/readline.c
View file @
e7a9796a
...
...
@@ -412,6 +412,24 @@ PyDoc_STRVAR(doc_get_line_buffer,
return the current contents of the line buffer."
);
#ifdef HAVE_RL_COMPLETION_APPEND_CHARACTER
/* Exported function to clear the current history */
static
PyObject
*
py_clear_history
(
PyObject
*
self
,
PyObject
*
noarg
)
{
clear_history
();
Py_INCREF
(
Py_None
);
return
Py_None
;
}
PyDoc_STRVAR
(
doc_clear_history
,
"clear_history() -> None
\n
\
Clear the current readline history."
);
#endif
/* Exported function to insert text into the line buffer */
static
PyObject
*
...
...
@@ -483,6 +501,9 @@ static struct PyMethodDef readline_methods[] =
#ifdef HAVE_RL_PRE_INPUT_HOOK
{
"set_pre_input_hook"
,
set_pre_input_hook
,
METH_VARARGS
,
doc_set_pre_input_hook
},
#endif
#ifdef HAVE_RL_COMPLETION_APPEND_CHARACTER
{
"clear_history"
,
py_clear_history
,
METH_NOARGS
,
doc_clear_history
},
#endif
{
0
,
0
}
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment