diff --git a/CWRU/CWRU.chlog b/CWRU/CWRU.chlog index 2f863e7c..e00f732a 100644 --- a/CWRU/CWRU.chlog +++ b/CWRU/CWRU.chlog @@ -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 diff --git a/lib/readline/doc/rltech.texi b/lib/readline/doc/rltech.texi index 4547469e..bbf57c23 100644 --- a/lib/readline/doc/rltech.texi +++ b/lib/readline/doc/rltech.texi @@ -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 diff --git a/lib/readline/doc/rluser.texi b/lib/readline/doc/rluser.texi index d71aa4de..e22f28c1 100644 --- a/lib/readline/doc/rluser.texi +++ b/lib/readline/doc/rluser.texi @@ -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 diff --git a/lib/readline/doc/version.texi b/lib/readline/doc/version.texi index ba51a075..74368d2f 100644 --- a/lib/readline/doc/version.texi +++ b/lib/readline/doc/version.texi @@ -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 diff --git a/subst.c b/subst.c index 4e3176d4..5b1ba17d 100644 --- a/subst.c +++ b/subst.c @@ -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; }