commit bash-20200618 snapshot

This commit is contained in:
Chet Ramey
2020-06-22 12:07:22 -04:00
parent d37a47224a
commit bdf37a2d4f
5 changed files with 71 additions and 18 deletions
+9
View File
@@ -8589,3 +8589,12 @@ pathexp.c
po/Makefile.in.in
- MKINSTALLDIRS: deprecated, no longer in AM_INTL_SUBDIR, so we have
to create the variable manually
lib/readline/doc/rltech.texi
- add descriptions of the active mark functions that are available to
applications. I guess they will remain public
subst.c
- valid_parameter_transform: new function, reject transformations
longer than a single character or invalid transformation operators
- parameter_brace_transform: call valid_parameter_transform
+23
View File
@@ -1342,6 +1342,29 @@ This differs from @code{clear_history} because it frees private data
Readline saves in the history list.
@end deftypefun
@deftypefun {void} rl_activate_mark (void)
Enable an @emph{active} mark.
When this is enabled, the text between point and mark (the @var{region}) is
displayed in the terminal's standout mode (a @var{face}).
This is called by various readline functions that set the mark and insert
text, and is available for applications to call.
@end deftypefun
@deftypefun {void} rl_deactivate_mark (void)
Turn off the active mark.
@end deftypefun
@deftypefun {void} rl_keep_mark_active (void)
Indicate that the mark should remain active when the current readline function
completes and after redisplay occurs.
In most cases, the mark remains active for only the duration of a single
bindable readline function.
@end deftypefun
@deftypefun {int} rl_mark_active_p (void)
Return a non-zero value if the mark is currently active; zero otherwise.
@end deftypefun
@node Alternate Interface
@subsection Alternate Interface
+7
View File
@@ -1254,10 +1254,12 @@ being entered.
@item reverse-search-history (C-r)
Search backward starting at the current line and moving `up' through
the history as necessary. This is an incremental search.
This command sets the region to the matched text and activates the mark.
@item forward-search-history (C-s)
Search forward starting at the current line and moving `down' through
the history as necessary. This is an incremental search.
This command sets the region to the matched text and activates the mark.
@item non-incremental-reverse-search-history (M-p)
Search backward starting at the current line and moving `up'
@@ -1377,6 +1379,11 @@ each character as if it had been read from the keyboard. The characters
are inserted as if each one was bound to @code{self-insert} instead of
executing any editing commands.
Bracketed paste sets the region (the characters between point and the mark)
to the inserted text. It uses the concept of an @emph{active mark}: when the
mark is active, Readline redisplay uses the terminal's standout mode to
denote the region.
@item transpose-chars (C-t)
Drag the character before the cursor forward over
the character at the cursor, moving the
+5 -5
View File
@@ -2,9 +2,9 @@
Copyright (C) 1988-2020 Free Software Foundation, Inc.
@end ignore
@set EDITION 8.0
@set VERSION 8.0
@set UPDATED 4 May 2020
@set UPDATED-MONTH May 2020
@set EDITION 8.1
@set VERSION 8.1
@set UPDATED 18 June 2020
@set UPDATED-MONTH June 2020
@set LASTCHANGE Mon May 4 14:55:02 EDT 2020
@set LASTCHANGE Thu Jun 18 11:25:17 EDT 2020
+27 -13
View File
@@ -301,6 +301,7 @@ static char *parameter_list_transform PARAMS((int, int, int));
static char *array_transform PARAMS((int, SHELL_VAR *, int, int));
#endif
static char *parameter_brace_transform PARAMS((char *, char *, int, char *, int, int, int, int));
static int valid_parameter_transform PARAMS((char *));
static char *process_substitute PARAMS((char *, int));
@@ -7848,6 +7849,31 @@ array_transform (xc, var, starsub, quoted)
}
#endif /* ARRAY_VARS */
static int
valid_parameter_transform (xform)
char *xform;
{
if (xform[1])
return 0;
/* check for valid values of xform[0] */
switch (xform[0])
{
case 'a': /* expand to a string with just attributes */
case 'A': /* expand as an assignment statement with attributes */
case 'K': /* expand assoc array to list of key/value pairs */
case 'E': /* expand like $'...' */
case 'P': /* expand like prompt string */
case 'Q': /* quote reusably */
case 'U': /* transform to uppercase */
case 'u': /* tranform by capitalizing */
case 'L': /* transform to lowercase */
return 1;
default:
return 0;
}
}
static char *
parameter_brace_transform (varname, value, ind, xform, rtype, quoted, pflags, flags)
char *varname, *value;
@@ -7873,20 +7899,8 @@ parameter_brace_transform (varname, value, ind, xform, rtype, quoted, pflags, fl
return ((char *)NULL);
}
/* check for valid values of xc */
switch (xc)
if (valid_parameter_transform (xform) == 0)
{
case 'a': /* expand to a string with just attributes */
case 'A': /* expand as an assignment statement with attributes */
case 'K': /* expand assoc array to list of key/value pairs */
case 'E': /* expand like $'...' */
case 'P': /* expand like prompt string */
case 'Q': /* quote reusably */
case 'U': /* transform to uppercase */
case 'u': /* tranform by capitalizing */
case 'L': /* transform to lowercase */
break;
default:
this_command_name = oname;
return &expand_param_error;
}