configure.ac,MANIFEST,Makefile.in
- support for creating history.pc
+
+ 3/29/2022
+ ---------
+configure.ac
+ - new option: --with-shared-termcap-library: use to force the shared
+ readline library to be linked against a shared termcap/curses library
+ that configure finds. If the argument begins with `-l', use that
+ library instead; updated INSTALL accordingly
h. rl_completer_word_break_characters is now `const char *' like
rl_basic_word_break_characters.
-i. The non-incremental history searches now leave the current history offset
- at the position of the last matching history entry, like incremental search.
-
-j. Readline looks in $LS_COLORS for a custom filename extension
+i. Readline looks in $LS_COLORS for a custom filename extension
(*.readline-colored-completion-prefix) and uses that as the default color
for the common prefix displayed when `colored-completion-prefix' is set.
Optional Features
=================
-The readline `configure' recognizes a single `--with-PACKAGE' option:
+The readline `configure' recognizes two `--with-PACKAGE' options:
`--with-curses'
This tells readline that it can find the termcap library functions
(tgetent, et al.) in the curses library, rather than a separate
termcap library. Readline uses the termcap functions, but does not
- link with the termcap or curses library itself, allowing applications
- which link with readline the to choose an appropriate library.
- This option tells readline to link the example programs with the
- curses library rather than libtermcap.
+ usually link with the termcap or curses library itself, allowing
+ applications which link with readline the to choose an appropriate
+ library. This option tells readline to link the example programs with
+ the curses library rather than libtermcap.
+
+`--with-shared-termcap-library'
+ This tells the readline build process to link the shared version of
+ libreadline against a shared version of the curses or termcap library
+ (see the description of SHLIB_LIBS below under `Shared Libraries').
+ This relieves the application of having to link with curses or termcap
+ itself, but does not allow the application to choose which library to
+ use. This is only effective on systems that build shared libraries (see
+ below; the default for shared libraries is `yes').
+
+`configure' also recognizes several `--enable-FEATURE' options:
-`configure' also recognizes two `--enable-FEATURE' options:
+`--enable-bracketed-paste-default'
+ Enable bracketed paste by default, so the initial value of the
+ `enable-bracketed-paste' Readline variable is `on'. The default
+ is `yes'.
+
+`--enable-install-examples'
+ Install the readline example programs as part of `make install'.
+
+`--enable-multibyte'
+ Build with support for multibyte characters enabled on systems with the
+ necessary framework (locale definitions, C library functions, etc.). The
+ default is `yes'.
`--enable-shared'
Build the shared libraries by default on supported platforms. The
`--enable-static'
Build the static libraries by default. The default is `yes'.
-`--enable-bracketed-paste-default'
- Enable bracketed paste by default, so the initial value of the
- `enable-bracketed-paste' Readline variable is `on'. The default
- is `yes'.
-
Shared Libraries
================
on supported platforms.
If `configure' is given the `--enable-shared' option, it will attempt
-to build the shared libraries by default on supported platforms.
+to build the shared libraries by default on supported platforms. This
+option is enabled by default.
Configure calls the script support/shobj-conf to test whether or
not shared library creation is supported and to generate the values
h. rl_completer_word_break_characters is now `const char *' like
rl_basic_word_break_characters.
-i. The non-incremental history searches now leave the current history offset
- at the position of the last matching history entry, like incremental search.
-
-j. Readline looks in $LS_COLORS for a custom filename extension
+i. Readline looks in $LS_COLORS for a custom filename extension
(*.readline-colored-completion-prefix) and uses that as the default color
for the common prefix displayed when `colored-completion-prefix' is set.
#! /bin/sh
-# From configure.ac for Readline 8.2, version 2.95.
+# From configure.ac for Readline 8.2, version 2.96.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for readline 8.2.
#
ac_user_opts='
enable_option_checking
with_curses
+with_shared_termcap_library
enable_multibyte
enable_shared
enable_static
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-curses use the curses library instead of the termcap
library
+ --enable-shared-termcap-library
+ link the readline shared library against the
+ termcap/curses shared library [[default=NO]]
Some influential environment variables:
CC C compiler command
opt_curses=no
+opt_shared_termcap_lib=no
# Check whether --with-curses was given.
fi
+# Check whether --with-shared-termcap-library was given.
+if test ${with_shared_termcap_library+y}
+then :
+ withval=$with_shared_termcap_library; opt_shared_termcap_lib=$withval
+fi
+
+
if test "$opt_curses" = "yes"; then
prefer_curses=yes
fi
fi
fi
+case "$opt_shared_termcap_lib" in
+[Yy][Ee][Ss]) SHARED_TERMCAP="$TERMCAP_LIB" ;;
+-l*) SHARED_TERMCAP="$opt_shared_termcap_lib" ;;
+esac
case "$TERMCAP_LIB" in
-ltinfo) TERMCAP_PKG_CONFIG_LIB=tinfo ;;
printf %s "checking configuration for building shared libraries... " >&6; }
eval `TERMCAP_LIB=$TERMCAP_LIB ${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
-# case "$SHLIB_LIBS" in
-# *curses*|*termcap*|*termlib*) ;;
-# *) SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;;
-# esac
+ case "$SHLIB_LIBS" in
+ *curses*|*termcap*|*termlib*|*tinfo*) ;;
+ *) SHLIB_LIBS="$SHLIB_LIBS $SHARED_TERMCAP" ;;
+ esac
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-AC_REVISION([for Readline 8.2, version 2.95])
+AC_REVISION([for Readline 8.2, version 2.96])
AC_INIT(readline, 8.2, bug-readline@gnu.org)
dnl configure defaults
opt_curses=no
+opt_shared_termcap_lib=no
dnl arguments to configure
AC_ARG_WITH(curses, AS_HELP_STRING([--with-curses], [use the curses library instead of the termcap library]), opt_curses=$withval)
+AC_ARG_WITH(shared-termcap-library, AS_HELP_STRING([--enable-shared-termcap-library], [link the readline shared library against the termcap/curses shared library [[default=NO]]]), opt_shared_termcap_lib=$withval)
if test "$opt_curses" = "yes"; then
prefer_curses=yes
if test "$TERMCAP_LIB" = "-lncurses"; then
AC_CHECK_HEADERS(ncurses/termcap.h)
fi
+case "$opt_shared_termcap_lib" in
+[[Yy]][[Ee]][[Ss]]) SHARED_TERMCAP="$TERMCAP_LIB" ;;
+-l*) SHARED_TERMCAP="$opt_shared_termcap_lib" ;;
+esac
case "$TERMCAP_LIB" in
-ltinfo) TERMCAP_PKG_CONFIG_LIB=tinfo ;;
AC_MSG_CHECKING(configuration for building shared libraries)
eval `TERMCAP_LIB=$TERMCAP_LIB ${CONFIG_SHELL-/bin/sh} ${srcdir}/support/shobj-conf -C "${CC}" -c ${host_cpu} -o ${host_os} -v ${host_vendor}`
-# case "$SHLIB_LIBS" in
-# *curses*|*termcap*|*termlib*) ;;
-# *) SHLIB_LIBS="$SHLIB_LIBS $TERMCAP_LIB" ;;
-# esac
+ # SHARED_TERMCAP is set only if opt_shared_termcap_library is set
+ case "$SHLIB_LIBS" in
+ *curses*|*tinfo*) ;;
+ *termcap*|*termlib*) ;; # common aliases
+ *) SHLIB_LIBS="$SHLIB_LIBS $SHARED_TERMCAP" ;;
+ esac
AC_SUBST(SHOBJ_CC)
AC_SUBST(SHOBJ_CFLAGS)
.\" Case Western Reserve University
.\" chet.ramey@case.edu
.\"
-.\" Last Change: Thu Feb 10 10:58:32 EST 2022
+.\" Last Change: Fri Mar 11 10:14:10 EST 2022
.\"
-.TH READLINE 3 "2022 February 10" "GNU Readline 8.2"
+.TH READLINE 3 "2022 March 11" "GNU Readline 8.2"
.\"
.\" File Name macro. This used to be `.PN', for Path Name,
.\" but Sun doesn't seem to like that very much.
matching text found by incremental and non-incremental history searches.
.TP
.B enable\-bracketed\-paste (On)
-When set to \fBOn\fP, readline will configure the terminal in a way
-that will enable it to insert each paste into the editing buffer as a
-single string of characters, instead of treating each character as if
-it had been read from the keyboard
-and executing any editing commands
-bound to key sequences appearing in the pasted text.
-This will prevent pasted characters from being interpreted as editing commands.
+When set to \fBOn\fP, readline configures the terminal to insert each
+paste into the editing buffer as a single string of characters, instead
+of treating each character as if it had been read from the keyboard.
+This prevents readline from executing any editing commands bound to key
+sequences appearing in the pasted text.
.TP
.B enable\-keypad (Off)
When set to \fBOn\fP, readline will try to enable the application
@item enable-bracketed-paste
@vindex enable-bracketed-paste
-When set to @samp{On}, Readline will configure the terminal in a way
-that will enable it to insert each paste into the editing buffer as a
-single string of characters, instead of treating each character as if
-it had been read from the keyboard
-and executing any editing commands
-bound to key sequences appearing in the pasted text.
-This will prevent pasted characters from being interpreted as editing commands.
+When set to @samp{On}, Readline configures the terminal to insert each
+paste into the editing buffer as a single string of characters, instead
+of treating each character as if it had been read from the keyboard.
+This is called putting the terminal into @dfn{bracketed paste mode};
+it prevents Readline from executing any editing commands bound to key
+sequences appearing in the pasted text.
The default is @samp{On}.
@item enable-keypad
@set EDITION 8.2
@set VERSION 8.2
-@set UPDATED 18 February 2022
-@set UPDATED-MONTH February 2022
+@set UPDATED 11 March 2022
+@set UPDATED-MONTH March 2022
-@set LASTCHANGE Fri Feb 18 11:12:48 EST 2022
+@set LASTCHANGE Fri Mar 11 10:13:51 EST 2022
/* nls.c -- skeletal internationalization code. */
-/* Copyright (C) 1996-2021 Free Software Foundation, Inc.
+/* Copyright (C) 1996-2022 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.
#include "readline.h"
#include "rlshell.h"
#include "rlprivate.h"
+#include "xmalloc.h"
static int utf8locale (char *);
/* Keymap holding the function currently being executed. */
Keymap rl_executing_keymap;
+/* The function currently being executed. */
+rl_command_func_t *_rl_executing_func;
+
/* Keymap we're currently using to dispatch. */
Keymap _rl_dispatching_keymap;
/* We don't want to do this if we executed functions that call
history_set_pos to set the history offset to the line containing the
non-incremental search string. */
+#if HISTORY_SEARCH_SETS_HISTPOS
if (entry && rl_undo_list && _rl_history_search_pos != where_history ())
+#else
+ if (entry && rl_undo_list)
+#endif
{
temp = savestring (the_line);
rl_revert_line (1, 0);
rl_executing_keymap = _rl_command_to_execute->map;
rl_executing_key = _rl_command_to_execute->key;
+ _rl_executing_func = _rl_command_to_execute->func;
+
rl_dispatching = 1;
RL_SETSTATE(RL_STATE_DISPATCHING);
r = (*(_rl_command_to_execute->func)) (_rl_command_to_execute->count, _rl_command_to_execute->key);
rl_executing_keymap = map;
rl_executing_key = key;
+ _rl_executing_func = func;
+
RESIZE_KEYSEQ_BUFFER();
rl_executing_keyseq[rl_key_sequence_length++] = key;
rl_executing_keyseq[rl_key_sequence_length] = '\0';
extern void _rl_add_executing_keyseq (int);
extern void _rl_del_executing_keyseq (void);
+extern rl_command_func_t *_rl_executing_func;
+
/* rltty.c */
extern int _rl_disable_tty_signals (void);
extern int _rl_restore_tty_signals (void);
static void
make_history_line_current (HIST_ENTRY *entry)
{
- /* At this point, rl_undo_list points to a private search string list. */
- if (rl_undo_list && rl_undo_list != (UNDO_LIST *)entry->data)
- rl_free_undo_list ();
-
- /* This will need to free the saved undo list associated with the original
- (pre-search) line buffer. */
- if (_rl_saved_line_for_history)
- _rl_free_saved_history_line ();
-
- rl_maybe_save_line ();
-
/* Now we create a new undo list with a single insert for this text.
WE DON'T CHANGE THE ORIGINAL HISTORY ENTRY UNDO LIST */
_rl_replace_text (entry->line, 0, rl_end);
current editing buffer. */
rl_free_undo_list ();
#endif
+
+ /* XXX - free the saved line for history here? */
}
/* Search the history list for STRING starting at absolute history position
history_set_pos (oldpos);
make_history_line_current (entry);
+ /* make_history_line_current used to do this. */
_rl_free_saved_history_line ();
if (_rl_enable_active_region && ((flags & SF_PATTERN) == 0) && ind > 0 && ind < rl_end)
rl_history_search_internal (int count, int dir)
{
HIST_ENTRY *temp;
- int ret, oldpos, newcol;
+ UNDO_LIST *origlist;
+ int ret, oldpos, newcol, had_saved_line, origpos;
char *t;
+ origpos = where_history ();
+ had_saved_line = _rl_saved_line_for_history != 0;
rl_maybe_save_line ();
/* This will either be restored from the saved line or set from the
found history line. */
/* If we didn't find anything at all, return. */
if (temp == 0)
{
+ /* XXX - check had_saved_line here? */
rl_maybe_unsave_line ();
rl_ding ();
/* If you don't want the saved history line (last match) to show up
/* Copy the line we found into the current line buffer. */
make_history_line_current (temp);
+ /* Free the saved history line corresponding to the search string */
+ if (had_saved_line == 0)
+ _rl_free_saved_history_line ();
+
+#if HISTORY_SEARCH_SETS_HISTPOS
+ /* XXX - can't make this work the way I want it to yet. Too much assumes
+ that rl_undo_list corresponds to the current history entry's undo list,
+ especially the stuff in maybe_save_line and especially maybe_replace_line.
+ Leaving it commented out for now. */
+
/* Make sure we set the current history position to the last line found so
we can do things like operate-and-get-next from here. This is similar to
how incremental search behaves. */
- rl_maybe_replace_line ();
- history_set_pos (_rl_history_search_pos); /* XXX */
+ origlist = rl_undo_list;
+ rl_undo_list = 0; /* XXX - was (UNDO_LIST *)temp->data */
+ if (_rl_history_search_pos < origpos)
+ rl_get_previous_history (origpos - _rl_history_search_pos, 0);
+ else
+ rl_get_next_history (_rl_history_search_pos - origpos, 0);
+ rl_undo_list = origlist;
+#endif
/* decide where to put rl_point -- need to change this for pattern search */
if (_rl_history_search_flags & ANCHORED_SEARCH)