commit bash-20200323 snapshot

This commit is contained in:
Chet Ramey
2020-03-27 10:30:38 -04:00
parent 0b39c3bcd3
commit 5f49ef47d1
50 changed files with 6699 additions and 5944 deletions
+20 -49
View File
@@ -1323,12 +1323,7 @@ rl_redisplay (void)
_rl_last_c_pos < PROMPT_ENDING_INDEX && local_prompt)
#endif
{
#if defined (__MSDOS__)
putc ('\r', rl_outstream);
#else
if (_rl_term_cr)
tputs (_rl_term_cr, 1, _rl_output_character_function);
#endif
_rl_cr ();
if (modmark)
_rl_output_some_chars ("*", 1);
@@ -1962,11 +1957,7 @@ update_line (char *old, char *new, int current_line, int omax, int nmax, int inv
(((od > 0 || nd > 0) && (od <= prompt_last_invisible || nd <= prompt_last_invisible)) ||
((od >= lendiff) && _rl_last_c_pos < PROMPT_ENDING_INDEX)))
{
#if defined (__MSDOS__)
putc ('\r', rl_outstream);
#else
tputs (_rl_term_cr, 1, _rl_output_character_function);
#endif
_rl_cr ();
if (modmark)
_rl_output_some_chars ("*", 1);
_rl_output_some_chars (local_prompt, lendiff);
@@ -2420,11 +2411,7 @@ rl_clear_visible_line (void)
int curr_line;
/* Make sure we move to column 0 so we clear the entire line */
#if defined (__MSDOS__)
putc ('\r', rl_outstream);
#else
tputs (_rl_term_cr, 1, _rl_output_character_function);
#endif
_rl_cr ();
_rl_last_c_pos = 0;
/* Move to the last screen line of the current visible line */
@@ -2635,11 +2622,7 @@ _rl_move_cursor_relative (int new, const char *data)
if (dpos == 0 || CR_FASTER (dpos, _rl_last_c_pos) ||
(_rl_term_autowrap && i == _rl_screenwidth))
{
#if defined (__MSDOS__)
putc ('\r', rl_outstream);
#else
tputs (_rl_term_cr, 1, _rl_output_character_function);
#endif /* !__MSDOS__ */
_rl_cr ();
cpos = _rl_last_c_pos = 0;
}
@@ -2671,7 +2654,7 @@ _rl_move_cursor_relative (int new, const char *data)
}
else
{
tputs (_rl_term_cr, 1, _rl_output_character_function);
_rl_cr ();
for (i = 0; i < new; i++)
putc (data[i], rl_outstream);
}
@@ -2706,11 +2689,7 @@ _rl_move_vert (int to)
{
for (i = 0; i < delta; i++)
putc ('\n', rl_outstream);
#if defined (__MSDOS__)
putc ('\r', rl_outstream);
#else
tputs (_rl_term_cr, 1, _rl_output_character_function);
#endif
_rl_cr ();
_rl_last_c_pos = 0;
}
else
@@ -3051,14 +3030,18 @@ space_to_eol (int count)
}
void
_rl_clear_screen (void)
_rl_clear_screen (int clrscr)
{
#if defined (__DJGPP__)
ScreenClear ();
ScreenSetCursor (0, 0);
#else
if (_rl_term_clrpag)
tputs (_rl_term_clrpag, 1, _rl_output_character_function);
{
tputs (_rl_term_clrpag, 1, _rl_output_character_function);
if (clrscr && _rl_term_clrscroll)
tputs (_rl_term_clrscroll, 1, _rl_output_character_function);
}
else
rl_crlf ();
#endif /* __DJGPP__ */
@@ -3177,15 +3160,8 @@ _rl_update_final (void)
static void
cr (void)
{
if (_rl_term_cr)
{
#if defined (__MSDOS__)
putc ('\r', rl_outstream);
#else
tputs (_rl_term_cr, 1, _rl_output_character_function);
#endif
_rl_last_c_pos = 0;
}
_rl_cr ();
_rl_last_c_pos = 0;
}
/* Redraw the last line of a multi-line prompt that may possibly contain
@@ -3228,24 +3204,19 @@ _rl_redisplay_after_sigwinch (void)
{
_rl_move_vert (_rl_vis_botlin);
#if defined (__MSDOS__)
putc ('\r', rl_outstream);
#else
tputs (_rl_term_cr, 1, _rl_output_character_function);
#endif
_rl_cr ();
_rl_last_c_pos = 0;
#if defined (__MSDOS__)
space_to_eol (_rl_screenwidth);
putc ('\r', rl_outstream);
#else
#if !defined (__MSDOS__)
if (_rl_term_clreol)
tputs (_rl_term_clreol, 1, _rl_output_character_function);
else
#endif
{
space_to_eol (_rl_screenwidth);
tputs (_rl_term_cr, 1, _rl_output_character_function);
_rl_cr ();
}
#endif
if (_rl_last_v_pos > 0)
_rl_move_vert (0);
}
+2 -11
View File
@@ -40,8 +40,8 @@
.SH NAME
history \- GNU History Library
.SH COPYRIGHT
.if t The GNU History Library is Copyright \(co 1989-2017 by the Free Software Foundation, Inc.
.if n The GNU History Library is Copyright (C) 1989-2017 by the Free Software Foundation, Inc.
.if t The GNU History Library is Copyright \(co 1989-2020 by the Free Software Foundation, Inc.
.if n The GNU History Library is Copyright (C) 1989-2020 by the Free Software Foundation, Inc.
.SH DESCRIPTION
Many programs read input from the user a line at a time. The GNU
History library is able to keep track of those lines, associate arbitrary
@@ -49,7 +49,6 @@ data with each line, and utilize information from previous lines in
composing new ones.
.PP
.SH "HISTORY EXPANSION"
.PP
The history library supports a history expansion feature that
is identical to the history expansion in
.BR bash.
@@ -80,7 +79,6 @@ history expansion character, which is \^\fB!\fP\^ by default.
Only backslash (\^\fB\e\fP\^) and single quotes can quote
the history expansion character.
.SS Event Designators
.PP
An event designator is a reference to a command line entry in the
history list.
Unless the reference is absolute, events are relative to the current
@@ -134,7 +132,6 @@ Equivalent to
The entire command line typed so far.
.PD
.SS Word Designators
.PP
Word designators are used to select desired words from the event.
A
.B :
@@ -191,7 +188,6 @@ If \fBx\fP is missing, it defaults to 0.
If a word designator is supplied without an event specification, the
previous command is used as the event.
.SS Modifiers
.PP
After the optional word designator, there may appear a sequence of
one or more of the following modifiers, each preceded by a `:'.
These modify, or edit, the word or words selected from the history event.
@@ -280,7 +276,6 @@ in the event line.
.SH "PROGRAMMING WITH HISTORY FUNCTIONS"
This section describes how to use the History library in other programs.
.SS Introduction to History
.PP
The programmer using the History library has available functions
for remembering lines on a history list, associating arbitrary data
with a line, removing lines from the list, searching through the list
@@ -308,9 +303,7 @@ in any file that uses the
History library's features. It supplies extern declarations for all
of the library's public functions and variables, and declares all of
the public data structures.
.SS History Storage
.PP
The history list is an array of history entries. A history entry is
declared as follows:
.PP
@@ -346,7 +339,6 @@ typedef struct _hist_state {
If the flags member includes \fBHS_STIFLED\fP, the history has been
stifled.
.SH "History Functions"
.PP
This section describes the calling sequence for the various functions
exported by the GNU History library.
.SS Initializing History and State Management
@@ -365,7 +357,6 @@ Return a structure describing the current state of the input history.
Set the state of the history list according to \fIstate\fP.
.SS History List Management
These functions manage individual entries on the history list, or set
parameters managing the list itself.
+1 -1
View File
@@ -12,7 +12,7 @@ This document describes the GNU History library
a programming tool that provides a consistent user interface for
recalling lines of previously typed input.
Copyright @copyright{} 1988--2016 Free Software Foundation, Inc.
Copyright @copyright{} 1988--2020 Free Software Foundation, Inc.
@quotation
Permission is granted to copy, distribute and/or modify this document
+1 -1
View File
@@ -1,7 +1,7 @@
@ignore
This file documents the user interface to the GNU History library.
Copyright (C) 1988--2018 Free Software Foundation, Inc.
Copyright (C) 1988--2020 Free Software Foundation, Inc.
Authored by Brian Fox and Chet Ramey.
Permission is granted to make and distribute verbatim copies of this manual
+13 -19
View File
@@ -6,9 +6,9 @@
.\" Case Western Reserve University
.\" chet.ramey@case.edu
.\"
.\" Last Change: Mon Nov 25 10:53:27 EST 2019
.\" Last Change: Tue Mar 24 09:27:30 EDT 2020
.\"
.TH READLINE 3 "2019 November 25" "GNU Readline 8.0"
.TH READLINE 3 "2020 March 24" "GNU Readline 8.0"
.\"
.\" File Name macro. This used to be `.PN', for Path Name,
.\" but Sun doesn't seem to like that very much.
@@ -34,8 +34,8 @@ readline \- get a line from a user with editing
\fBreadline\fP (\fIconst char *prompt\fP);
.fi
.SH COPYRIGHT
.if n Readline is Copyright (C) 1989\-2014 Free Software Foundation, Inc.
.if t Readline is Copyright \(co 1989\-2014 Free Software Foundation, Inc.
.if n Readline is Copyright (C) 1989\-2020 Free Software Foundation, Inc.
.if t Readline is Copyright \(co 1989\-2020 Free Software Foundation, Inc.
.SH DESCRIPTION
.LP
.B readline
@@ -163,7 +163,6 @@ In addition to command names, readline allows keys to be bound
to a string that is inserted when the key is pressed (a \fImacro\fP).
.PP
.SS Key Bindings
.PP
The syntax for controlling key bindings in the
.I inputrc
file is simple. All that is required is the name of the
@@ -318,7 +317,6 @@ similar mechanisms. The
file may be edited and re-read if a program does not provide
any other means to incorporate new bindings.
.SS Variables
.PP
Readline has variables that can be used to further customize its
behavior. A variable may be set in the
.I inputrc
@@ -634,7 +632,6 @@ by \fIstat\fP(2) is appended to the filename when listing possible
completions.
.PD
.SS Conditional Constructs
.PP
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
@@ -732,7 +729,6 @@ would read \fI/etc/inputrc\fP:
.fi
.RE
.SH SEARCHING
.PP
Readline provides commands for searching through the command history
for lines containing a specified string.
There are two search modes:
@@ -772,7 +768,6 @@ 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 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
key sequences to which they are bound.
Command names without an accompanying key sequence are unbound by default.
@@ -782,7 +777,6 @@ position, and \fImark\fP refers to a cursor position saved by the
\fBset\-mark\fP command.
The text between the point and mark is referred to as the \fIregion\fP.
.SS Commands for Moving
.PP
.PD 0
.TP
.B beginning\-of\-line (C\-a)
@@ -818,8 +812,15 @@ Readline line does not take up more than one physical line or if the length
of the current Readline line is not greater than the length of the prompt
plus the screen width.
.TP
.B clear\-display (M\-C\-l)
Clear the screen and, if possible, the terminal's scrollback buffer,
then redraw the current line,
leaving the current line at the top of the screen.
.TP
.B clear\-screen (C\-l)
Clear the screen leaving the current line at the top of the screen.
Clear the screen,
then redraw the current line,
leaving the current line at the top of the screen.
With an argument, refresh the current line without clearing the
screen.
.TP
@@ -827,7 +828,6 @@ screen.
Refresh the current line.
.PD
.SS Commands for Manipulating the History
.PP
.PD 0
.TP
.B accept\-line (Newline, Return)
@@ -920,7 +920,6 @@ The history expansion facilities are used to extract the last argument,
as if the "!$" history expansion had been specified.
.PD
.SS Commands for Changing Text
.PP
.PD 0
.TP
.B \fIend\-of\-file\fP (usually C\-d)
@@ -995,7 +994,6 @@ Characters bound to \fBbackward\-delete\-char\fP replace the character
before point with a space. By default, this command is unbound.
.PD
.SS Killing and Yanking
.PP
.PD 0
.TP
.B kill\-line (C\-k)
@@ -1058,7 +1056,6 @@ or
.BR yank\-pop .
.PD
.SS Numeric Arguments
.PP
.PD 0
.TP
.B digit\-argument (M\-0, M\-1, ..., M\-\-)
@@ -1080,7 +1077,6 @@ first time makes the argument count four, a second time makes the
argument count sixteen, and so on.
.PD
.SS Completing
.PP
.PD 0
.TP
.B complete (TAB)
@@ -1137,7 +1133,6 @@ If at the end of the line, behaves identically to
\fBpossible-completions\fP.
.PD
.SS Keyboard Macros
.PP
.PD 0
.TP
.B start\-kbd\-macro (C\-x (\^)
@@ -1156,7 +1151,6 @@ Print the last keyboard macro defined in a format suitable for the
\fIinputrc\fP file.
.PD
.SS Miscellaneous
.PP
.PD 0
.TP
.B re\-read\-init\-file (C\-x C\-r)
@@ -1332,6 +1326,7 @@ Emacs Meta bindings
"M-C-H" backward-kill-word
"M-C-I" tab-insert
"M-C-J" vi-editing-mode
"M-C-L" clear-display
"M-C-M" vi-editing-mode
"M-C-R" revert-line
"M-C-Y" yank-nth-arg
@@ -1536,5 +1531,4 @@ Comments and bug reports concerning
this manual page should be directed to
.IR chet.ramey@case.edu .
.SH BUGS
.PP
It's too big and too slow.
+1 -1
View File
@@ -13,7 +13,7 @@ This manual describes the GNU Readline Library
consistency of user interface across discrete programs which provide
a command line interface.
Copyright @copyright{} 1988--2016 Free Software Foundation, Inc.
Copyright @copyright{} 1988--2020 Free Software Foundation, Inc.
@quotation
Permission is granted to copy, distribute and/or modify this document
+1 -1
View File
@@ -7,7 +7,7 @@ This document describes the GNU Readline Library, a utility for aiding
in the consistency of user interface across discrete programs that need
to provide a command line interface.
Copyright (C) 1988--2019 Free Software Foundation, Inc.
Copyright (C) 1988--2020 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
+8 -2
View File
@@ -9,7 +9,7 @@ use these features. There is a document entitled "readline.texinfo"
which contains both end-user and programmer documentation for the
GNU Readline Library.
Copyright (C) 1988--2016 Free Software Foundation, Inc.
Copyright (C) 1988--2020 Free Software Foundation, Inc.
Authored by Brian Fox and Chet Ramey.
@@ -1201,8 +1201,14 @@ Readline line does not take up more than one physical line or if the length
of the current Readline line is not greater than the length of the prompt
plus the screen width.
@item clear-display (M-C-l)
Clear the screen and, if possible, the terminal's scrollback buffer,
then redraw the current line,
leaving the current line at the top of the screen.
@item clear-screen (C-l)
Clear the screen and redraw the current line,
Clear the screen,
then redraw the current line,
leaving the current line at the top of the screen.
@item redraw-current-line ()
+1 -1
View File
@@ -12,7 +12,7 @@ This manual describes the end user interface of the GNU Readline Library
consistency of user interface across discrete programs which provide
a command line interface.
Copyright @copyright{} 1988--2016 Free Software Foundation, Inc.
Copyright @copyright{} 1988--2020 Free Software Foundation, Inc.
@quotation
Permission is granted to copy, distribute and/or modify this document
+4 -4
View File
@@ -1,10 +1,10 @@
@ignore
Copyright (C) 1988-2019 Free Software Foundation, Inc.
Copyright (C) 1988-2020 Free Software Foundation, Inc.
@end ignore
@set EDITION 8.0
@set VERSION 8.0
@set UPDATED 25 November 2019
@set UPDATED-MONTH November 2019
@set UPDATED 24 March 2020
@set UPDATED-MONTH March 2020
@set LASTCHANGE Mon Nov 25 10:53:13 EST 2019
@set LASTCHANGE Tue Mar 24 09:28:28 EDT 2020
+1 -1
View File
@@ -327,7 +327,7 @@ KEYMAP_ENTRY_ARRAY emacs_meta_keymap = {
{ ISFUNC, rl_tab_insert }, /* Meta-Control-i */
{ ISFUNC, rl_vi_editing_mode }, /* Meta-Control-j */
{ ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-Control-k */
{ ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-Control-l */
{ ISFUNC, rl_clear_display }, /* Meta-Control-l */
{ ISFUNC, rl_vi_editing_mode }, /* Meta-Control-m */
{ ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-Control-n */
{ ISFUNC, (rl_command_func_t *)0x0 }, /* Meta-Control-o */
+1
View File
@@ -73,6 +73,7 @@ static const FUNMAP default_funmap[] = {
{ "capitalize-word", rl_capitalize_word },
{ "character-search", rl_char_search },
{ "character-search-backward", rl_backward_char_search },
{ "clear-display", rl_clear_display },
{ "clear-screen", rl_clear_screen },
{ "complete", rl_complete },
{ "copy-backward-word", rl_copy_backward_word },
+2
View File
@@ -727,7 +727,9 @@ rl_bracketed_paste_begin (int count, int key)
char *buf;
buf = _rl_bracketed_text (&len);
rl_mark = rl_point;
retval = rl_insert_text (buf) == len ? 0 : 1;
rl_activate_mark ();
xfree (buf);
return (retval);
+9
View File
@@ -417,6 +417,8 @@ readline_internal_setup (void)
if (rl_startup_hook)
(*rl_startup_hook) ();
rl_deactivate_mark ();
#if defined (VI_MODE)
if (rl_editing_mode == vi_mode)
rl_vi_insertion_mode (1, 'i'); /* don't want to reset last */
@@ -638,6 +640,11 @@ readline_internal_charloop (void)
if (rl_pending_input == 0 && lk == _rl_last_command_was_kill)
_rl_last_command_was_kill = 0;
if (_rl_keep_mark_active)
_rl_keep_mark_active = 0;
else if (rl_mark_active_p ())
rl_deactivate_mark ();
_rl_internal_char_cleanup ();
#if defined (READLINE_CALLBACKS)
@@ -1458,5 +1465,7 @@ rl_restore_state (struct readline_state *sp)
rl_attempted_completion_function = sp->attemptfunc;
rl_completer_word_break_characters = sp->wordbreakchars;
rl_deactivate_mark ();
return (0);
}
+9
View File
@@ -95,6 +95,7 @@ extern int rl_forward_word PARAMS((int, int));
extern int rl_backward_word PARAMS((int, int));
extern int rl_refresh_line PARAMS((int, int));
extern int rl_clear_screen PARAMS((int, int));
extern int rl_clear_display PARAMS((int, int));
extern int rl_skip_csi_sequence PARAMS((int, int));
extern int rl_arrow_keys PARAMS((int, int));
@@ -392,6 +393,14 @@ extern int rl_clear_message PARAMS((void));
extern int rl_reset_line_state PARAMS((void));
extern int rl_crlf PARAMS((void));
/* Functions to manage the mark and region, especially the notion of an
active mark and an active region. */
extern void rl_keep_mark_active PARAMS((void));
extern void rl_activate_mark PARAMS((void));
extern void rl_deactivate_mark PARAMS((void));
extern int rl_mark_active_p PARAMS((void));
#if defined (USE_VARARGS) && defined (PREFER_STDARG)
extern int rl_message (const char *, ...) __attribute__((__format__ (printf, 1, 2)));
#else
+3 -1
View File
@@ -274,7 +274,7 @@ extern void _rl_restore_prompt PARAMS((void));
extern char *_rl_make_prompt_for_search PARAMS((int));
extern void _rl_erase_at_end_of_line PARAMS((int));
extern void _rl_clear_to_eol PARAMS((int));
extern void _rl_clear_screen PARAMS((void));
extern void _rl_clear_screen PARAMS((int));
extern void _rl_update_final PARAMS((void));
extern void _rl_optimize_redisplay PARAMS((void));
extern void _rl_redisplay_after_sigwinch PARAMS((void));
@@ -378,6 +378,7 @@ extern void _rl_output_character_function PARAMS((int));
#else
extern int _rl_output_character_function PARAMS((int));
#endif
extern void _rl_cr PARAMS((void));
extern void _rl_output_some_chars PARAMS((const char *, int));
extern int _rl_backspace PARAMS((int));
extern void _rl_enable_meta_key PARAMS((void));
@@ -565,6 +566,7 @@ extern int _rl_term_autowrap;
/* text.c */
extern int _rl_optimize_typeahead;
extern int _rl_keep_mark_active;
/* undo.c */
extern int _rl_doing_an_undo;
+19 -1
View File
@@ -152,6 +152,10 @@ static int term_has_meta;
static char *_rl_term_mm;
static char *_rl_term_mo;
/* The sequences to enter and exit standout mode. */
static char *_rl_term_so;
static char *_rl_term_se;
/* The key sequences output by the arrow keys, if this terminal has any. */
static char *_rl_term_ku;
static char *_rl_term_kd;
@@ -423,6 +427,8 @@ static const struct _tc_string tc_strings[] =
{ "mo", &_rl_term_mo },
{ "nd", &_rl_term_forward_char },
{ "pc", &_rl_term_pc },
{ "se", &_rl_term_se },
{ "so", &_rl_term_so },
{ "up", &_rl_term_up },
{ "vb", &_rl_visible_bell },
{ "vs", &_rl_term_vs },
@@ -470,6 +476,7 @@ _rl_init_terminal_io (const char *terminal_name)
_rl_term_goto = _rl_term_pc = _rl_term_ip = (char *)NULL;
_rl_term_ks = _rl_term_ke =_rl_term_vs = _rl_term_ve = (char *)NULL;
_rl_term_kh = _rl_term_kH = _rl_term_at7 = _rl_term_kI = (char *)NULL;
_rl_term_so = _rl_term_se = (char *)NULL;
#if defined(HACK_TERMCAP_MOTION)
_rl_term_forward_char = (char *)NULL;
#endif
@@ -534,6 +541,7 @@ _rl_init_terminal_io (const char *terminal_name)
_rl_term_mm = _rl_term_mo = (char *)NULL;
_rl_term_ve = _rl_term_vs = (char *)NULL;
_rl_term_forward_char = (char *)NULL;
_rl_term_so = _rl_term_se = (char *)NULL;
_rl_terminal_can_insert = term_has_meta = 0;
/* Reasonable defaults for tgoto(). Readline currently only uses
@@ -554,7 +562,7 @@ _rl_init_terminal_io (const char *terminal_name)
BC = _rl_term_backspace;
UP = _rl_term_up;
if (!_rl_term_cr)
if (_rl_term_cr == 0)
_rl_term_cr = "\r";
_rl_term_autowrap = TGETFLAG ("am") && TGETFLAG ("xn");
@@ -689,6 +697,16 @@ rl_crlf (void)
return 0;
}
void
_rl_cr (void)
{
#if defined (__MSDOS__)
putc ('\r', rl_outstream);
#else
tputs (_rl_term_cr, 1, _rl_output_character_function);
#endif
}
/* Ring the terminal bell. */
int
rl_ding (void)
+59 -3
View File
@@ -1,6 +1,6 @@
/* text.c -- text handling commands for readline. */
/* Copyright (C) 1987-2019 Free Software Foundation, Inc.
/* Copyright (C) 1987-2020 Free Software Foundation, Inc.
This file is part of the GNU Readline Library (Readline), a library
for reading lines of text with interactive input and history editing.
@@ -607,7 +607,18 @@ rl_clear_screen (int count, int key)
return 0;
}
_rl_clear_screen (); /* calls termcap function to clear screen */
_rl_clear_screen (0); /* calls termcap function to clear screen */
rl_keep_mark_active ();
rl_forced_update_display ();
rl_display_fixed = 1;
return 0;
}
int
rl_clear_display (int count, int key)
{
_rl_clear_screen (1); /* calls termcap function to clear screen and scrollback buffer */
rl_forced_update_display ();
rl_display_fixed = 1;
@@ -1091,6 +1102,15 @@ rl_tab_insert (int count, int key)
int
rl_newline (int count, int key)
{
if (rl_mark_active_p ())
{
rl_deactivate_mark ();
#if 0 /* Not yet */
(*rl_redisplay_function) ();
_rl_want_redisplay = 0;
#endif
}
rl_done = 1;
if (_rl_history_preserve_point)
@@ -1830,7 +1850,43 @@ rl_exchange_point_and_mark (int count, int key)
return 1;
}
else
SWAP (rl_point, rl_mark);
{
SWAP (rl_point, rl_mark);
rl_activate_mark ();
}
return 0;
}
/* Active mark support */
/* Is the region active? */
static int mark_active = 0;
/* Does the current command want the mark to remain active when it completes? */
int _rl_keep_mark_active;
void
rl_keep_mark_active (void)
{
_rl_keep_mark_active++;
}
void
rl_activate_mark (void)
{
mark_active = 1;
rl_keep_mark_active ();
}
void
rl_deactivate_mark (void)
{
mark_active = 0;
}
int
rl_mark_active_p (void)
{
return (mark_active);
}
+1
View File
@@ -102,6 +102,7 @@ _rl_abort_internal (void)
rl_clear_message ();
_rl_reset_argument ();
rl_clear_pending_input ();
rl_deactivate_mark ();
while (rl_executing_macro)
_rl_pop_executing_macro ();