diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/readline/callback.c | 6 | ||||
-rw-r--r-- | lib/readline/display.c | 4 | ||||
-rw-r--r-- | lib/readline/doc/rluser.texi | 20 | ||||
-rw-r--r-- | lib/readline/doc/rluser.texi~ | 1 | ||||
-rw-r--r-- | lib/readline/readline.c | 10 | ||||
-rw-r--r-- | lib/readline/rlprivate.h | 7 | ||||
-rw-r--r-- | lib/readline/rltty.c | 10 | ||||
-rw-r--r-- | lib/readline/terminal.c | 4 | ||||
-rw-r--r-- | lib/readline/text.c | 2 | ||||
-rw-r--r-- | lib/readline/util.c | 2 |
10 files changed, 41 insertions, 25 deletions
diff --git a/lib/readline/callback.c b/lib/readline/callback.c index 88a107b9..d40e39d2 100644 --- a/lib/readline/callback.c +++ b/lib/readline/callback.c @@ -115,13 +115,13 @@ rl_callback_read_char () abort (); } - memcpy ((void *)olevel, (void *)readline_top_level, sizeof (procenv_t)); - jcode = setjmp (readline_top_level); + memcpy ((void *)olevel, (void *)_rl_top_level, sizeof (procenv_t)); + jcode = setjmp (_rl_top_level); if (jcode) { (*rl_redisplay_function) (); _rl_want_redisplay = 0; - memcpy ((void *)readline_top_level, (void *)olevel, sizeof (procenv_t)); + memcpy ((void *)_rl_top_level, (void *)olevel, sizeof (procenv_t)); return; } diff --git a/lib/readline/display.c b/lib/readline/display.c index b4d95728..24dbe839 100644 --- a/lib/readline/display.c +++ b/lib/readline/display.c @@ -506,7 +506,7 @@ rl_redisplay () int _rl_wrapped_multicolumn = 0; #endif - if (readline_echoing_p == 0) + if (_rl_echoing_p == 0) return; /* Block keyboard interrupts because this function manipulates global @@ -2464,7 +2464,7 @@ _rl_redisplay_after_sigwinch () void _rl_clean_up_for_exit () { - if (readline_echoing_p) + if (_rl_echoing_p) { _rl_move_vert (_rl_vis_botlin); _rl_vis_botlin = 0; diff --git a/lib/readline/doc/rluser.texi b/lib/readline/doc/rluser.texi index 886f8371..00a28ca6 100644 --- a/lib/readline/doc/rluser.texi +++ b/lib/readline/doc/rluser.texi @@ -1574,7 +1574,7 @@ the matches. Any function specified with @option{-F} is invoked first. The function may use any of the shell facilities, including the -@code{compgen} builtin described below +@code{compgen} and @code{compopt} builtins described below (@pxref{Programmable Completion Builtins}), to generate the matches. It must put the possible completions in the @env{COMPREPLY} array variable. @@ -1847,4 +1847,22 @@ a @var{name} for which no specification exists, or an error occurs adding a completion specification. @end table + +@item compopt +@btindex compopt +@example +@code{compopt} [-o @var{option}] [+o @var{option}] [@var{name}] +@end example +Modify completion options for each @var{name} according to the +@var{option}s, or for the currently-execution completion if no @var{name}s +are supplied. +If no @var{option}s are given, display the completion options for each +@var{name} or the current completion. +The possible values of @var{option} are those valid for the @code{complete} +builtin described above. + +The return value is true unless an invalid option is supplied, an attempt +is made to modify the options for a @var{name} for which no completion +specification exists, or an output error occurs. + @end ifset diff --git a/lib/readline/doc/rluser.texi~ b/lib/readline/doc/rluser.texi~ index 8851e1b3..886f8371 100644 --- a/lib/readline/doc/rluser.texi~ +++ b/lib/readline/doc/rluser.texi~ @@ -1,7 +1,6 @@ @comment %**start of header (This is for running Texinfo on a region.) @setfilename rluser.info @comment %**end of header (This is for running Texinfo on a region.) -@setchapternewpage odd @ignore This file documents the end user interface to the GNU command line diff --git a/lib/readline/readline.c b/lib/readline/readline.c index a31b092b..30a3ec70 100644 --- a/lib/readline/readline.c +++ b/lib/readline/readline.c @@ -163,7 +163,7 @@ int rl_done; rl_command_func_t *rl_last_func = (rl_command_func_t *)NULL; /* Top level environment for readline_internal (). */ -procenv_t readline_top_level; +procenv_t _rl_top_level; /* The streams we interact with. */ FILE *_rl_in_stream, *_rl_out_stream; @@ -176,7 +176,7 @@ FILE *rl_outstream = (FILE *)NULL; set to 1 if there is a controlling terminal, we can get its attributes, and the attributes include `echo'. Look at rltty.c:prepare_terminal_settings for the code that sets it. */ -int readline_echoing_p = 0; +int _rl_echoing_p = 0; /* Current prompt. */ char *rl_prompt = (char *)NULL; @@ -371,7 +371,7 @@ readline_internal_setup () /* If we're not echoing, we still want to at least print a prompt, because rl_redisplay will not do it for us. If the calling application has a custom redisplay function, though, let that function handle it. */ - if (readline_echoing_p == 0 && rl_redisplay_function == rl_redisplay) + if (_rl_echoing_p == 0 && rl_redisplay_function == rl_redisplay) { if (rl_prompt && rl_already_prompted == 0) { @@ -484,7 +484,7 @@ readline_internal_charloop () #endif lk = _rl_last_command_was_kill; - code = setjmp (readline_top_level); + code = setjmp (_rl_top_level); if (code) { @@ -492,7 +492,7 @@ readline_internal_charloop () _rl_want_redisplay = 0; /* If we get here, we're not being called from something dispatched from _rl_callback_read_char(), which sets up its own value of - readline_top_level (saving and restoring the old, of course), so + _rl_top_level (saving and restoring the old, of course), so we can just return here. */ if (RL_ISSTATE (RL_STATE_CALLBACK)) return (0); diff --git a/lib/readline/rlprivate.h b/lib/readline/rlprivate.h index 1e26dce1..9275cddf 100644 --- a/lib/readline/rlprivate.h +++ b/lib/readline/rlprivate.h @@ -149,12 +149,9 @@ extern int rl_visible_stats; extern int rl_line_buffer_len; extern int rl_arg_sign; extern int rl_visible_prompt_length; -extern int readline_echoing_p; extern int rl_key_sequence_length; extern int rl_byte_oriented; -extern _rl_keyseq_cxt *_rl_kscxt; - /* display.c */ extern int rl_display_fixed; @@ -400,6 +397,7 @@ extern int _rl_history_saved_point; extern _rl_arg_cxt _rl_argcxt; /* readline.c */ +extern int _rl_echoing_p; extern int _rl_horizontal_scroll_mode; extern int _rl_mark_modified_lines; extern int _rl_bell_preference; @@ -415,7 +413,8 @@ extern FILE *_rl_in_stream; extern FILE *_rl_out_stream; extern int _rl_last_command_was_kill; extern int _rl_eof_char; -extern procenv_t readline_top_level; +extern procenv_t _rl_top_level; +extern _rl_keyseq_cxt *_rl_kscxt; /* search.c */ extern _rl_search_cxt *_rl_nscxt; diff --git a/lib/readline/rltty.c b/lib/readline/rltty.c index f2120cb1..f6b41bb3 100644 --- a/lib/readline/rltty.c +++ b/lib/readline/rltty.c @@ -201,7 +201,7 @@ set_tty_settings (tty, tiop) ioctl (tty, TIOCSETN, &(tiop->sgttyb)); tiop->flags &= ~SGTTY_SET; } - readline_echoing_p = 1; + _rl_echoing_p = 1; #if defined (TIOCLSET) if (tiop->flags & LFLAG_SET) @@ -235,7 +235,7 @@ prepare_terminal_settings (meta_flag, oldtio, tiop) int meta_flag; TIOTYPE oldtio, *tiop; { - readline_echoing_p = (oldtio.sgttyb.sg_flags & ECHO); + _rl_echoing_p = (oldtio.sgttyb.sg_flags & ECHO); /* Copy the original settings to the structure we're going to use for our settings. */ @@ -513,7 +513,7 @@ prepare_terminal_settings (meta_flag, oldtio, tiop) int meta_flag; TIOTYPE oldtio, *tiop; { - readline_echoing_p = (oldtio.c_lflag & ECHO); + _rl_echoing_p = (oldtio.c_lflag & ECHO); tiop->c_lflag &= ~(ICANON | ECHO); @@ -576,7 +576,7 @@ void rl_prep_terminal (meta_flag) int meta_flag; { - readline_echoing_p = 1; + _rl_echoing_p = 1; } void @@ -609,7 +609,7 @@ rl_prep_terminal (meta_flag) #else if (errno == ENOTTY || errno == EINVAL) #endif - readline_echoing_p = 1; /* XXX */ + _rl_echoing_p = 1; /* XXX */ _rl_release_sigint (); return; diff --git a/lib/readline/terminal.c b/lib/readline/terminal.c index 93088289..fb1495d1 100644 --- a/lib/readline/terminal.c +++ b/lib/readline/terminal.c @@ -350,7 +350,7 @@ rl_reset_screen_size () void rl_resize_terminal () { - if (readline_echoing_p) + if (_rl_echoing_p) { _rl_get_screen_size (fileno (rl_instream), 1); if (CUSTOM_REDISPLAY_FUNC ()) @@ -653,7 +653,7 @@ rl_crlf () int rl_ding () { - if (readline_echoing_p) + if (_rl_echoing_p) { switch (_rl_bell_preference) { diff --git a/lib/readline/text.c b/lib/readline/text.c index 50292585..c8521dce 100644 --- a/lib/readline/text.c +++ b/lib/readline/text.c @@ -949,7 +949,7 @@ rl_newline (count, key) if (rl_erase_empty_line && rl_point == 0 && rl_end == 0) return 0; - if (readline_echoing_p) + if (_rl_echoing_p) _rl_update_final (); return 0; } diff --git a/lib/readline/util.c b/lib/readline/util.c index 922f038a..de225c0f 100644 --- a/lib/readline/util.c +++ b/lib/readline/util.c @@ -109,7 +109,7 @@ _rl_abort_internal () _rl_pop_executing_macro (); rl_last_func = (rl_command_func_t *)NULL; - longjmp (readline_top_level, 1); + longjmp (_rl_top_level, 1); return (0); } |