mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-101100: Fix sphinx warnings in readline.rst
(#130300)
This commit is contained in:
parent
048ee2d5ec
commit
3bda821a83
2 changed files with 23 additions and 24 deletions
|
@ -65,13 +65,13 @@ The following functions relate to the init file and user configuration:
|
|||
.. function:: parse_and_bind(string)
|
||||
|
||||
Execute the init line provided in the *string* argument. This calls
|
||||
:c:func:`rl_parse_and_bind` in the underlying library.
|
||||
:c:func:`!rl_parse_and_bind` in the underlying library.
|
||||
|
||||
|
||||
.. function:: read_init_file([filename])
|
||||
|
||||
Execute a readline initialization file. The default filename is the last filename
|
||||
used. This calls :c:func:`rl_read_init_file` in the underlying library.
|
||||
used. This calls :c:func:`!rl_read_init_file` in the underlying library.
|
||||
|
||||
|
||||
Line buffer
|
||||
|
@ -82,21 +82,21 @@ The following functions operate on the line buffer:
|
|||
|
||||
.. function:: get_line_buffer()
|
||||
|
||||
Return the current contents of the line buffer (:c:data:`rl_line_buffer`
|
||||
Return the current contents of the line buffer (:c:data:`!rl_line_buffer`
|
||||
in the underlying library).
|
||||
|
||||
|
||||
.. function:: insert_text(string)
|
||||
|
||||
Insert text into the line buffer at the cursor position. This calls
|
||||
:c:func:`rl_insert_text` in the underlying library, but ignores
|
||||
:c:func:`!rl_insert_text` in the underlying library, but ignores
|
||||
the return value.
|
||||
|
||||
|
||||
.. function:: redisplay()
|
||||
|
||||
Change what's displayed on the screen to reflect the current contents of the
|
||||
line buffer. This calls :c:func:`rl_redisplay` in the underlying library.
|
||||
line buffer. This calls :c:func:`!rl_redisplay` in the underlying library.
|
||||
|
||||
|
||||
History file
|
||||
|
@ -109,21 +109,21 @@ The following functions operate on a history file:
|
|||
|
||||
Load a readline history file, and append it to the history list.
|
||||
The default filename is :file:`~/.history`. This calls
|
||||
:c:func:`read_history` in the underlying library.
|
||||
:c:func:`!read_history` in the underlying library.
|
||||
|
||||
|
||||
.. function:: write_history_file([filename])
|
||||
|
||||
Save the history list to a readline history file, overwriting any
|
||||
existing file. The default filename is :file:`~/.history`. This calls
|
||||
:c:func:`write_history` in the underlying library.
|
||||
:c:func:`!write_history` in the underlying library.
|
||||
|
||||
|
||||
.. function:: append_history_file(nelements[, filename])
|
||||
|
||||
Append the last *nelements* items of history to a file. The default filename is
|
||||
:file:`~/.history`. The file must already exist. This calls
|
||||
:c:func:`append_history` in the underlying library. This function
|
||||
:c:func:`!append_history` in the underlying library. This function
|
||||
only exists if Python was compiled for a version of the library
|
||||
that supports it.
|
||||
|
||||
|
@ -135,7 +135,7 @@ The following functions operate on a history file:
|
|||
|
||||
Set or return the desired number of lines to save in the history file.
|
||||
The :func:`write_history_file` function uses this value to truncate
|
||||
the history file, by calling :c:func:`history_truncate_file` in
|
||||
the history file, by calling :c:func:`!history_truncate_file` in
|
||||
the underlying library. Negative values imply
|
||||
unlimited history file size.
|
||||
|
||||
|
@ -148,7 +148,7 @@ The following functions operate on a global history list:
|
|||
|
||||
.. function:: clear_history()
|
||||
|
||||
Clear the current history. This calls :c:func:`clear_history` in the
|
||||
Clear the current history. This calls :c:func:`!clear_history` in the
|
||||
underlying library. The Python function only exists if Python was
|
||||
compiled for a version of the library that supports it.
|
||||
|
||||
|
@ -163,32 +163,32 @@ The following functions operate on a global history list:
|
|||
.. function:: get_history_item(index)
|
||||
|
||||
Return the current contents of history item at *index*. The item index
|
||||
is one-based. This calls :c:func:`history_get` in the underlying library.
|
||||
is one-based. This calls :c:func:`!history_get` in the underlying library.
|
||||
|
||||
|
||||
.. function:: remove_history_item(pos)
|
||||
|
||||
Remove history item specified by its position from the history.
|
||||
The position is zero-based. This calls :c:func:`remove_history` in
|
||||
The position is zero-based. This calls :c:func:`!remove_history` in
|
||||
the underlying library.
|
||||
|
||||
|
||||
.. function:: replace_history_item(pos, line)
|
||||
|
||||
Replace history item specified by its position with *line*.
|
||||
The position is zero-based. This calls :c:func:`replace_history_entry`
|
||||
The position is zero-based. This calls :c:func:`!replace_history_entry`
|
||||
in the underlying library.
|
||||
|
||||
|
||||
.. function:: add_history(line)
|
||||
|
||||
Append *line* to the history buffer, as if it was the last line typed.
|
||||
This calls :c:func:`add_history` in the underlying library.
|
||||
This calls :c:func:`!add_history` in the underlying library.
|
||||
|
||||
|
||||
.. function:: set_auto_history(enabled)
|
||||
|
||||
Enable or disable automatic calls to :c:func:`add_history` when reading
|
||||
Enable or disable automatic calls to :c:func:`!add_history` when reading
|
||||
input via readline. The *enabled* argument should be a Boolean value
|
||||
that when true, enables auto history, and that when false, disables
|
||||
auto history.
|
||||
|
@ -206,7 +206,7 @@ Startup hooks
|
|||
|
||||
.. function:: set_startup_hook([function])
|
||||
|
||||
Set or remove the function invoked by the :c:data:`rl_startup_hook`
|
||||
Set or remove the function invoked by the :c:data:`!rl_startup_hook`
|
||||
callback of the underlying library. If *function* is specified, it will
|
||||
be used as the new hook function; if omitted or ``None``, any function
|
||||
already installed is removed. The hook is called with no
|
||||
|
@ -215,7 +215,7 @@ Startup hooks
|
|||
|
||||
.. function:: set_pre_input_hook([function])
|
||||
|
||||
Set or remove the function invoked by the :c:data:`rl_pre_input_hook`
|
||||
Set or remove the function invoked by the :c:data:`!rl_pre_input_hook`
|
||||
callback of the underlying library. If *function* is specified, it will
|
||||
be used as the new hook function; if omitted or ``None``, any
|
||||
function already installed is removed. The hook is called
|
||||
|
@ -247,9 +247,9 @@ with a custom completer, a different set of word delimiters should be set.
|
|||
starting with *text*.
|
||||
|
||||
The installed completer function is invoked by the *entry_func* callback
|
||||
passed to :c:func:`rl_completion_matches` in the underlying library.
|
||||
passed to :c:func:`!rl_completion_matches` in the underlying library.
|
||||
The *text* string comes from the first parameter to the
|
||||
:c:data:`rl_attempted_completion_function` callback of the
|
||||
:c:data:`!rl_attempted_completion_function` callback of the
|
||||
underlying library.
|
||||
|
||||
|
||||
|
@ -261,7 +261,7 @@ with a custom completer, a different set of word delimiters should be set.
|
|||
.. function:: get_completion_type()
|
||||
|
||||
Get the type of completion being attempted. This returns the
|
||||
:c:data:`rl_completion_type` variable in the underlying library as
|
||||
:c:data:`!rl_completion_type` variable in the underlying library as
|
||||
an integer.
|
||||
|
||||
|
||||
|
@ -270,7 +270,7 @@ with a custom completer, a different set of word delimiters should be set.
|
|||
|
||||
Get the beginning or ending index of the completion scope.
|
||||
These indexes are the *start* and *end* arguments passed to the
|
||||
:c:data:`rl_attempted_completion_function` callback of the
|
||||
:c:data:`!rl_attempted_completion_function` callback of the
|
||||
underlying library. The values may be different in the same
|
||||
input editing scenario based on the underlying C readline implementation.
|
||||
Ex: libedit is known to behave differently than libreadline.
|
||||
|
@ -281,7 +281,7 @@ with a custom completer, a different set of word delimiters should be set.
|
|||
|
||||
Set or get the word delimiters for completion. These determine the
|
||||
start of the word to be considered for completion (the completion scope).
|
||||
These functions access the :c:data:`rl_completer_word_break_characters`
|
||||
These functions access the :c:data:`!rl_completer_word_break_characters`
|
||||
variable in the underlying library.
|
||||
|
||||
|
||||
|
@ -291,7 +291,7 @@ with a custom completer, a different set of word delimiters should be set.
|
|||
specified, it will be used as the new completion display function;
|
||||
if omitted or ``None``, any completion display function already
|
||||
installed is removed. This sets or clears the
|
||||
:c:data:`rl_completion_display_matches_hook` callback in the
|
||||
:c:data:`!rl_completion_display_matches_hook` callback in the
|
||||
underlying library. The completion display function is called as
|
||||
``function(substitution, [matches], longest_match_length)`` once
|
||||
each time matches need to be displayed.
|
||||
|
|
|
@ -38,7 +38,6 @@ Doc/library/platform.rst
|
|||
Doc/library/plistlib.rst
|
||||
Doc/library/profile.rst
|
||||
Doc/library/pyexpat.rst
|
||||
Doc/library/readline.rst
|
||||
Doc/library/resource.rst
|
||||
Doc/library/select.rst
|
||||
Doc/library/signal.rst
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue