[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 04/13] lib/readline/doc/history.3: Replace blank lines with macro
From: |
G. Branden Robinson |
Subject: |
[PATCH 04/13] lib/readline/doc/history.3: Replace blank lines with macro calls. |
Date: |
Thu, 28 Mar 2024 16:11:28 -0500 |
When formatting for typesetters, a blank input line produces 1 vee (one
line height, basically) of vertical space, but the default
inter-paragraph distance in man(7) is 0.4v.
Fixes numerous style warnings from "nroff -rCHECKSTYLE=3 -man" in groff
1.23.0 of the following form.
an.tmac:lib/readline/doc/history.3:xxx: style: blank line in input
---
lib/readline/doc/history.3 | 93 +++++++++++++++++++-------------------
1 file changed, 46 insertions(+), 47 deletions(-)
diff --git a/lib/readline/doc/history.3 b/lib/readline/doc/history.3
index 266d91f6..76703833 100644
--- a/lib/readline/doc/history.3
+++ b/lib/readline/doc/history.3
@@ -393,89 +393,89 @@ .SS Initializing History and State Management
This section describes functions used to initialize and manage
the state of the History library when you want to use the history
functions in your program.
-
+.PP
.F1 void using_history void
Begin a session in which the history functions might be used. This
initializes the interactive variables.
-
+.PP
.F1 "HISTORY_STATE *" history_get_history_state void
Return a structure describing the current state of the input history.
-
+.PP
.F1 void history_set_history_state "HISTORY_STATE *state"
Set the state of the history list according to \fIstate\fP.
.SS History List Management
These functions manage individual entries on the history list, or set
parameters managing the list itself.
-
+.PP
.F1 void add_history "const char *string"
Place \fIstring\fP at the end of the history list. The associated data
field (if any) is set to \fBNULL\fP.
If the maximum number of history entries has been set using
\fBstifle_history()\fP, and the new number of history entries would exceed
that maximum, the oldest history entry is removed.
-
+.PP
.F1 void add_history_time "const char *string"
Change the time stamp associated with the most recent history entry to
\fIstring\fP.
-
+.PP
.F1 "HIST_ENTRY *" remove_history "int which"
Remove history entry at offset \fIwhich\fP from the history. The
removed element is returned so you can free the line, data,
and containing structure.
-
+.PP
.F1 "histdata_t" free_history_entry "HIST_ENTRY *histent"
Free the history entry \fIhistent\fP and any history library private
data associated with it. Returns the application-specific data
so the caller can dispose of it.
-
+.PP
.F3 "HIST_ENTRY *" replace_history_entry "int which" "const char *line"
"histdata_t data"
Make the history entry at offset \fIwhich\fP have \fIline\fP and \fIdata\fP.
This returns the old entry so the caller can dispose of any
application-specific data. In the case
of an invalid \fIwhich\fP, a \fBNULL\fP pointer is returned.
-
+.PP
.F1 void clear_history "void"
Clear the history list by deleting all the entries.
-
+.PP
.F1 void stifle_history "int max"
Stifle the history list, remembering only the last \fImax\fP entries.
The history list will contain only \fImax\fP entries at a time.
-
+.PP
.F1 int unstifle_history "void"
Stop stifling the history. This returns the previously-set
maximum number of history entries (as set by \fBstifle_history()\fP).
history was stifled. The value is positive if the history was
stifled, negative if it wasn't.
-
+.PP
.F1 int history_is_stifled "void"
Returns non-zero if the history is stifled, zero if it is not.
.SS Information About the History List
These functions return information about the entire history list or
individual list entries.
-
+.PP
.F1 "HIST_ENTRY **" history_list "void"
Return a \fBNULL\fP terminated array of \fIHIST_ENTRY *\fP which is the
current input history. Element 0 of this list is the beginning of time.
If there is no history, return \fBNULL\fP.
-
+.PP
.F1 int where_history "void"
Returns the offset of the current history element.
-
+.PP
.F1 "HIST_ENTRY *" current_history "void"
Return the history entry at the current position, as determined by
\fBwhere_history()\fP. If there is no entry there, return a \fBNULL\fP
pointer.
-
+.PP
.F1 "HIST_ENTRY *" history_get "int offset"
Return the history entry at position \fIoffset\fP.
The range of valid values of \fIoffset\fP starts at \fBhistory_base\fP
and ends at \fBhistory_length\fP \- 1.
If there is no entry there, or if \fIoffset\fP is outside the valid
range, return a \fBNULL\fP pointer.
-
+.PP
.F1 "time_t" history_get_time "HIST_ENTRY *"
Return the time stamp associated with the history entry passed as the argument.
-
+.PP
.F1 int history_total_bytes "void"
Return the number of bytes that the primary history entries are using.
This function returns the sum of the lengths of all the lines in the
@@ -483,18 +483,18 @@ .SS Information About the History List
.SS Moving Around the History List
These functions allow the current index into the history list to be
set or changed.
-
+.PP
.F1 int history_set_pos "int pos"
Set the current history offset to \fIpos\fP, an absolute index
into the list.
Returns 1 on success, 0 if \fIpos\fP is less than zero or greater
than the number of history entries.
-
+.PP
.F1 "HIST_ENTRY *" previous_history "void"
Back up the current history offset to the previous history entry, and
return a pointer to that entry. If there is no previous entry, return
a \fBNULL\fP pointer.
-
+.PP
.F1 "HIST_ENTRY *" next_history "void"
If the current history offset refers to a valid history entry,
increment the current history offset.
@@ -506,7 +506,7 @@ .SS Searching the History List
a specific string. Searching may be performed both forward and backward
from the current history position. The search may be \fIanchored\fP,
meaning that the string must match at the beginning of the history entry.
-
+.PP
.F2 int history_search "const char *string" "int direction"
Search the history for \fIstring\fP, starting at the current history offset.
If \fIdirection\fP is less than 0, then the search is through
@@ -516,7 +516,7 @@ .SS Searching the History List
returned is the offset in the line of the entry where
\fIstring\fP was found. Otherwise, nothing is changed, and a -1 is
returned.
-
+.PP
.F2 int history_search_prefix "const char *string" "int direction"
Search the history for \fIstring\fP, starting at the current history
offset. The search is anchored: matching lines must begin with
@@ -525,7 +525,7 @@ .SS Searching the History List
If \fIstring\fP is found, then the
current history index is set to that entry, and the return value is 0.
Otherwise, nothing is changed, and a -1 is returned.
-
+.PP
.F3 int history_search_pos "const char *string" "int direction" "int pos"
Search for \fIstring\fP in the history list, starting at \fIpos\fP, an
absolute index into the list. If \fIdirection\fP is negative, the search
@@ -534,12 +534,12 @@ .SS Searching the History List
.SS Managing the History File
The History library can read the history from and write it to a file.
This section documents the functions for managing a history file.
-
+.PP
.F1 int read_history "const char *filename"
Add the contents of \fIfilename\fP to the history list, a line at a time.
If \fIfilename\fP is \fBNULL\fP, then read from \fI\*~/.history\fP.
Returns 0 if successful, or \fBerrno\fP if not.
-
+.PP
.F3 int read_history_range "const char *filename" "int from" "int to"
Read a range of lines from \fIfilename\fP, adding them to the history list.
Start reading at line \fIfrom\fP and end at \fIto\fP.
@@ -547,19 +547,18 @@ .SS Managing the History File
\fIfrom\fP, then read until the end of the file. If \fIfilename\fP is
\fBNULL\fP, then read from \fI\*~/.history\fP. Returns 0 if successful,
or \fBerrno\fP if not.
-
+.PP
.F1 int write_history "const char *filename"
Write the current history to \fIfilename\fP, overwriting \fIfilename\fP
if necessary.
If \fIfilename\fP is \fBNULL\fP, then write the history list to
\fI\*~/.history\fP.
Returns 0 on success, or \fBerrno\fP on a read or write error.
-
-
+.PP
.F2 int append_history "int nelements" "const char *filename"
Append the last \fInelements\fP of the history list to \fIfilename\fP.
If \fIfilename\fP is \fBNULL\fP, then append to \fI\*~/.history\fP.
Returns 0 on success, or \fBerrno\fP on a read or write error.
-
+.PP
.F2 int history_truncate_file "const char *filename" "int nlines"
Truncate the history file \fIfilename\fP, leaving only the last
\fInlines\fP lines.
@@ -567,7 +566,7 @@ .SS Managing the History File
Returns 0 on success, or \fBerrno\fP on failure.
.SS History Expansion
These functions implement history expansion.
-
+.PP
.F2 int history_expand "const char *string" "char **output"
Expand \fIstring\fP, placing the result into \fIoutput\fP, a pointer
to a string. Returns:
@@ -592,7 +591,7 @@ .SS History Expansion
.RE
If an error occurred in expansion, then \fIoutput\fP contains a descriptive
error message.
-
+.PP
.F3 "char *" get_history_event "const char *string" "int *cindex" "int qchar"
Returns the text of the history event beginning at \fIstring\fP +
\fI*cindex\fP. \fI*cindex\fP is modified to point to after the event
@@ -600,14 +599,14 @@ .SS History Expansion
\fIstring\fP where the history event specification begins. \fIqchar\fP
is a character that is allowed to end the event specification in addition
to the ``normal'' terminating characters.
-
+.PP
.F1 "char **" history_tokenize "const char *string"
Return an array of tokens parsed out of \fIstring\fP, much as the
shell might.
The tokens are split on the characters in the
\fBhistory_word_delimiters\fP variable,
and shell quoting conventions are obeyed.
-
+.PP
.F3 "char *" history_arg_extract "int first" "int last" "const char *string"
Extract a string segment consisting of the \fIfirst\fP through \fIlast\fP
arguments present in \fIstring\fP. Arguments are split using
@@ -615,17 +614,17 @@ .SS History Expansion
.SS History Variables
This section describes the externally-visible variables exported by
the GNU History Library.
-
+.PP
.Vb int history_base
The logical offset of the first entry in the history list.
-
+.PP
.Vb int history_length
The number of entries currently stored in the history list.
-
+.PP
.Vb int history_max_entries
The maximum number of history entries. This must be changed using
\fBstifle_history()\fP.
-
+.PP
.Vb int history_write_timestamps
If non-zero, timestamps are written to the history file, so they can be
preserved between sessions. The default value is 0, meaning that
@@ -633,35 +632,35 @@ .SS History Variables
The current timestamp format uses the value of \fIhistory_comment_char\fP
to delimit timestamp entries in the history file. If that variable does
not have a value (the default), timestamps will not be written.
-
+.PP
.Vb char history_expansion_char
The character that introduces a history event. The default is \fB!\fP.
Setting this to 0 inhibits history expansion.
-
+.PP
.Vb char history_subst_char
The character that invokes word substitution if found at the start of
a line. The default is \fB\*^\fP.
-
+.PP
.Vb char history_comment_char
During tokenization, if this character is seen as the first character
of a word, then it and all subsequent characters up to a newline are
ignored, suppressing history expansion for the remainder of the line.
This is disabled by default.
-
+.PP
.Vb "char *" history_word_delimiters
The characters that separate tokens for \fBhistory_tokenize()\fP.
The default value is \fB\*"\ \et\en()<>;&|\*"\fP.
-
+.PP
.Vb "char *" history_no_expand_chars
The list of characters which inhibit history expansion if found immediately
following \fBhistory_expansion_char\fP. The default is space, tab, newline,
\fB\er\fP, and \fB=\fP.
-
+.PP
.Vb "char *" history_search_delimiter_chars
The list of additional characters which can delimit a history search
string, in addition to space, tab, \fI:\fP and \fI?\fP in the case of
a substring search. The default is empty.
-
+.PP
.Vb int history_quotes_inhibit_expansion
If non-zero, the history expansion code implements shell-like quoting:
single-quoted words are not scanned for the history expansion
@@ -669,7 +668,7 @@ .SS History Variables
have history expansion performed, since single quotes are not special
within double quotes.
The default value is 0.
-
+.PP
.Vb int history_quoting_state
An application may set this variable to indicate that the current line
being expanded is subject to existing quoting. If set to \fI\*'\fP, the
@@ -680,7 +679,7 @@ .SS History Variables
the history expansion function will assume the line is not quoted and
treat quote characters within the line as described above.
This is only effective if \fBhistory_quotes_inhibit_expansion\fP is set.
-
+.PP
.Vb "rl_linebuf_func_t *" history_inhibit_expansion_function
This should be set to the address of a function that takes two arguments:
a \fBchar *\fP (\fIstring\fP)
--
2.30.2
signature.asc
Description: PGP signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH 04/13] lib/readline/doc/history.3: Replace blank lines with macro calls.,
G. Branden Robinson <=