summaryrefslogtreecommitdiff
path: root/doc/history.info
diff options
context:
space:
mode:
Diffstat (limited to 'doc/history.info')
-rw-r--r--doc/history.info175
1 files changed, 108 insertions, 67 deletions
diff --git a/doc/history.info b/doc/history.info
index 6df0bd9..9266a5d 100644
--- a/doc/history.info
+++ b/doc/history.info
@@ -1,11 +1,12 @@
This is Info file history.info, produced by Makeinfo-1.55 from the
-input file hist.texinfo.
+input file /usr/homes/chet/src/bash/readline-2.1/doc/hist.texinfo.
This document describes the GNU History library, a programming tool
that provides a consistent user interface for recalling lines of
previously typed input.
- Copyright (C) 1988, 1991 Free Software Foundation, Inc.
+ Copyright (C) 1988, 1991, 1993, 1995, 1996 Free Software Foundation,
+Inc.
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice pare
@@ -57,21 +58,29 @@ own programs, *note Programming with GNU History::..

File: history.info, Node: History Interaction, Up: Using History Interactively
-History Interaction
-===================
+Interactive History Expansion
+=============================
The History library provides a history expansion feature that is
-similar to the history expansion provided by `csh'. The following text
+similar to the history expansion provided by `csh'. This section
describes the syntax used to manipulate the history information.
+ History expansions introduce words from the history list into the
+input stream, making it easy to repeat commands, insert the arguments
+to a previous command into the current input line, or fix errors in
+previous commands quickly.
+
History expansion takes place in two parts. The first is to
determine which line from the previous history should be used during
substitution. The second is to select portions of that line for
inclusion into the current one. The line selected from the previous
history is called the "event", and the portions of that line that are
-acted upon are called "words". The line is broken into words in the
+acted upon are called "words". Various "modifiers" are available to
+manipulate the selected words. The line is broken into words in the
same fashion that Bash does, so that several English (or Unix) words
-surrounded by quotes are considered as one word.
+surrounded by quotes are considered as one word. History expansions
+are introduced by the appearance of the history expansion character,
+which is `!' by default.
* Menu:
@@ -92,67 +101,74 @@ history list.
Start a history substitution, except when followed by a space, tab,
the end of the line, = or (.
-`!!'
- Refer to the previous command. This is a synonym for `!-1'.
-
-`!n'
+`!N'
Refer to command line N.
-`!-n'
+`!-N'
Refer to the command N lines back.
-`!string'
+`!!'
+ Refer to the previous command. This is a synonym for `!-1'.
+
+`!STRING'
Refer to the most recent command starting with STRING.
-`!?string'[`?']
- Refer to the most recent command containing STRING.
+`!?STRING[?]'
+ Refer to the most recent command containing STRING. The trailing
+ `?' may be omitted if the STRING is followed immediately by a
+ newline.
+
+`^STRING1^STRING2^'
+ Quick Substitution. Repeat the last command, replacing STRING1
+ with STRING2. Equivalent to `!!:s/STRING1/STRING2/'.
`!#'
The entire command line typed so far.
-`^string1^string2^'
- Quick Substitution. Repeat the last command, replacing STRING1
- with STRING2. Equivalent to `!!:s/string1/string2/'.
-

File: history.info, Node: Word Designators, Next: Modifiers, Prev: Event Designators, Up: History Interaction
Word Designators
----------------
- A : separates the event specification from the word designator. It
-can be omitted if the word designator begins with a ^, $, * or %.
-Words are numbered from the beginning of the line, with the first word
-being denoted by a 0 (zero).
+ Word designators are used to select desired words from the event. A
+`:' separates the event specification from the word designator. It can
+be omitted if the word designator begins with a `^', `$', `*', `-', or
+`%'. Words are numbered from the beginning of the line, with the first
+word being denoted by 0 (zero). Words are inserted into the current
+line separated by single spaces.
`0 (zero)'
The `0'th word. For many applications, this is the command word.
-`n'
+`N'
The Nth word.
`^'
- The first argument; that is, word 1.
+ The first argument; that is, word 1.
`$'
The last argument.
`%'
- The word matched by the most recent `?string?' search.
+ The word matched by the most recent `?STRING?' search.
-`x-y'
+`X-Y'
A range of words; `-Y' abbreviates `0-Y'.
`*'
All of the words, except the `0'th. This is a synonym for `1-$'.
- It is not an error to use * if there is just one word in the event;
- the empty string is returned in that case.
+ It is not an error to use `*' if there is just one word in the
+ event; the empty string is returned in that case.
-`x*'
- Abbreviates `x-$'
+`X*'
+ Abbreviates `X-$'
-`x-'
- Abbreviates `x-$' like `x*', but omits the last word.
+`X-'
+ Abbreviates `X-$' like `X*', but omits the last word.
+
+ If a word designator is supplied without an event specification, the
+previous command is used as the event.

File: history.info, Node: Modifiers, Prev: Word Designators, Up: History Interaction
@@ -161,38 +177,38 @@ Modifiers
---------
After the optional word designator, you can add a sequence of one or
-more of the following modifiers, each preceded by a :.
+more of the following modifiers, each preceded by a `:'.
`h'
Remove a trailing pathname component, leaving only the head.
+`t'
+ Remove all leading pathname components, leaving the tail.
+
`r'
- Remove a trailing suffix of the form `.'SUFFIX, leaving the
+ Remove a trailing suffix of the form `.SUFFIX', leaving the
basename.
`e'
Remove all but the trailing suffix.
-`t'
- Remove all leading pathname components, leaving the tail.
-
`p'
Print the new command but do not execute it.
-`s/old/new/'
+`s/OLD/NEW/'
Substitute NEW for the first occurrence of OLD in the event line.
- Any delimiter may be used in place of /. The delimiter may be
- quoted in OLD and NEW with a single backslash. If & appears in
- NEW, it is replaced by OLD. A single backslash will quote the &.
- The final delimiter is optional if it is the last character on the
- input line.
+ Any delimiter may be used in place of `/'. The delimiter may be
+ quoted in OLD and NEW with a single backslash. If `&' appears in
+ NEW, it is replaced by OLD. A single backslash will quote the
+ `&'. The final delimiter is optional if it is the last character
+ on the input line.
`&'
Repeat the previous substitution.
`g'
Cause changes to be applied over the entire event line. Used in
- conjunction with `s', as in `gs/old/new/', or with `&'.
+ conjunction with `s', as in `gs/OLD/NEW/', or with `&'.

File: history.info, Node: Programming with GNU History, Next: Concept Index, Prev: Using History Interactively, Up: Top
@@ -347,6 +363,9 @@ parameters managing the list itself.
returns the old entry so you can dispose of the data. In the case
of an invalid WHICH, a `NULL' pointer is returned.
+ - Function: void clear_history ()
+ Clear the history list by deleting all the entries.
+
- Function: void stifle_history (int max)
Stifle the history list, remembering only the last MAX entries.
@@ -567,6 +586,24 @@ the GNU History Library.
immediately following HISTORY_EXPANSION_CHAR. The default is
whitespace and `='.
+ - Variable: char * history_search_delimiter_chars
+ The list of additional characters which can delimit a history
+ search string, in addition to whitespace, `:' and `?' in the case
+ of a substring search. The default is empty.
+
+ - Variable: int history_quotes_inhibit_expansion
+ If non-zero, single-quoted words are not scanned for the history
+ expansion character. The default value is 0.
+
+ - Variable: Function * history_inhibit_expansion_function
+ This should be set to the address of a function that takes two
+ arguments: a `char *' (STRING) and an integer index into that
+ string (I). It should return a non-zero value if the history
+ expansion starting at STRING[I] should not be performed; zero if
+ the expansion should be done. It is intended for use by
+ applications like Bash that use the history expansion character
+ for additional purposes. By default, this variable is set to NULL.
+

File: history.info, Node: History Programming Example, Prev: History Variables, Up: Programming with GNU History
@@ -667,8 +704,8 @@ Concept Index
* anchored search: Searching the History List.
* event designators: Event Designators.
-* expansion: History Interaction.
* history events: Event Designators.
+* history expansion: History Interaction.
* History Searching: Searching the History List.

@@ -681,6 +718,7 @@ Function and Variable Index
* add_history: History List Management.
* append_history: Managing the History File.
+* clear_history: History List Management.
* current_history: Information About the History List.
* get_history_event: History Expansion.
* history_arg_extract: History Expansion.
@@ -690,11 +728,14 @@ Function and Variable Index
* history_expansion_char: History Variables.
* history_get: Information About the History List.
* history_get_history_state: Initializing History and State Management.
+* history_inhibit_expansion_function: History Variables.
* history_is_stifled: History List Management.
* history_length: History Variables.
* history_list: Information About the History List.
* history_no_expand_chars: History Variables.
+* history_quotes_inhibit_expansion: History Variables.
* history_search: Searching the History List.
+* history_search_delimiter_chars: History Variables.
* history_search_pos: Searching the History List.
* history_search_prefix: Searching the History List.
* history_set_history_state: Initializing History and State Management.
@@ -719,26 +760,26 @@ Function and Variable Index

Tag Table:
-Node: Top975
-Node: Using History Interactively1569
-Node: History Interaction2077
-Node: Event Designators3122
-Node: Word Designators3952
-Node: Modifiers4936
-Node: Programming with GNU History6065
-Node: Introduction to History6791
-Node: History Storage8112
-Node: History Functions9205
-Node: Initializing History and State Management10176
-Node: History List Management10968
-Node: Information About the History List12396
-Node: Moving Around the History List13702
-Node: Searching the History List14587
-Node: Managing the History File16419
-Node: History Expansion17925
-Node: History Variables19769
-Node: History Programming Example21138
-Node: Concept Index23742
-Node: Function and Variable Index24223
+Node: Top1035
+Node: Using History Interactively1629
+Node: History Interaction2137
+Node: Event Designators3614
+Node: Word Designators4537
+Node: Modifiers5786
+Node: Programming with GNU History6924
+Node: Introduction to History7650
+Node: History Storage8971
+Node: History Functions10064
+Node: Initializing History and State Management11035
+Node: History List Management11827
+Node: Information About the History List13348
+Node: Moving Around the History List14654
+Node: Searching the History List15539
+Node: Managing the History File17371
+Node: History Expansion18877
+Node: History Variables20721
+Node: History Programming Example23039
+Node: Concept Index25643
+Node: Function and Variable Index26124

End Tag Table