Merge local changes

This commit is contained in:
Andrey A. Chernov 1998-04-28 06:49:42 +00:00
parent d3bbabc05a
commit 49772d6129
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=35489
7 changed files with 771 additions and 822 deletions

View File

@ -1,403 +0,0 @@
Tue Mar 23 14:36:51 1993 Brian Fox (bfox@eos.crseo.ucsb.edu)
* readline.c (rl_copy): Changed name to rl_copy_text.
Mon Mar 22 19:16:05 1993 Brian Fox (bfox@eos.crseo.ucsb.edu)
* dispose_cmd.c, several other files. Declare dispose_xxx () as
"void".
* builtins/hashcom.h: Make declarations of hashed_filenames be
"extern" to keep the SGI compiler happy.
* readline.c (rl_initialize_everything): Assign values to
out_stream and in_stream immediately, since
output_character_function () can be called before
readline_internal () is called.
Tue Dec 8 09:30:56 1992 Brian Fox (bfox@cubit)
* readline.c (rl_init_terminal) Set PC from BC, not from *buffer.
Mon Nov 30 09:35:47 1992 Brian Fox (bfox@cubit)
* readline.c (invoking_keyseqs_in_map, rl_parse_and_bind) Allow
backslash to quote characters, such as backslash, double quote,
and space. Backslash quotes all character indiscriminately.
* funmap.c (vi_keymap) Fix type in "vi-replace" declaration.
Fri Nov 20 10:55:05 1992 Brian Fox (bfox@cubit)
* readline.c (init_terminal_io, rl_prep_terminal): FINALLY!
Declare and use termcap variable `ospeed' when setting up terminal
parameters.
Thu Oct 8 08:53:07 1992 Brian J. Fox (bfox@helios)
* Makefile, this directory: Include (as links to the canonical
sources), tilde.c, tilde.h, posixstat.h and xmalloc.c.
Tue Sep 29 13:07:21 1992 Brian J. Fox (bfox@helios)
* readline.c (init_terminal_io) Don't set arrow keys if the key
sequences that represent them are already set.
* readline.c (rl_function_of_keyseq) New function returns the first
function (or macro) found while searching a key sequence.
Mon Sep 28 00:34:04 1992 Brian J. Fox (bfox@helios)
* readline.c (LibraryVersion) New static char * contains current
version number. Version is at 2.0.
* readline.c (rl_complete_internal): Incorporated clean changes
from gilmore (gnu@cygnus.com) to support quoted substrings within
completion functions.
* readline.c (many locations) Added support for the _GO32_,
whatever that is. Patches supplied by Cygnus, typed in by hand,
with cleanups.
Sun Aug 16 12:46:24 1992 Brian Fox (bfox@cubit)
* readline.c (init_terminal_io): Find out the values of the keypad
arrows and bind them to appropriate RL functions if present.
Mon Aug 10 18:13:24 1992 Brian Fox (bfox@cubit)
* history.c (stifle_history): A negative argument to stifle
becomes zero.
Tue Jul 28 09:28:41 1992 Brian Fox (bfox@cubit)
* readline.c (rl_variable_bind): New local structure describes
booleans by name and address; code in rl_variable_bind () looks at
structure to set simple variables.
* parens.c (rl_insert_close): New variable rl_blink_matching_paren
is non-zero if we want to blink the matching open when a close is
inserted. If FD_SET is defined, rl_blink_matching_paren defaults
to 1, else 0. If FD_SET is not defined, and
rl_blink_matching_paren is non-zero, the close character(s) are/is
simply inserted.
Wed Jul 22 20:03:59 1992 Brian Fox (bfox@cubit)
* history.c, readline.c, vi_mode.c: Cause the functions strchr ()
and strrchr () to be used instead of index () and rindex ()
throughout the source.
Mon Jul 13 11:34:07 1992 Brian Fox (bfox@cubit)
* readline.c: (rl_variable_bind) New variable "meta-flag" if "on"
means force the use of the 8th bit as Meta bit. Internal variable
is called meta_flag.
Thu Jul 9 10:37:56 1992 Brian Fox (bfox@cubit)
* history.c (get_history_event) Change INDEX to LOCAL_INDEX. If
compiling for the shell, allow shell metacharacters to separate
history tokens as they would for shell tokens.
Sat Jul 4 19:29:12 1992 Brian Fox (bfox@cubit)
* vi_keymap.c: According to Posix, TAB self-inserts instead of
doing completion.
* vi_mode.c: (rl_vi_yank_arg) Enter VI insert mode after yanking
an arg from the previous line.
* search.c: New file takes over vi style searching and implements
non-incremental searching the history.
Makefile: Add search.c and search.o.
funmap.c: Add names for non-incremental-forward-search-history and
non-incremental-reverse-search-history.
readline.h: Add extern definitions for non-incremental searching.
vi_mode.c: Remove old search code; add calls to code in search.c.
Fri Jul 3 10:36:33 1992 Brian Fox (bfox@cubit)
* readline.c (rl_delete_horizontal_space); New function deletes
all whitespace surrounding point.
funmap.c: Add "delete-horizontal-space".
emacs_keymap.c: Put rl_delete_horizontal_space () on M-\.
* readline.c (rl_set_signals, rl_clear_signals); New function
rl_set_sighandler () is either defined in a Posix way (if
HAVE_POSIX_SIGNALS is defined) or in a BSD way. Function is
called from rl_set_signals () and rl_clear_signals ().
Fri May 8 12:50:15 1992 Brian Fox (bfox@cubit)
* readline.c: (readline_default_bindings) Do comparisons with
_POSIX_VDISABLE casted to `unsigned char'. Change tty characters
to be unsigned char.
Thu Apr 30 12:36:35 1992 Brian Fox (bfox@cubit)
* readline.c: (rl_getc) Handle "read would block" error on
non-blocking IO streams.
* readline.c: (rl_signal_handler): Unblock only the signal that we
have caught, not all signals.
Sun Feb 23 03:33:09 1992 Brian Fox (bfox at gnuwest.fsf.org)
* readline.c: Many functions. Use only the macros META_CHAR and
UNMETA to deal with meta characters. Prior to this, we used
numeric values and tests.
* readline.c (rl_complete_internal) Report exactly the number of
possible completions, not the number + 1.
* vi_mode.c (rl_do_move) Do not change the cursor position when
using `cw' or `cW'.
* vi_mode.c (rl_vi_complete) Enter insert mode after completing
with `*' or `\'.
Fri Feb 21 05:58:18 1992 Brian Fox (bfox at gnuwest.fsf.org)
* readline.c (rl_dispatch) Increment rl_key_sequence_length for
meta characters that map onto ESC map.
Mon Feb 10 01:41:35 1992 Brian Fox (bfox at gnuwest.fsf.org)
* history.c (history_do_write) Build a buffer of all of the lines
to write and write them in one fell swoop (lower overhead than
calling write () for each line). Suggested by Peter Ho.
* readline.c: Include hbullx20 as well as hpux for determining
USGr3ness.
* readline.c (rl_unix_word_rubout) As per the "Now REMEMBER"
comment, pass arguments to rl_kill_text () in the correct order to
preserve prepending and appending of killed text.
* readline.c (rl_search_history) malloc (), realloc (), and free
() SEARCH_STRING so that there are no static limits on searching.
* vi_mode.c (rl_vi_subst) Don't forget to end the undo group.
Fri Jan 31 14:51:02 1992 Brian Fox (bfox at gnuwest.fsf.org)
* readline.c (rl_signal_handler): Zero the current history entry's
pointer after freeing the undo_list when SIGINT received.
Reformat a couple of functions.
Sat Jan 25 13:47:35 1992 Brian Fox (bfox at bears)
* readline.c (parser_if): free () TNAME after use.
Tue Jan 21 01:01:35 1992 Brian Fox (bfox at gnuwest.fsf.org)
* readline.c (rl_redisplay) and (rl_character_len): Display
Control characters as "^c" and Meta characters as "\234", instead
of "C-C" and "M-C".
Sun Dec 29 10:59:00 1991 Brian Fox (bfox at gnuwest.fsf.org)
* readline.c (init_terminal_io) Default to environment variables
LINES and COLUMNS before termcap entry values. If all else fails,
then assume 80x24 terminal.
Sat Dec 28 16:33:11 1991 Brian Fox (bfox at gnuwest.fsf.org)
* readline.c: If this machine is USG and it is hpux, then define
USGr3.
* history.c: Cosmetic fixes.
Thu Nov 21 00:10:12 1991 Brian Fox (bfox at gnuwest.fsf.org)
* vi_mode.c: (rl_do_move) Place cursor at end of line, never at
next to last character.
Thu Nov 14 05:08:01 1991 Brian Fox (bfox at gnuwest.fsf.org)
* history.c (get_history_event) Non-anchored searches can have a
return index of greater than zero from get_history_event ().
Fri Nov 1 07:02:13 1991 Brian Fox (bfox at gnuwest.fsf.org)
* readline.c (rl_translate_keyseq) Make C-? translate to RUBOUT
unconditionally.
Mon Oct 28 11:34:52 1991 Brian Fox (bfox at gnuwest.fsf.org)
* readline.c; Use Posix directory routines and macros.
* funmap.c; Add entry for call-last-kbd-macro.
* readline.c (rl_prep_term); Use system EOF character on POSIX
systems also.
Thu Oct 3 16:19:53 1991 Brian Fox (bfox at gnuwest.fsf.org)
* readline.c; Make a distinction between having a TERMIOS tty
driver, and having POSIX signal handling. You might one without
the other. New defines used HAVE_POSIX_SIGNALS, and
TERMIOS_TTY_DRIVER.
Tue Jul 30 22:37:26 1991 Brian Fox (bfox at gnuwest.fsf.org)
* readline.c: rl_getc () If a call to read () returns without an
error, but with zero characters, the file is empty, so return EOF.
Thu Jul 11 20:58:38 1991 Brian Fox (bfox at gnuwest.fsf.org)
* readline.c: (rl_get_next_history, rl_get_previous_history)
Reallocate the buffer space if the line being moved to is longer
the the current space allocated. Amazing that no one has found
this bug until now.
Sun Jul 7 02:37:05 1991 Brian Fox (bfox at gnuwest.fsf.org)
* readline.c:(rl_parse_and_bind) Allow leading whitespace.
Make sure TERMIO and TERMIOS systems treat CR and NL
disctinctly.
Tue Jun 25 04:09:27 1991 Brian Fox (bfox at gnuwest.fsf.org)
* readline.c: Rework parsing conditionals to pay attention to the
prior states of the conditional stack. This makes $if statements
work correctly.
Mon Jun 24 20:45:59 1991 Brian Fox (bfox at gnuwest.fsf.org)
* readline.c: support for displaying key binding information
includes the functions rl_list_funmap_names (),
invoking_keyseqs_in_map (), rl_invoking_keyseqs (),
rl_dump_functions (), and rl_function_dumper ().
funmap.c: support for same includes rl_funmap_names ().
readline.c, funmap.c: no longer define STATIC_MALLOC. However,
update both version of xrealloc () to handle a null pointer.
Thu Apr 25 12:03:49 1991 Brian Fox (bfox at gnuwest.fsf.org)
* vi_mode.c (rl_vi_fword, fWord, etc. All functions use
the macro `isident()'. Fixed movement bug which prevents
continious movement through the text.
Fri Jul 27 16:47:01 1990 Brian Fox (bfox at gnuwest.fsf.org)
* readline.c (parser_if) Allow "$if term=foo" construct.
Wed May 23 16:10:33 1990 Brian Fox (bfox at gnuwest.fsf.org)
* readline.c (rl_dispatch) Correctly remember the last command
executed. Fixed typo in username_completion_function ().
Mon Apr 9 19:55:48 1990 Brian Fox (bfox at gnuwest.fsf.org)
* readline.c: username_completion_function (); For text passed in
with a leading `~', remember that this could be a filename (after
it is completed).
Thu Apr 5 13:44:24 1990 Brian Fox (bfox at gnuwest.fsf.org)
* readline.c: rl_search_history (): Correctly handle case of an
unfound search string, but a graceful exit (as with ESC).
* readline.c: rl_restart_output (); The Apollo passes the address
of the file descriptor to TIOCSTART, not the descriptor itself.
Tue Mar 20 05:38:55 1990 Brian Fox (bfox at gnuwest.fsf.org)
* readline.c: rl_complete (); second call in a row causes possible
completions to be listed.
* readline.c: rl_redisplay (), added prompt_this_line variable
which is the first character character following \n in prompt.
Sun Mar 11 04:32:03 1990 Brian Fox (bfox at gnuwest.fsf.org)
* Signals are now supposedly handled inside of SYSV compilation.
Wed Jan 17 19:24:09 1990 Brian Fox (bfox at sbphy.ucsb.edu)
* history.c: history_expand (); fixed overwriting memory error,
added needed argument to call to get_history_event ().
Thu Jan 11 10:54:04 1990 Brian Fox (bfox at sbphy.ucsb.edu)
* readline.c: added mark_modified_lines to control the
display of an asterisk on modified history lines. Also
added a user variable called mark-modified-lines to the
`set' command.
Thu Jan 4 10:38:05 1990 Brian Fox (bfox at sbphy.ucsb.edu)
* readline.c: start_insert (). Only use IC if we don't have an im
capability.
Fri Sep 8 09:00:45 1989 Brian Fox (bfox at aurel)
* readline.c: rl_prep_terminal (). Only turn on 8th bit
as meta-bit iff the terminal is not using parity.
Sun Sep 3 08:57:40 1989 Brian Fox (bfox at aurel)
* readline.c: start_insert (). Uses multiple
insertion call in cases where that makes sense.
rl_insert (). Read type-ahead buffer for additional
keys that are bound to rl_insert, and insert them
all at once. Make insertion of single keys given
with an argument much more efficient.
Tue Aug 8 18:13:57 1989 Brian Fox (bfox at aurel)
* readline.c: Changed handling of EOF. readline () returns
(char *)EOF or consed string. The EOF character is read from the
tty, or if the tty doesn't have one, defaults to C-d.
* readline.c: Added support for event driven programs.
rl_event_hook is the address of a function you want called
while Readline is waiting for input.
* readline.c: Cleanup time. Functions without type declarations
do not use return with a value.
* history.c: history_expand () has new variable which is the
characters to ignore immediately following history_expansion_char.
Sun Jul 16 08:14:00 1989 Brian Fox (bfox at aurel)
* rl_prep_terminal ()
BSD version turns off C-s, C-q, C-y, C-v.
* readline.c -- rl_prep_terminal ()
SYSV version hacks readline_echoing_p.
BSD version turns on passing of the 8th bit for the duration
of reading the line.
Tue Jul 11 06:25:01 1989 Brian Fox (bfox at aurel)
* readline.c: new variable rl_tilde_expander.
If non-null, this contains the address of a function to call if
the standard meaning for expanding a tilde fails. The function is
called with the text sans tilde (as in "foo"), and returns a
malloc()'ed string which is the expansion, or a NULL pointer if
there is no expansion.
* readline.h - new file chardefs.h
Separates things that only readline.c needs from the standard
header file publishing interesting things about readline.
* readline.c:
readline_default_bindings () now looks at terminal chararacters
and binds those as well.
Wed Jun 28 20:20:51 1989 Brian Fox (bfox at aurel)
* Made readline and history into independent libraries.

File diff suppressed because it is too large Load Diff

View File

@ -6,9 +6,9 @@
.\" Case Western Reserve University
.\" chet@ins.CWRU.Edu
.\"
.\" Last Change: Wed Feb 5 14:13:22 EST 1997
.\" Last Change: Thu Feb 19 10:26:47 EST 1998
.\"
.TH READLINE 3 "1997 Feb 5" GNU
.TH READLINE 3 "1998 Feb 19" GNU
.\"
.\" File Name macro. This used to be `.PN', for Path Name,
.\" but Sun doesn't seem to like that very much.
@ -159,7 +159,7 @@ command or the text of a macro and a key sequence to which
it should be bound. The name may be specified in one of two ways:
as a symbolic key name, possibly with \fIMeta\-\fP or \fIControl\-\fP
prefixes, or as a key sequence.
When using the form \fBkeyname\fP:\fIfunction-name\fP or \fImacro\fP,
When using the form \fBkeyname\fP:\^\fIfunction-name\fP or \fImacro\fP,
.I keyname
is the name of a key spelled out in English. For example:
.sp
@ -185,7 +185,7 @@ expressed on the right hand side (that is, to insert the text
.I >&output
into the line).
.PP
In the second form, \fB"keyseq"\fP:\fIfunction\-name\fP or \fImacro\fP,
In the second form, \fB"keyseq"\fP:\^\fIfunction\-name\fP or \fImacro\fP,
.B keyseq
differs from
.B keyname
@ -213,8 +213,9 @@ and
.I "ESC [ 1 1 ~"
is bound to insert the text
.BR "Function Key 1" .
The full set of escape sequences is
The full set of GNU Emacs style escape sequences is
.RS
.PD 0
.TP
.B \eC\-
control prefix
@ -234,11 +235,53 @@ literal "
.B \e'
literal '
.RE
.PD
.PP
In addition to the GNU Emacs style escape sequences, a second
set of backslash escapes is available:
.RS
.PD 0
.TP
.B \ea
alert (bell)
.TP
.B \eb
backspace
.TP
.B \ed
delete
.TP
.B \ef
form feed
.TP
.B \en
newline
.TP
.B \er
carriage return
.TP
.B \et
horizontal tab
.TP
.B \ev
vertical tab
.TP
.B \e\fInnn\fP
the character whose ASCII code is the octal value \fInnn\fP
(one to three digits)
.TP
.B \ex\fInnn\fP
the character whose ASCII code is the hexadecimal value \fInnn\fP
(one to three digits)
.RE
.PD
.PP
When entering the text of a macro, single or double quotes should
be used to indicate a macro definition. Unquoted text
is assumed to be a function name. Backslash
will quote any character in the macro text, including " and '.
is assumed to be a function name.
In the macro body, the backslash escapes described above are expanded.
Backslash will quote any other character in the macro text,
including " and '.
.PP
.B Bash
allows the current readline key bindings to be displayed or modified
@ -288,6 +331,10 @@ This command is bound to
in emacs mode and to
.B #
in vi command mode.
.TP
.B completion\-ignore\-case (Off)
If set to \fBOn\fP, readline performs filename matching and completion
in a case\-insensitive fashion.
.TP
.B completion\-query\-items (100)
This determines when the user is queried about viewing
@ -346,7 +393,7 @@ the value of
also affects the default keymap.
.TP
.B mark\-directories (On)
If set to \fBOn\fP, completed directory names have a slash
If set to \fBOn\fP, complete<d directory names have a slash
appended.
.TP
.B mark\-modified\-lines (Off)
@ -363,6 +410,10 @@ If set to \fBOn\fP, readline will display characters with the
eighth bit set directly rather than as a meta-prefixed escape
sequence.
.TP
.B print\-completions\-horizontally (Off)
If set to \fBOn\fP, readline will display completions with matches
sorted horizontally in alphabetical order, rather than down the screen.
.TP
.B show\-all\-if\-ambiguous (Off)
This alters the default behavior of the completion functions. If
set to
@ -380,7 +431,7 @@ completions.
Readline implements a facility similar in spirit to the conditional
compilation features of the C preprocessor which allows key
bindings and variable settings to be performed as the result
of tests. There are three parser directives used.
of tests. There are four parser directives used.
.IP \fB$if\fP
The
.B $if
@ -417,6 +468,7 @@ file can test for a particular value.
This could be used to bind key sequences to functions useful for
a specific program. For instance, the following command adds a
key sequence that quotes the current or previous word in Bash:
.sp 1
.RS
.nf
\fB$if\fP bash
@ -427,11 +479,21 @@ key sequence that quotes the current or previous word in Bash:
.RE
.RE
.IP \fB$endif\fP
This command, as you saw in the previous example, terminates an
This command, as seen in the previous example, terminates an
\fB$if\fP command.
.IP \fB$else\fP
Commands in this branch of the \fB$if\fP directive are executed if
the test fails.
.IP \fB$include\fP
This directive takes a single filename as an argument and reads commands
and bindings from that file. For example, the following directive
would read \fI/etc/inputrc\fP:
.sp 1
.RS
.nf
\fB$include\fP \^ \fI/etc/inputrc\fP
.fi
.RE
.SH SEARCHING
.PP
Readline provides commands for searching through the command history
@ -464,7 +526,7 @@ the line, thereby executing the command from the history list.
.PP
Non-incremental searches read the entire search string before starting
to search for matching history lines. The search string may be
typed by the user or part of the contents of the current line.
typed by the user or be part of the contents of the current line.
.SH EDITING COMMANDS
.PP
The following is a list of the names of the commands and the default
@ -567,6 +629,8 @@ yank\-last\-arg (M\-.\^, M\-_\^)
Insert the last argument to the previous command (the last word of
the previous history entry). With an argument,
behave exactly like \fByank\-nth\-arg\fP.
Successive calls to \fByank\-last\-arg\fP move back through the history
list, inserting the last argument of each line in turn.
.PD
.SS Commands for Changing Text
.PP
@ -575,9 +639,7 @@ behave exactly like \fByank\-nth\-arg\fP.
.B delete\-char (C\-d)
Delete the character under the cursor. If point is at the
beginning of the line, there are no characters in the line, and
the last character typed was not
.BR C\-d ,
then return
the last character typed was not bound to \fBBdelete\-char\fP, then return
.SM
.BR EOF .
.TP
@ -606,15 +668,15 @@ moving the cursor over that word as well.
.TP
.B upcase\-word (M\-u)
Uppercase the current (or following) word. With a negative argument,
do the previous word, but do not move point.
uppercase the previous word, but do not move point.
.TP
.B downcase\-word (M\-l)
Lowercase the current (or following) word. With a negative argument,
do the previous word, but do not move point.
lowercase the previous word, but do not move point.
.TP
.B capitalize\-word (M\-c)
Capitalize the current (or following) word. With a negative argument,
do the previous word, but do not move point.
capitalize the previous word, but do not move point.
.PD
.SS Killing and Yanking
.PP
@ -628,6 +690,7 @@ Kill backward to the beginning of the line.
.TP
.B unix\-line\-discard (C\-u)
Kill backward from point to the beginning of the line.
The killed text is saved on the kill-ring.
.\" There is no real difference between this and backward-kill-line
.TP
.B kill\-whole\-line
@ -660,9 +723,11 @@ Copy the text in the region to the kill buffer.
.TP
.B copy\-backward\-word
Copy the word before point to the kill buffer.
The word boundaries are the same as \fBbackward\-word\fP.
.TP
.B copy\-forward\-word
Copy the word following point to the kill buffer.
The word boundaries are the same as \fBforward\-word\fP.
.TP
.B yank (C\-y)
Yank the top of the kill ring into the buffer at the cursor.
@ -720,6 +785,19 @@ List the possible completions of the text before point.
Insert all completions of the text before point
that would have been generated by
\fBpossible\-completions\fP.
.TP
.B menu\-complete
Similar to \fBcomplete\fP, but replaces the word to be completed
with a single match from the list of possible completions.
Repeated execution of \fBmenu\-complete\fP steps through the list
of possible completions, inserting each match in turn.
At the end of the list of completions, the bell is rung and the
original text is restored.
An argument of \fIn\fP moves \fIn\fP positions forward in the list
of matches; a negative argument may be used to move backward
through the list.
This command is intended to be bound to \fBTAB\fP, but is unbound
by default.
.PD
.SS Keyboard Macros
.PP
@ -765,7 +843,7 @@ is equivalent to
Incremental undo, separately remembered for each line.
.TP
.B revert\-line (M\-r)
Undo all changes made to this line. This is like typing the
Undo all changes made to this line. This is like executing the
.B undo
command enough times to return the line to its initial state.
.TP
@ -795,15 +873,6 @@ variable is inserted at the beginning of the current line, and the line
is accepted as if a newline had been typed. This makes the current line
a shell comment.
.TP
.B glob\-expand\-word (C\-x *)
The word before point is treated as a pattern for pathname expansion,
and the list of matching file names is inserted, replacing the word.
.TP
.B glob\-list\-expansions (C\-x g)
The list of expansions that would have been generated by
.B glob\-expand\-word
is inserted into the line, replacing the word before point.
.TP
.B dump\-functions
Print all of the functions and their key bindings to the
readline output stream. If a numeric argument is supplied,
@ -1097,10 +1166,10 @@ version of the
library that you have.
.PP
Once you have determined that a bug actually exists, mail a
bug report to \fIbug\-readline\fP@\fIprep.ai.MIT.Edu\fP.
bug report to \fIbug\-readline\fP@\fIgnu.org\fP.
If you have a fix, you are welcome to mail that
as well! Suggestions and `philosophical' bug reports may be mailed
to \fPbug-readline\fP@\fIprep.ai.MIT.Edu\fP or posted to the Usenet
to \fPbug-readline\fP@\fIgnu.org\fP or posted to the Usenet
newsgroup
.BR gnu.bash.bug .
.PP

View File

@ -6,9 +6,9 @@
.\" Case Western Reserve University
.\" chet@ins.CWRU.Edu
.\"
.\" Last Change: Wed Feb 5 14:13:22 EST 1997
.\" Last Change: Thu Feb 19 10:26:47 EST 1998
.\"
.TH READLINE 3 "1997 Feb 5" GNU
.TH READLINE 3 "1998 Feb 19" GNU
.\"
.\" File Name macro. This used to be `.PN', for Path Name,
.\" but Sun doesn't seem to like that very much.
@ -159,7 +159,7 @@ command or the text of a macro and a key sequence to which
it should be bound. The name may be specified in one of two ways:
as a symbolic key name, possibly with \fIMeta\-\fP or \fIControl\-\fP
prefixes, or as a key sequence.
When using the form \fBkeyname\fP:\fIfunction-name\fP or \fImacro\fP,
When using the form \fBkeyname\fP:\^\fIfunction-name\fP or \fImacro\fP,
.I keyname
is the name of a key spelled out in English. For example:
.sp
@ -185,7 +185,7 @@ expressed on the right hand side (that is, to insert the text
.I >&output
into the line).
.PP
In the second form, \fB"keyseq"\fP:\fIfunction\-name\fP or \fImacro\fP,
In the second form, \fB"keyseq"\fP:\^\fIfunction\-name\fP or \fImacro\fP,
.B keyseq
differs from
.B keyname
@ -213,8 +213,9 @@ and
.I "ESC [ 1 1 ~"
is bound to insert the text
.BR "Function Key 1" .
The full set of escape sequences is
The full set of GNU Emacs style escape sequences is
.RS
.PD 0
.TP
.B \eC\-
control prefix
@ -234,11 +235,53 @@ literal "
.B \e'
literal '
.RE
.PD
.PP
In addition to the GNU Emacs style escape sequences, a second
set of backslash escapes is available:
.RS
.PD 0
.TP
.B \ea
alert (bell)
.TP
.B \eb
backspace
.TP
.B \ed
delete
.TP
.B \ef
form feed
.TP
.B \en
newline
.TP
.B \er
carriage return
.TP
.B \et
horizontal tab
.TP
.B \ev
vertical tab
.TP
.B \e\fInnn\fP
the character whose ASCII code is the octal value \fInnn\fP
(one to three digits)
.TP
.B \ex\fInnn\fP
the character whose ASCII code is the hexadecimal value \fInnn\fP
(one to three digits)
.RE
.PD
.PP
When entering the text of a macro, single or double quotes should
be used to indicate a macro definition. Unquoted text
is assumed to be a function name. Backslash
will quote any character in the macro text, including " and '.
is assumed to be a function name.
In the macro body, the backslash escapes described above are expanded.
Backslash will quote any other character in the macro text,
including " and '.
.PP
.B Bash
allows the current readline key bindings to be displayed or modified
@ -288,6 +331,10 @@ This command is bound to
in emacs mode and to
.B #
in vi command mode.
.TP
.B completion\-ignore\-case (Off)
If set to \fBOn\fP, readline performs filename matching and completion
in a case\-insensitive fashion.
.TP
.B completion\-query\-items (100)
This determines when the user is queried about viewing
@ -346,7 +393,7 @@ the value of
also affects the default keymap.
.TP
.B mark\-directories (On)
If set to \fBOn\fP, completed directory names have a slash
If set to \fBOn\fP, complete<d directory names have a slash
appended.
.TP
.B mark\-modified\-lines (Off)
@ -363,6 +410,10 @@ If set to \fBOn\fP, readline will display characters with the
eighth bit set directly rather than as a meta-prefixed escape
sequence.
.TP
.B print\-completions\-horizontally (Off)
If set to \fBOn\fP, readline will display completions with matches
sorted horizontally in alphabetical order, rather than down the screen.
.TP
.B show\-all\-if\-ambiguous (Off)
This alters the default behavior of the completion functions. If
set to
@ -380,7 +431,7 @@ completions.
Readline implements a facility similar in spirit to the conditional
compilation features of the C preprocessor which allows key
bindings and variable settings to be performed as the result
of tests. There are three parser directives used.
of tests. There are four parser directives used.
.IP \fB$if\fP
The
.B $if
@ -417,6 +468,7 @@ file can test for a particular value.
This could be used to bind key sequences to functions useful for
a specific program. For instance, the following command adds a
key sequence that quotes the current or previous word in Bash:
.sp 1
.RS
.nf
\fB$if\fP bash
@ -427,11 +479,21 @@ key sequence that quotes the current or previous word in Bash:
.RE
.RE
.IP \fB$endif\fP
This command, as you saw in the previous example, terminates an
This command, as seen in the previous example, terminates an
\fB$if\fP command.
.IP \fB$else\fP
Commands in this branch of the \fB$if\fP directive are executed if
the test fails.
.IP \fB$include\fP
This directive takes a single filename as an argument and reads commands
and bindings from that file. For example, the following directive
would read \fI/etc/inputrc\fP:
.sp 1
.RS
.nf
\fB$include\fP \^ \fI/etc/inputrc\fP
.fi
.RE
.SH SEARCHING
.PP
Readline provides commands for searching through the command history
@ -464,7 +526,7 @@ the line, thereby executing the command from the history list.
.PP
Non-incremental searches read the entire search string before starting
to search for matching history lines. The search string may be
typed by the user or part of the contents of the current line.
typed by the user or be part of the contents of the current line.
.SH EDITING COMMANDS
.PP
The following is a list of the names of the commands and the default
@ -567,6 +629,8 @@ yank\-last\-arg (M\-.\^, M\-_\^)
Insert the last argument to the previous command (the last word of
the previous history entry). With an argument,
behave exactly like \fByank\-nth\-arg\fP.
Successive calls to \fByank\-last\-arg\fP move back through the history
list, inserting the last argument of each line in turn.
.PD
.SS Commands for Changing Text
.PP
@ -575,9 +639,7 @@ behave exactly like \fByank\-nth\-arg\fP.
.B delete\-char (C\-d)
Delete the character under the cursor. If point is at the
beginning of the line, there are no characters in the line, and
the last character typed was not
.BR C\-d ,
then return
the last character typed was not bound to \fBBdelete\-char\fP, then return
.SM
.BR EOF .
.TP
@ -606,15 +668,15 @@ moving the cursor over that word as well.
.TP
.B upcase\-word (M\-u)
Uppercase the current (or following) word. With a negative argument,
do the previous word, but do not move point.
uppercase the previous word, but do not move point.
.TP
.B downcase\-word (M\-l)
Lowercase the current (or following) word. With a negative argument,
do the previous word, but do not move point.
lowercase the previous word, but do not move point.
.TP
.B capitalize\-word (M\-c)
Capitalize the current (or following) word. With a negative argument,
do the previous word, but do not move point.
capitalize the previous word, but do not move point.
.PD
.SS Killing and Yanking
.PP
@ -628,6 +690,7 @@ Kill backward to the beginning of the line.
.TP
.B unix\-line\-discard (C\-u)
Kill backward from point to the beginning of the line.
The killed text is saved on the kill-ring.
.\" There is no real difference between this and backward-kill-line
.TP
.B kill\-whole\-line
@ -660,9 +723,11 @@ Copy the text in the region to the kill buffer.
.TP
.B copy\-backward\-word
Copy the word before point to the kill buffer.
The word boundaries are the same as \fBbackward\-word\fP.
.TP
.B copy\-forward\-word
Copy the word following point to the kill buffer.
The word boundaries are the same as \fBforward\-word\fP.
.TP
.B yank (C\-y)
Yank the top of the kill ring into the buffer at the cursor.
@ -720,6 +785,19 @@ List the possible completions of the text before point.
Insert all completions of the text before point
that would have been generated by
\fBpossible\-completions\fP.
.TP
.B menu\-complete
Similar to \fBcomplete\fP, but replaces the word to be completed
with a single match from the list of possible completions.
Repeated execution of \fBmenu\-complete\fP steps through the list
of possible completions, inserting each match in turn.
At the end of the list of completions, the bell is rung and the
original text is restored.
An argument of \fIn\fP moves \fIn\fP positions forward in the list
of matches; a negative argument may be used to move backward
through the list.
This command is intended to be bound to \fBTAB\fP, but is unbound
by default.
.PD
.SS Keyboard Macros
.PP
@ -765,7 +843,7 @@ is equivalent to
Incremental undo, separately remembered for each line.
.TP
.B revert\-line (M\-r)
Undo all changes made to this line. This is like typing the
Undo all changes made to this line. This is like executing the
.B undo
command enough times to return the line to its initial state.
.TP
@ -795,15 +873,6 @@ variable is inserted at the beginning of the current line, and the line
is accepted as if a newline had been typed. This makes the current line
a shell comment.
.TP
.B glob\-expand\-word (C\-x *)
The word before point is treated as a pattern for pathname expansion,
and the list of matching file names is inserted, replacing the word.
.TP
.B glob\-list\-expansions (C\-x g)
The list of expansions that would have been generated by
.B glob\-expand\-word
is inserted into the line, replacing the word before point.
.TP
.B dump\-functions
Print all of the functions and their key bindings to the
readline output stream. If a numeric argument is supplied,
@ -1097,10 +1166,10 @@ version of the
library that you have.
.PP
Once you have determined that a bug actually exists, mail a
bug report to \fIbug\-readline\fP@\fIprep.ai.MIT.Edu\fP.
bug report to \fIbug\-readline\fP@\fIgnu.org\fP.
If you have a fix, you are welcome to mail that
as well! Suggestions and `philosophical' bug reports may be mailed
to \fPbug-readline\fP@\fIprep.ai.MIT.Edu\fP or posted to the Usenet
to \fPbug-readline\fP@\fIgnu.org\fP or posted to the Usenet
newsgroup
.BR gnu.bash.bug .
.PP

View File

@ -147,6 +147,7 @@ extern char *rl_get_keymap_name ();
extern int rl_bind_key (), rl_bind_key_in_map ();
extern int rl_unbind_key (), rl_unbind_key_in_map ();
extern int rl_unbind_function_in_map (), rl_unbind_command_in_map ();
extern int rl_set_key ();
extern int rl_generic_bind ();
extern int rl_parse_and_bind ();

View File

@ -27,6 +27,9 @@
#endif
#if defined (HAVE_UNISTD_H)
# ifdef _MINIX
# include <sys/types.h>
# endif
# include <unistd.h>
#endif /* HAVE_UNISTD_H */
@ -36,6 +39,12 @@
# include "ansi_stdlib.h"
#endif /* HAVE_STDLIB_H */
#if defined (HAVE_STRING_H)
# include <string.h>
#else
# include <strings.h>
#endif /* !HAVE_STRING_H */
extern char *xmalloc (), *xrealloc ();
#if !defined (SHELL)

View File

@ -166,6 +166,58 @@ rl_extend_line_buffer (len)
_rl_set_the_line ();
}
/* A function for simple tilde expansion. */
int
rl_tilde_expand (ignore, key)
int ignore, key;
{
register int start, end;
char *homedir, *temp;
int len;
end = rl_point;
start = end - 1;
if (rl_point == rl_end && rl_line_buffer[rl_point] == '~')
{
homedir = tilde_expand ("~");
_rl_replace_text (homedir, start, end);
return (0);
}
else if (rl_line_buffer[start] != '~')
{
for (; !whitespace (rl_line_buffer[start]) && start >= 0; start--)
;
start++;
}
end = start;
do
end++;
while (whitespace (rl_line_buffer[end]) == 0 && end < rl_end);
if (whitespace (rl_line_buffer[end]) || end >= rl_end)
end--;
/* If the first character of the current word is a tilde, perform
tilde expansion and insert the result. If not a tilde, do
nothing. */
if (rl_line_buffer[start] == '~')
{
len = end - start + 1;
temp = xmalloc (len + 1);
strncpy (temp, rl_line_buffer + start, len);
temp[len] = '\0';
homedir = tilde_expand (temp);
free (temp);
_rl_replace_text (homedir, start, end);
}
return (0);
}
/* **************************************************************** */
/* */
/* String Utility Functions */
@ -300,3 +352,13 @@ _rl_digit_value (c)
{
return (isdigit (c) ? c - '0' : c);
}
/* Backwards compatibility, now that savestring has been removed from
all `public' readline header files. */
#undef _rl_savestring
char *
_rl_savestring (s)
char *s;
{
return ((char *)strcpy (xmalloc (1 + (int)strlen (s)), (s)));
}