From: Chet Ramey Date: Tue, 17 Dec 2024 15:48:43 +0000 (-0500) Subject: Readline-8.3-beta release X-Git-Tag: readline-8.3-beta X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d75def33c0643206fb2351ffce9f1d9a86685092;p=thirdparty%2Freadline.git Readline-8.3-beta release --- diff --git a/.gitignore b/.gitignore index c6bc41e..fa63a9b 100644 --- a/.gitignore +++ b/.gitignore @@ -21,11 +21,15 @@ examples/hist_purgecmd examples/histexamp examples/rl examples/rl-callbacktest +examples/rl-callbacktest2 +examples/rl-callbacktest3 examples/rlbasic examples/rlcat examples/rlevent examples/rltest examples/rlversion +examples/rl-timeout +examples/rlkeymaps libhistory.so.* libreadline.so.* @@ -33,7 +37,6 @@ libreadline.so.* *.dylib readline.pc +history.pc stamp-h - -*.orig diff --git a/CHANGELOG b/CHANGELOG index 8dc36fc..783a097 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1465,3 +1465,30 @@ Makefile.in config.h.in - added more defines that bash aclocal.m4 BASH_CHECK_MULTIBYTE checks for + + 5/10 + ---- +examples/rlfe + - lots of updates to configure.ac to make it build on modern systems + and more-or-less work with autoconf-2.72 (still warnings about + obsolete macros) + - add prototypes and declarations to pty.c + + 5/11 + ---- +configure.ac + - AC_PROG_GCC_TRADITIONAL: remove + - need to note in CHANGES that configure now supports --enable-year2038. + THIS IS AN ABI CHANGE IF YOU ENABLE IT + + 7/7 + --- +configure.ac + - add ncursesw as a possible value for TERMCAP_PKG_CONFIG_LIB, with + corresponding changes to aclocal.m4, which is shared with bash + + 7/24 + ---- +configure.ac,Makefile.in + - STYLE_CFLAGS: set like bash if we're using gcc or clang; add to + CCFLAGS so we can compile -Wno-parentheses by default diff --git a/CHANGES b/CHANGES index 746a250..03ee607 100644 --- a/CHANGES +++ b/CHANGES @@ -81,6 +81,34 @@ z. Loading very large history files should be much faster. aa. Retry opening startup files if the open is interrupted by a signal and is not automatically restarted. +bb. Make sure the bracketed-paste input buffer is null-terminated when read + returns an error. + +cc. Fixed a small memory leak in execute-named-command if the command doesn't + exist or the function doesn't return. + +dd. Fix for attempting to change case of invalid multibyte characters. + +ee. Fix for possible completions that compare identically when using case- + insensitive completion but have different byte lengths. + +ff. Fix to make non-incremental searches use undo lists and set the history + position the same way as incremental searches. + +gg. Don't check for signals when handling a received signal. + +hh. Fix off-by-one error when tokenizing words like $((expr)) while performing + history expansion. + +ii. Fixes for incremental searches and redisplay in the C locale. + +jj. Fixes for some use-after-free of the undo list errors when stacking multiple + commands that use rl_maybe_replace_line to save changes to a history entry. + +kk. Fixes to ensure that completion-prefix-display-length and + colored-completion-prefix are mutually exclusive. + + 2. New Features in Readline a. Output a newline if there is no prompt and readline reads an empty line. @@ -113,6 +141,18 @@ i. Incremental and non-incremental searches now allow ^V/^Q (or, in the former case, anything bound to quoted-insert) to quote characters in the search string. +j. Documentation has been significantly updated. + +k. New `force-meta-prefix' bindable variable, which forces the use of ESC as + the meta prefix when using "\M-" in key bindings instead of overloading + convert-meta. + +l. The default value for `readline-colored-completion-prefix' no longer has a + leading `.'; the original report was based on a misunderstanding. + +m. There is a new bindable command, `export-completions', which writes the + possible completions for a word to the standard output in a defined format. + ------------------------------------------------------------------------------- This document details the changes between this version, readline-8.2, and the previous version, readline-8.1. diff --git a/INSTALL b/INSTALL index 9960c07..2cb247a 100644 --- a/INSTALL +++ b/INSTALL @@ -14,12 +14,17 @@ The simplest way to compile readline is: Running `configure' takes some time. While running, it prints some messages telling which features it is checking for. + If you want to build readline in a directory other than the source + directory, just run `configure' using a full pathname, for instance: + + bash /usr/local/src/readline/readline-8.3/configure + 2. Type `make' to compile readline and build the static readline - and history libraries. If supported, the shared readline and history - libraries will be built also. See below for instructions on compiling - the other parts of the distribution. Typing `make everything' will - cause the static and shared libraries (if supported) and the example - programs to be built. + and history libraries. If supported, this will build the shared + readline and history libraries also. See below for instructions on + compiling the other parts of the distribution. Typing `make everything' + will build the static and shared libraries (if supported) and the + example programs. 3. Type `make install' to install the static readline and history libraries, the readline include files, the documentation, and, if diff --git a/MANIFEST b/MANIFEST index ea28c11..149ffbb 100644 --- a/MANIFEST +++ b/MANIFEST @@ -112,8 +112,8 @@ doc/hstech.texi f doc/hsuser.texi f doc/readline.3 f doc/history.3 f -doc/texi2dvi f -doc/texi2html f +doc/texi2dvi f 755 +doc/texi2html f 755 examples/Makefile.in f examples/excallback.c f examples/fileman.c f @@ -145,17 +145,19 @@ examples/rlfe/Makefile.in f examples/rlfe/README f examples/rlfe/config.h.in f examples/rlfe/configure f 755 -examples/rlfe/configure.in f +examples/rlfe/configure.ac f examples/rlfe/extern.h f examples/rlfe/os.h f examples/rlfe/pty.c f examples/rlfe/rlfe.c f examples/rlfe/screen.h f -examples/rlwrap-0.30.tar.gz f +examples/rlwrap-0.46.1.tar.gz f # formatted documentation, from MANIFEST.doc doc/readline.ps f doc/history.ps f doc/rluserman.ps f +doc/readline_3.ps f +doc/history_3.ps f doc/readline.dvi f doc/history.dvi f doc/rluserman.dvi f @@ -167,8 +169,8 @@ doc/history.html f doc/rluserman.html f doc/readline.0 f doc/history.0 f -doc/readline_3.ps f -doc/history_3.ps f +doc/readline_3.pdf f +doc/history_3.pdf f doc/history.pdf f doc/readline.pdf f doc/rluserman.pdf f diff --git a/Makefile.in b/Makefile.in index 6c9de8b..30ad54b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,6 +1,6 @@ ## -*- text -*- ## # Master Makefile for the GNU readline library. -# Copyright (C) 1994-2018 Free Software Foundation, Inc. +# Copyright (C) 1994-2024 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -78,6 +78,7 @@ CFLAGS = @CFLAGS@ LOCAL_CFLAGS = @LOCAL_CFLAGS@ -DRL_LIBRARY_VERSION='"$(RL_LIBRARY_VERSION)"' @BRACKETED_PASTE@ CPPFLAGS = @CPPFLAGS@ +STYLE_CFLAGS = @STYLE_CFLAGS@ DEFS = @DEFS@ @CROSS_COMPILE@ LOCAL_DEFS = @LOCAL_DEFS@ @@ -87,7 +88,7 @@ TERMCAP_LIB = @TERMCAP_LIB@ INCLUDES = -I. -I$(srcdir) XCCFLAGS = $(ASAN_CFLAGS) $(DEFS) $(LOCAL_DEFS) $(INCLUDES) $(CPPFLAGS) -CCFLAGS = $(XCCFLAGS) $(LOCAL_CFLAGS) $(CFLAGS) +CCFLAGS = $(XCCFLAGS) $(LOCAL_CFLAGS) $(CFLAGS) $(STYLE_CFLAGS) # could add -Werror here GCC_LINT_FLAGS = -ansi -Wall -Wshadow -Wpointer-arith -Wcast-qual \ @@ -98,6 +99,9 @@ GCC_LINT_CFLAGS = $(XCCFLAGS) $(GCC_LINT_FLAGS) @CFLAGS@ @LOCAL_CFLAGS@ ASAN_XCFLAGS = -fsanitize=address -fno-omit-frame-pointer ASAN_XLDFLAGS = -fsanitize=address +UBSAN_XCFLAGS = -fsanitize=undefined -fsanitize-recover -fstack-protector +UBSAN_XLDFLAGS = -fsanitize=undefined + install_examples = @EXAMPLES_INSTALL_TARGET@ .c.o: @@ -167,7 +171,7 @@ all: $(TARGETS) everything: all examples asan: - ${MAKE} ${MFLAGS} ASAN_CFLAGS='${ASAN_XCFLAGS}' ASAN_LDFLAGS='${ASAN_XLDFLAGS}' everything + ${MAKE} ASAN_CFLAGS='${ASAN_XCFLAGS}' ASAN_LDFLAGS='${ASAN_XLDFLAGS}' everything static: $(STATIC_LIBS) @@ -191,7 +195,7 @@ readline: $(OBJECTS) readline.h rldefs.h chardefs.h ./libreadline.a $(CC) $(CCFLAGS) -DREADLINE_LIBRARY -o $@ $(top_srcdir)/examples/rl.c ./libreadline.a ${TERMCAP_LIB} lint: force - $(MAKE) $(MFLAGS) CCFLAGS='$(GCC_LINT_CFLAGS)' static + $(MAKE) CCFLAGS='$(GCC_LINT_CFLAGS)' static Makefile makefile: config.status $(srcdir)/Makefile.in CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status @@ -216,15 +220,15 @@ stamp-h: config.status $(srcdir)/config.h.in shared: force -test -d shlib || mkdir shlib - ( cd shlib ; ${MAKE} ${MFLAGS} all ) + ( cd shlib ; ${MAKE} all ) documentation: force -test -d doc || mkdir doc - -( cd doc && $(MAKE) $(MFLAGS) ) + -( cd doc && $(MAKE) ) examples: force -test -d examples || mkdir examples - -(cd examples && ${MAKE} ${MFLAGS} all ) + -(cd examples && ${MAKE} all ) force: @@ -268,32 +272,32 @@ installdirs: $(srcdir)/support/mkinstalldirs uninstall: uninstall-headers uninstall-doc uninstall-examples uninstall-pc -test -n "$(DESTDIR)$(libdir)" && cd $(DESTDIR)$(libdir) && \ ${RM} libreadline.a libreadline.old libhistory.a libhistory.old $(SHARED_LIBS) - -( cd shlib; ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} uninstall ) + -( cd shlib; ${MAKE} DESTDIR=${DESTDIR} uninstall ) install-shared: installdirs install-headers shared install-doc install-pc - ( cd shlib ; ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} install ) + ( cd shlib ; ${MAKE} DESTDIR=${DESTDIR} install ) uninstall-shared: maybe-uninstall-headers maybe-uninstall-pc - -( cd shlib; ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} uninstall ) + -( cd shlib; ${MAKE} DESTDIR=${DESTDIR} uninstall ) install-examples: installdirs install-headers - -( cd examples ; ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} install ) + -( cd examples ; ${MAKE} DESTDIR=${DESTDIR} install ) uninstall-examples: maybe-uninstall-headers - -( cd examples; ${MAKE} ${MFLAGS} DESTDIR=${DESTDIR} uninstall ) + -( cd examples; ${MAKE} DESTDIR=${DESTDIR} uninstall ) install-doc: installdirs $(INSTALL_DATA) $(OTHER_DOCS) $(DESTDIR)$(docdir) -( if test -d doc ; then \ cd doc && \ - ${MAKE} ${MFLAGS} infodir=$(infodir) DESTDIR=${DESTDIR} install; \ + ${MAKE} infodir=$(infodir) DESTDIR=${DESTDIR} install; \ fi ) uninstall-doc: -( cd $(DESTDIR)$(docdir) && ${RM} ${OTHER_INSTALLED_DOCS} ) -( if test -d doc ; then \ cd doc && \ - ${MAKE} ${MFLAGS} infodir=$(infodir) DESTDIR=${DESTDIR} uninstall; \ + ${MAKE} infodir=$(infodir) DESTDIR=${DESTDIR} uninstall; \ fi ) TAGS: force @@ -302,22 +306,24 @@ TAGS: force tags: force -( cd $(srcdir) && $(CTAGS) $(CSOURCES) $(HSOURCES) ) -clean: force +.PHONY: clean maintainer-clean distclean mostlyclean + +mostlyclean: force $(RM) $(OBJECTS) $(STATIC_LIBS) $(RM) readline readline.exe - ( cd shlib && $(MAKE) $(MFLAGS) $@ ) - -( cd doc && $(MAKE) $(MFLAGS) $@ ) - -( cd examples && $(MAKE) $(MFLAGS) $@ ) + ( cd shlib && $(MAKE) $@ ) + -( cd doc && $(MAKE) $@ ) + -( cd examples && $(MAKE) $@ ) -mostlyclean: clean - ( cd shlib && $(MAKE) $(MFLAGS) $@ ) - -( cd doc && $(MAKE) $(MFLAGS) $@ ) - -( cd examples && $(MAKE) $(MFLAGS) $@ ) +clean: mostlyclean + ( cd shlib && $(MAKE) $@ ) + -( cd doc && $(MAKE) $@ ) + -( cd examples && $(MAKE) $@ ) distclean maintainer-clean: clean - ( cd shlib && $(MAKE) $(MFLAGS) $@ ) - -( cd doc && $(MAKE) $(MFLAGS) $@ ) - -( cd examples && $(MAKE) $(MFLAGS) $@ ) + ( cd shlib && $(MAKE) $@ ) + -( cd doc && $(MAKE) $@ ) + -( cd examples && $(MAKE) $@ ) $(RM) Makefile $(RM) $(CREATED_CONFIGURE) $(RM) $(CREATED_TAGS) @@ -329,7 +335,7 @@ history.pc: config.status $(srcdir)/history.pc.in $(SHELL) config.status info dvi html pdf ps: - -( cd doc && $(MAKE) $(MFLAGS) $@ ) + -( cd doc && $(MAKE) $@ ) install-info: install-dvi: diff --git a/NEWS b/NEWS index 033c560..81fa526 100644 --- a/NEWS +++ b/NEWS @@ -33,6 +33,18 @@ i. Incremental and non-incremental searches now allow ^V/^Q (or, in the former case, anything bound to quoted-insert) to quote characters in the search string. +j. Documentation has been significantly updated. + +k. New `force-meta-prefix' bindable variable, which forces the use of ESC as + the meta prefix when using "\M-" in key bindings instead of overloading + convert-meta. + +l. The default value for `readline-colored-completion-prefix' no longer has a + leading `.'; the original report was based on a misunderstanding. + +m. There is a new bindable command, `export-completions', which writes the + possible completions for a word to the standard output in a defined format. + ------------------------------------------------------------------------------- This is a terse description of the new features added to readline-8.2 since the release of readline-8.1. diff --git a/README b/README index 83cdb23..75eaa2f 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ Introduction ============ -This is the Gnu Readline library, version 8.2. +This is the Gnu Readline library, version 8.3. The Readline library provides a set of functions for use by applications that allow users to edit command lines as they are typed in. Both @@ -33,7 +33,8 @@ may work: env CC=cc ./configure Read the file INSTALL in this directory for more information about how -to customize and control the build process. +to customize and control the build process, including how to build readline +in a directory other than the source directory. The file rlconf.h contains C preprocessor defines that enable and disable certain Readline features. @@ -47,7 +48,7 @@ Examples There are several example programs that use Readline features in the examples directory. The `rl' program is of particular interest. It is a command-line interface to Readline, suitable for use in shell -scripts in place of `read'. +scripts in place of `read' (but look at bash's `read -e' first). Shared Libraries ================ diff --git a/aclocal.m4 b/aclocal.m4 index ac42dbf..7253f2c 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -935,8 +935,8 @@ AC_CACHE_VAL(bash_cv_termcap_lib, [AC_CHECK_LIB(termcap, tgetent, bash_cv_termcap_lib=libtermcap, [AC_CHECK_LIB(tinfo, tgetent, bash_cv_termcap_lib=libtinfo, [AC_CHECK_LIB(curses, tgetent, bash_cv_termcap_lib=libcurses, - [AC_CHECK_LIB(ncurses, tgetent, bash_cv_termcap_lib=libncurses, - [AC_CHECK_LIB(ncursesw, tgetent, bash_cv_termcap_lib=libncursesw, + [AC_CHECK_LIB(ncursesw, tgetent, bash_cv_termcap_lib=libncursesw, + [AC_CHECK_LIB(ncurses, tgetent, bash_cv_termcap_lib=libncurses, bash_cv_termcap_lib=gnutermcap)])])])])])]) if test "X$_bash_needmsg" = "Xyes"; then AC_MSG_CHECKING(which library has the termcap functions) @@ -952,6 +952,9 @@ TERMCAP_DEP= elif test $bash_cv_termcap_lib = libtinfo; then TERMCAP_LIB=-ltinfo TERMCAP_DEP= +elif test $bash_cv_termcap_lib = libncursesw; then +TERMCAP_LIB=-lncursesw +TERMCAP_DEP= elif test $bash_cv_termcap_lib = libncurses; then TERMCAP_LIB=-lncurses TERMCAP_DEP= @@ -1022,7 +1025,7 @@ dnl like _AC_STRUCT_DIRENT(MEMBER) but public AC_DEFUN(BASH_STRUCT_DIRENT, [ AC_REQUIRE([AC_HEADER_DIRENT]) -AC_CHECK_MEMBERS(struct dirent.$1, bash_cv_dirent_has_$1=yes, bash_cv_dirent_has_$1=no, +AC_CHECK_MEMBERS(struct dirent.$1, [], [], [[ #include #include @@ -1046,35 +1049,9 @@ AC_CHECK_MEMBERS(struct dirent.$1, bash_cv_dirent_has_$1=yes, bash_cv_dirent_has ]]) ]) -AC_DEFUN(BASH_STRUCT_DIRENT_D_INO, -[AC_REQUIRE([AC_HEADER_DIRENT]) -AC_MSG_CHECKING(for struct dirent.d_ino) -AC_CACHE_VAL(bash_cv_dirent_has_d_ino, [BASH_STRUCT_DIRENT([d_ino])]) -AC_MSG_RESULT($bash_cv_dirent_has_d_ino) -if test $bash_cv_dirent_has_d_ino = yes; then -AC_DEFINE(HAVE_STRUCT_DIRENT_D_INO) -fi -]) - -AC_DEFUN(BASH_STRUCT_DIRENT_D_FILENO, -[AC_REQUIRE([AC_HEADER_DIRENT]) -AC_MSG_CHECKING(for struct dirent.d_fileno) -AC_CACHE_VAL(bash_cv_dirent_has_d_fileno, [BASH_STRUCT_DIRENT([d_fileno])]) -AC_MSG_RESULT($bash_cv_dirent_has_d_fileno) -if test $bash_cv_dirent_has_d_fileno = yes; then -AC_DEFINE(HAVE_STRUCT_DIRENT_D_FILENO) -fi -]) - -AC_DEFUN(BASH_STRUCT_DIRENT_D_NAMLEN, -[AC_REQUIRE([AC_HEADER_DIRENT]) -AC_MSG_CHECKING(for struct dirent.d_namlen) -AC_CACHE_VAL(bash_cv_dirent_has_d_namlen, [BASH_STRUCT_DIRENT([d_namlen])]) -AC_MSG_RESULT($bash_cv_dirent_has_d_namlen) -if test $bash_cv_dirent_has_d_namlen = yes; then -AC_DEFINE(HAVE_STRUCT_DIRENT_D_NAMLEN) -fi -]) +AC_DEFUN([BASH_STRUCT_DIRENT_D_INO], [BASH_STRUCT_DIRENT([d_ino])]) +AC_DEFUN([BASH_STRUCT_DIRENT_D_FILENO], [BASH_STRUCT_DIRENT([d_fileno])]) +AC_DEFUN([BASH_STRUCT_DIRENT_D_NAMLEN], [BASH_STRUCT_DIRENT([d_namlen])]) AC_DEFUN(BASH_STRUCT_TIMEVAL, [AC_MSG_CHECKING(for struct timeval in sys/time.h and time.h) diff --git a/bind.c b/bind.c index af3d70e..6aaa637 100644 --- a/bind.c +++ b/bind.c @@ -1,6 +1,6 @@ /* bind.c -- key binding and startup file support for the readline library. */ -/* Copyright (C) 1987-2023 Free Software Foundation, Inc. +/* Copyright (C) 1987-2024 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. @@ -98,6 +98,15 @@ static int currently_reading_init_file; /* used only in this file */ static int _rl_prefer_visible_bell = 1; +/* Currently confined to this file for key bindings. If enabled (> 0), we + force meta key bindings to use the meta prefix (ESC). If unset (-1) or + disabled (0), we use the current value of _rl_convert_meta_chars_to_ascii + as in previous readline versions. */ +static int _rl_force_meta_prefix = 0; + +/* Do we want to force binding "\M-C" to the meta prefix (ESC-C)? */ +#define FORCE_META_PREFIX() (_rl_force_meta_prefix > 0 ? 1 : _rl_convert_meta_chars_to_ascii) + #define OP_EQ 1 #define OP_NE 2 #define OP_GT 3 @@ -137,7 +146,7 @@ rl_bind_key (int key, rl_command_func_t *function) return (key); /* Want to make this a multi-character key sequence with an ESC prefix */ - if (META_CHAR (key) && _rl_convert_meta_chars_to_ascii) + if (META_CHAR (key) && FORCE_META_PREFIX()) { if (_rl_keymap[ESC].type == ISKMAP) { @@ -257,7 +266,7 @@ rl_unbind_function_in_map (rl_command_func_t *func, Keymap map) map[i].function = (rl_command_func_t *)NULL; rval = 1; } - else if (map[i].type == ISKMAP) /* TAG:readline-8.1 */ + else if (map[i].type == ISKMAP) { int r; r = rl_unbind_function_in_map (func, FUNCTION_TO_KEYMAP (map, i)); @@ -418,19 +427,8 @@ rl_generic_bind (int type, const char *keyseq, char *data, Keymap map) return -1; } - /* We now rely on rl_translate_keyseq to do this conversion, so this - check is superfluous. */ -#if 0 - if (META_CHAR (ic) && _rl_convert_meta_chars_to_ascii) - { - ic = UNMETA (ic); - if (map[ESC].type == ISKMAP) - { - prevmap = map; - map = FUNCTION_TO_KEYMAP (map, ESC); - } - } -#endif + /* We rely on rl_translate_keyseq to do convert meta-chars to key + sequences with the meta prefix (ESC). */ if ((i + 1) < keys_len) { @@ -617,14 +615,13 @@ rl_translate_keyseq (const char *seq, char *array, int *len) c = (c == '?') ? RUBOUT : CTRL (_rl_to_upper (c)); has_control = 0; } + if (has_meta) - { - c = META (c); - has_meta = 0; - } + c = META (c); - /* If convert-meta is turned on, convert a meta char to a key sequence */ - if (META_CHAR (c) && _rl_convert_meta_chars_to_ascii) + /* If force-meta-prefix is turned on, convert a meta char to a key + sequence, but only if it uses the \M- syntax. */ + if (META_CHAR (c) && has_meta && FORCE_META_PREFIX()) { int x = UNMETA (c); if (x) @@ -638,6 +635,8 @@ rl_translate_keyseq (const char *seq, char *array, int *len) else array[l++] = (c); + has_meta = 0; + /* Null characters may be processed for incomplete prefixes at the end of sequence */ if (seq[i] == '\0') @@ -698,7 +697,7 @@ rl_untranslate_keyseq (int seq) c = UNMETA (c); } - if (c == ESC) + if (c == ESC) /* look at _rl_force_meta_prefix here? */ { kseq[i++] = '\\'; c = 'e'; @@ -805,7 +804,7 @@ _rl_function_of_keyseq_internal (const char *keyseq, size_t len, Keymap map, int { unsigned char ic = keyseq[i]; - if (META_CHAR (ic) && _rl_convert_meta_chars_to_ascii) + if (META_CHAR (ic) && FORCE_META_PREFIX()) /* XXX - might not want this */ { if (map[ESC].type == ISKMAP) { @@ -1865,6 +1864,7 @@ rl_parse_and_bind (char *string) false. */ #define V_SPECIAL 0x1 +#define V_DEPRECATED 0x02 static const struct { const char * const name; @@ -1888,6 +1888,7 @@ static const struct { { "enable-keypad", &_rl_enable_keypad, 0 }, { "enable-meta-key", &_rl_enable_meta, 0 }, { "expand-tilde", &rl_complete_with_tilde_expansion, 0 }, + { "force-meta-prefix", &_rl_force_meta_prefix, 0 }, { "history-preserve-point", &_rl_history_preserve_point, 0 }, { "horizontal-scroll-mode", &_rl_horizontal_scroll_mode, 0 }, { "input-meta", &_rl_meta_flag, 0 }, @@ -2749,7 +2750,7 @@ rl_print_keybinding (const char *name, Keymap kmap, int print_readably) char **invokers; function = rl_named_function (name); - invokers = rl_invoking_keyseqs_in_map (function, kmap ? kmap : _rl_keymap); + invokers = function ? rl_invoking_keyseqs_in_map (function, kmap ? kmap : _rl_keymap) : (char **)NULL; if (print_readably) { diff --git a/colors.c b/colors.c index 28ed7bc..329acce 100644 --- a/colors.c +++ b/colors.c @@ -73,7 +73,7 @@ static bool is_colored (enum indicator_no type); static void restore_default_color (void); -#define RL_COLOR_PREFIX_EXTENSION ".readline-colored-completion-prefix" +#define RL_COLOR_PREFIX_EXTENSION "readline-colored-completion-prefix" COLOR_EXT_TYPE *_rl_color_ext_list = 0; diff --git a/complete.c b/complete.c index f564a47..473f04d 100644 --- a/complete.c +++ b/complete.c @@ -77,6 +77,10 @@ extern int errno; # include "colors.h" #endif +#ifndef MIN +#define MIN(x,y) (((x) < (y)) ? (x): (y)) +#endif + typedef int QSFUNC (const void *, const void *); #ifdef HAVE_LSTAT @@ -149,6 +153,8 @@ static int complete_get_screenwidth (void); static char *make_quoted_replacement (char *, int, char *); +static void _rl_export_completions (char **, char *, int, int); + /* **************************************************************** */ /* */ /* Completion matching, from readline's point of view. */ @@ -535,6 +541,18 @@ _rl_complete_sigcleanup (int sig, void *ptr) /* */ /************************************/ +static inline size_t +vector_len (char **vector) +{ + size_t ret; + + if (vector == 0 || vector[0] == 0) + return (size_t)0; + for (ret = 0; vector[ret]; ret++) + ; + return ret; +} + /* Reset public readline state on a signal or other event. */ void _rl_reset_completion_state (void) @@ -863,7 +881,8 @@ fnprint (const char *to_print, int prefix_bytes, const char *real_pathname) possible completions. Only cut off prefix_bytes if we're going to be printing the ellipsis, which takes precedence over coloring the completion prefix (see print_filename() below). */ - if (_rl_completion_prefix_display_length > 0 && prefix_bytes >= print_len) + if (_rl_completion_prefix_display_length > 0 && prefix_bytes >= print_len && + prefix_bytes > _rl_completion_prefix_display_length) prefix_bytes = 0; #if defined (COLOR_SUPPORT) @@ -882,13 +901,16 @@ fnprint (const char *to_print, int prefix_bytes, const char *real_pathname) printed_len = ELLIPSIS_LEN; } #if defined (COLOR_SUPPORT) - else if (prefix_bytes && _rl_colored_completion_prefix > 0) + else if (prefix_bytes && _rl_completion_prefix_display_length <= 0 && + _rl_colored_completion_prefix > 0) { common_prefix_len = prefix_bytes; prefix_bytes = 0; /* XXX - print color indicator start here */ colored_prefix_start (); } + else + common_prefix_len = prefix_bytes = 0; /* no ellipsis or color */ #endif s = to_print + prefix_bytes; @@ -1297,8 +1319,7 @@ remove_duplicate_matches (char **matches) char **temp_array; /* Sort the items. */ - for (i = 0; matches[i]; i++) - ; + i = vector_len (matches); /* Sort the array without matches[0], since we need it to stay in place no matter what. */ @@ -1355,9 +1376,9 @@ compute_lcd_of_matches (char **match_list, int matches, const char *text) int low; /* Count of max-matched characters. */ int lx; char *dtext; /* dequoted TEXT, if needed */ + size_t si1, si2; size_t len1, len2; #if defined (HANDLE_MULTIBYTE) - int v; size_t v1, v2; mbstate_t ps1, ps2; WCHAR_T wc1, wc2; @@ -1385,7 +1406,7 @@ compute_lcd_of_matches (char **match_list, int matches, const char *text) len1 = strlen (match_list[i]); len2 = strlen (match_list[i + 1]); - for (si = 0; (c1 = match_list[i][si]) && (c2 = match_list[i + 1][si]); si++) + for (si1 = si2 = 0; (c1 = match_list[i][si1]) && (c2 = match_list[i + 1][si2]); si1++,si2++) { if (_rl_completion_case_fold) { @@ -1395,8 +1416,8 @@ compute_lcd_of_matches (char **match_list, int matches, const char *text) #if defined (HANDLE_MULTIBYTE) if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) { - v1 = MBRTOWC (&wc1, match_list[i]+si, len1 - si, &ps1); - v2 = MBRTOWC (&wc2, match_list[i+1]+si, len2 - si, &ps2); + v1 = MBRTOWC (&wc1, match_list[i]+si1, len1 - si1, &ps1); + v2 = MBRTOWC (&wc2, match_list[i+1]+si2, len2 - si2, &ps2); if (MB_INVALIDCH (v1) || MB_INVALIDCH (v2)) { if (c1 != c2) /* do byte comparison */ @@ -1410,8 +1431,11 @@ compute_lcd_of_matches (char **match_list, int matches, const char *text) } if (wc1 != wc2) break; - else if (v1 > 1) - si += v1 - 1; + + if (v1 > 1) + si1 += v1 - 1; + if (v2 > 1) + si2 += v2 - 1; } else #endif @@ -1419,6 +1443,7 @@ compute_lcd_of_matches (char **match_list, int matches, const char *text) break; } + si = MIN (si1, si2); /* use shorter of matches of different length */ if (low > si) low = si; } @@ -1581,7 +1606,7 @@ rl_display_match_list (char **matches, int len, int max) /* check again in case of /usr/src/ */ temp = rl_filename_completion_desired ? strrchr (t, '/') : 0; common_length = temp ? fnwidth (temp) : fnwidth (t); - sind = temp ? strlen (temp) : strlen (t); + sind = temp ? RL_STRLEN (temp) : RL_STRLEN (t); if (common_length > max || sind > max) common_length = sind = 0; @@ -2038,7 +2063,9 @@ compare_match (char *text, const char *match) `!' means to do standard completion, and list all possible completions if there is more than one. `@' means to do standard completion, and list all possible completions if - there is more than one and partial completion is not possible. */ + there is more than one and partial completion is not possible. + `$' implements a protocol for exporting completions and information about + what is being completed to another process via rl_outstream. */ int rl_complete_internal (int what_to_do) { @@ -2095,9 +2122,11 @@ rl_complete_internal (int what_to_do) nontrivial_lcd = matches && strcmp (text, matches[0]) != 0; if (what_to_do == '!' || what_to_do == '@') tlen = strlen (text); - xfree (text); - if (matches == 0) + if (what_to_do != '$') + xfree (text); + + if (matches == 0 && what_to_do != '$') /* we can export no completions */ { rl_ding (); FREE (saved_line_buffer); @@ -2113,7 +2142,7 @@ rl_complete_internal (int what_to_do) rl_filename_completion_function does this. */ i = rl_filename_completion_desired; - if (postprocess_matches (&matches, i) == 0) + if (postprocess_matches (&matches, i) == 0 && what_to_do != '$') /* we can export no completions */ { rl_ding (); FREE (saved_line_buffer); @@ -2199,6 +2228,11 @@ rl_complete_internal (int what_to_do) do_display = 1; break; + case '$': + _rl_export_completions (matches, text, start, end); + xfree (text); + break; + default: _rl_ttymsg ("bad value %d for what_to_do in rl_complete", what_to_do); rl_ding (); @@ -2764,8 +2798,8 @@ rl_old_menu_complete (int count, int invoking_key) RL_UNSETSTATE(RL_STATE_COMPLETING); - for (match_list_size = 0; matches[match_list_size]; match_list_size++) - ; + match_list_size = vector_len (matches); + /* matches[0] is lcd if match_list_size > 1, but the circular buffer code below should take care of it. */ @@ -2899,8 +2933,7 @@ rl_menu_complete (int count, int ignore) RL_UNSETSTATE(RL_STATE_COMPLETING); - for (match_list_size = 0; matches[match_list_size]; match_list_size++) - ; + match_list_size = vector_len (matches); if (match_list_size == 0) { @@ -2999,3 +3032,55 @@ rl_backward_menu_complete (int count, int key) arguments for menu-complete, and vice versa. */ return (rl_menu_complete (-count, key)); } + +/* This implements a protocol to export completions to another process or + calling application via rl_outstream. + + MATCHES are the possible completions for TEXT, which is the text between + START and END in rl_line_buffer. + + We print: + N - the number of matches + T - the word being completed + S:E - the start and end offsets of T in rl_line_buffer + then each match, one per line + + If there are no matches, MATCHES is NULL, N will be 0, and there will be + no output after S:E. + + Since MATCHES[0] can be empty if there is no common prefix of the elements + of MATCHES, applications should be prepared to deal with an empty line + preceding the matches. +*/ + +static void +_rl_export_completions (char **matches, char *text, int start, int end) +{ + size_t len, i; + + len = vector_len (matches); + + if (RL_ISSTATE (RL_STATE_TERMPREPPED)) + fprintf (rl_outstream, "\r\n"); + fprintf (rl_outstream, "%zd\n", len); + fprintf (rl_outstream, "%s\n", text); + fprintf (rl_outstream, "%d:%d\n", start, end); /* : because it's not a radix character */ + for (i = 0; i < len; i++) + fprintf (rl_outstream, "%s\n", matches[i]); + fflush (rl_outstream); +} + +int +rl_export_completions (int count, int key) +{ + rl_complete_internal ('$'); + + /* Clear the line buffer, currently requires a count argument. */ + if (count > 1) + { + rl_delete_text (0, rl_end); /* undoable */ + rl_point = rl_mark = 0; + } + + return 0; +} diff --git a/configure b/configure index 8fec71f..eb2c1bf 100755 --- a/configure +++ b/configure @@ -1,12 +1,12 @@ #! /bin/sh -# From configure.ac for Readline 8.3, version 2.98. +# From configure.ac for Readline 8.3, version 2.101. # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for readline 8.3. +# Generated by GNU Autoconf 2.72 for readline 8.3. # # Report bugs to . # # -# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, # Inc. # # @@ -18,7 +18,6 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh @@ -27,12 +26,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else $as_nop - case `(set -o) 2>/dev/null` in #( +else case e in #( + e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi @@ -104,7 +104,7 @@ IFS=$as_save_IFS ;; esac -# We did not find ourselves, most probably we were run as `sh COMMAND' +# We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 @@ -134,15 +134,14 @@ case $- in # (((( esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. +# out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="as_nop=: -if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 + as_bourne_compatible="if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: @@ -150,12 +149,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else \$as_nop - case \`(set -o) 2>/dev/null\` in #( +else case e in #( + e) case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi " @@ -173,8 +173,9 @@ as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : -else \$as_nop - exitcode=1; echo positional parameters were not saved. +else case e in #( + e) exitcode=1; echo positional parameters were not saved. ;; +esac fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) @@ -188,14 +189,15 @@ test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes -else $as_nop - as_have_required=no +else case e in #( + e) as_have_required=no ;; +esac fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : -else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do @@ -228,12 +230,13 @@ IFS=$as_save_IFS if $as_found then : -else $as_nop - if { test -f "$SHELL" || test -f "$SHELL.exe"; } && +else case e in #( + e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes -fi +fi ;; +esac fi @@ -255,7 +258,7 @@ case $- in # (((( esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. +# out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi @@ -275,7 +278,8 @@ $0: a modern shell, or manually run the script under such a $0: shell if you do have one." fi exit 1 -fi +fi ;; +esac fi fi SHELL=${CONFIG_SHELL-/bin/sh} @@ -314,14 +318,6 @@ as_fn_exit () as_fn_set_status $1 exit $1 } # as_fn_exit -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -390,11 +386,12 @@ then : { eval $1+=\$2 }' -else $as_nop - as_fn_append () +else case e in #( + e) as_fn_append () { eval $1=\$$1\$2 - } + } ;; +esac fi # as_fn_append # as_fn_arith ARG... @@ -408,21 +405,14 @@ then : { as_val=$(( $* )) }' -else $as_nop - as_fn_arith () +else case e in #( + e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` - } + } ;; +esac fi # as_fn_arith -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- @@ -496,6 +486,8 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits /[$]LINENO/= ' <$as_myself | sed ' + t clear + :clear s/[$]LINENO.*/&-/ t lineno b @@ -544,7 +536,6 @@ esac as_echo='printf %s\n' as_echo_n='printf %s' - rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -556,9 +547,9 @@ if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then @@ -583,10 +574,12 @@ as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated test -n "$DJDIR" || exec 7<&0 /dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" + as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -903,7 +897,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" + as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1116,7 +1110,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" + as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1132,7 +1126,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" + as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1162,8 +1156,8 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" + -*) as_fn_error $? "unrecognized option: '$ac_option' +Try '$0 --help' for more information" ;; *=*) @@ -1171,7 +1165,7 @@ Try \`$0 --help' for more information" # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + as_fn_error $? "invalid variable name: '$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1221,7 +1215,7 @@ do as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done -# There might be people who depend on the old broken behavior: `$host' +# There might be people who depend on the old broken behavior: '$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias @@ -1289,7 +1283,7 @@ if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_msg="sources are in $srcdir, but 'cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` @@ -1317,7 +1311,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures readline 8.3 to adapt to many kinds of systems. +'configure' configures readline 8.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1331,11 +1325,11 @@ Configuration: --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages + -q, --quiet, --silent do not print 'checking ...' messages --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' + -C, --config-cache alias for '--cache-file=config.cache' -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] + --srcdir=DIR find the sources in DIR [configure dir or '..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX @@ -1343,10 +1337,10 @@ Installation directories: --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. +By default, 'make install' will install all the files in +'$ac_default_prefix/bin', '$ac_default_prefix/lib' etc. You can specify +an installation prefix other than '$ac_default_prefix' using '--prefix', +for instance '--prefix=\$HOME'. For better control, use the options below. @@ -1400,6 +1394,7 @@ Optional Features: disable bracketed paste by default [[default=enable]] --disable-largefile omit support for large files + --enable-year2038 support timestamps after 2038 Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1420,7 +1415,7 @@ Some influential environment variables: you have headers in a nonstandard directory CPP C preprocessor -Use these variables to override the choices made by `configure' or to help +Use these variables to override the choices made by 'configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . @@ -1488,9 +1483,9 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF readline configure 8.3 -generated by GNU Autoconf 2.71 +generated by GNU Autoconf 2.72 -Copyright (C) 2021 Free Software Foundation, Inc. +Copyright (C) 2023 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1529,11 +1524,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 } && test -s conftest.$ac_objext then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval @@ -1552,8 +1548,8 @@ printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> @@ -1561,10 +1557,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -1573,44 +1571,6 @@ printf "%s\n" "$ac_res" >&6; } } # ac_fn_c_check_header_compile -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -printf "%s\n" "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } > conftest.i && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - } -then : - ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache @@ -1623,8 +1583,8 @@ printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 @@ -1654,12 +1614,14 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - eval "$3=yes" +else case e in #( + e) eval "$3=yes" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -1699,11 +1661,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 } then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would @@ -1726,15 +1689,15 @@ printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. */ + which can conflict with char $2 (void); below. */ #include #undef $2 @@ -1745,7 +1708,7 @@ else $as_nop #ifdef __cplusplus extern "C" #endif -char $2 (); +char $2 (void); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ @@ -1764,11 +1727,13 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$3=yes" -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + conftest$ac_exeext conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -1807,12 +1772,13 @@ printf "%s\n" "$ac_try_echo"; } >&5 test $ac_status = 0; }; } then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: program exited with status $ac_status" >&5 +else case e in #( + e) printf "%s\n" "$as_me: program exited with status $ac_status" >&5 printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=$ac_status + ac_retval=$ac_status ;; +esac fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno @@ -1820,6 +1786,45 @@ fi } # ac_fn_c_try_run +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +printf "%s\n" "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + } +then : + ac_retval=0 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 ;; +esac +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + # ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES # ---------------------------------------------------- # Tries to find if the field MEMBER exists in type AGGR, after including @@ -1832,8 +1837,8 @@ printf %s "checking for $2.$3... " >&6; } if eval test \${$4+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int @@ -1849,8 +1854,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$4=yes" -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $5 int @@ -1866,12 +1871,15 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$4=yes" -else $as_nop - eval "$4=no" +else case e in #( + e) eval "$4=no" ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$4 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -1893,8 +1901,8 @@ printf %s "checking whether $as_decl_name is declared... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` +else case e in #( + e) as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` eval ac_save_FLAGS=\$$6 as_fn_append $6 " $5" cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1918,12 +1926,14 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext eval $6=\$ac_save_FLAGS - + ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -1977,18 +1987,19 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_hi=$ac_mid; break -else $as_nop - as_fn_arith $ac_mid + 1 && ac_lo=$as_val +else case e in #( + e) as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi - as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int @@ -2023,20 +2034,23 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_lo=$ac_mid; break -else $as_nop - as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val +else case e in #( + e) as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi - as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done -else $as_nop - ac_lo= ac_hi= +else case e in #( + e) ac_lo= ac_hi= ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # Binary search between lo and hi bounds. @@ -2059,8 +2073,9 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_hi=$ac_mid -else $as_nop - as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +else case e in #( + e) as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done @@ -2108,8 +2123,9 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : echo >>conftest.val; read $3 &6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } fi done @@ -2430,9 +2446,7 @@ struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; +static char *e (char **p, int i) { return p[i]; } @@ -2446,6 +2460,21 @@ static char *f (char * (*g) (char **, int), char **p, ...) return s; } +/* C89 style stringification. */ +#define noexpand_stringify(a) #a +const char *stringified = noexpand_stringify(arbitrary+token=sequence); + +/* C89 style token pasting. Exercises some of the corner cases that + e.g. old MSVC gets wrong, but not very hard. */ +#define noexpand_concat(a,b) a##b +#define expand_concat(a,b) noexpand_concat(a,b) +extern int vA; +extern int vbee; +#define aye A +#define bee B +int *pvA = &expand_concat(v,aye); +int *pvbee = &noexpand_concat(v,bee); + /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not \xHH hex character constants. These do not provoke an error unfortunately, instead are silently treated @@ -2473,16 +2502,19 @@ ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' -// Does the compiler advertise C99 conformance? +/* Does the compiler advertise C99 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif +// See if C++-style comments work. + #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); +extern void free (void *); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare @@ -2532,7 +2564,6 @@ typedef const char *ccp; static inline int test_restrict (ccp restrict text) { - // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) @@ -2598,6 +2629,8 @@ ac_c_conftest_c99_main=' ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; + // Work around memory leak warnings. + free (ia); // Check named initializers. struct named_init ni = { @@ -2619,7 +2652,7 @@ ac_c_conftest_c99_main=' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' -// Does the compiler advertise C11 conformance? +/* Does the compiler advertise C11 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif @@ -2813,8 +2846,9 @@ IFS=$as_save_IFS if $as_found then : -else $as_nop - as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 +else case e in #( + e) as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5 ;; +esac fi @@ -2842,12 +2876,12 @@ for ac_var in $ac_precious_vars; do eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) @@ -2856,18 +2890,18 @@ printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: '$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: '$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: '$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: '$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: '$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. @@ -2883,11 +2917,11 @@ printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} fi done if $ac_cache_corrupted; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + as_fn_error $? "run '${MAKE-make} distclean' and/or 'rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## @@ -2923,15 +2957,16 @@ printf %s "checking build system type... " >&6; } if test ${ac_cv_build+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_build_alias=$build_alias +else case e in #( + e) ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5 - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 printf "%s\n" "$ac_cv_build" >&6; } @@ -2958,14 +2993,15 @@ printf %s "checking host system type... " >&6; } if test ${ac_cv_host+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "x$host_alias" = x; then +else case e in #( + e) if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` || as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5 fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 printf "%s\n" "$ac_cv_host" >&6; } @@ -3101,8 +3137,8 @@ ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval test \${ac_cv_prog_make_${ac_make}_set+y} then : printf %s "(cached) " >&6 -else $as_nop - cat >conftest.make <<\_ACEOF +else case e in #( + e) cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' @@ -3114,7 +3150,8 @@ case `${MAKE-make} -f conftest.make 2>/dev/null` in *) eval ac_cv_prog_make_${ac_make}_set=no;; esac -rm -f conftest.make +rm -f conftest.make ;; +esac fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 @@ -3148,8 +3185,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3171,7 +3208,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -3193,8 +3231,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3216,7 +3254,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -3251,8 +3290,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3274,7 +3313,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -3296,8 +3336,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no @@ -3336,7 +3376,8 @@ if test $ac_prog_rejected = yes; then ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -3360,8 +3401,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3383,7 +3424,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -3409,8 +3451,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3432,7 +3474,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -3470,8 +3513,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3493,7 +3536,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -3515,8 +3559,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3538,7 +3582,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -3567,10 +3612,10 @@ fi fi -test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -3642,8 +3687,8 @@ printf "%s\n" "$ac_try_echo"; } >&5 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' + # Autoconf-2.13 could set the ac_cv_exeext variable to 'no'. +# So ignore a value of 'no', otherwise this would lead to 'EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. @@ -3663,7 +3708,7 @@ do ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' + # safe: cross compilers may not add the suffix if given an '-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. @@ -3674,8 +3719,9 @@ do done test "$ac_cv_exeext" = no && ac_cv_exeext= -else $as_nop - ac_file='' +else case e in #( + e) ac_file='' ;; +esac fi if test -z "$ac_file" then : @@ -3684,13 +3730,14 @@ printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } @@ -3714,10 +3761,10 @@ printf "%s\n" "$ac_try_echo"; } >&5 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. + # If both 'conftest.exe' and 'conftest' are 'present' (well, observable) +# catch 'conftest.exe'. For instance with Cygwin, 'ls conftest' will +# work properly (i.e., refer to 'conftest.exe'), while it won't with +# 'rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in @@ -3727,11 +3774,12 @@ for ac_file in conftest.exe conftest conftest.*; do * ) break;; esac done -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 @@ -3747,6 +3795,8 @@ int main (void) { FILE *f = fopen ("conftest.out", "w"); + if (!f) + return 1; return ferror (f) || fclose (f) != 0; ; @@ -3786,26 +3836,27 @@ printf "%s\n" "$ac_try_echo"; } >&5 if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } +If you meant to cross compile, use '--host'. +See 'config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +rm -f conftest.$ac_ext conftest$ac_cv_exeext \ + conftest.o conftest.obj conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3837,16 +3888,18 @@ then : break;; esac done -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext +rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } @@ -3857,8 +3910,8 @@ printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3875,12 +3928,14 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes -else $as_nop - ac_compiler_gnu=no +else case e in #( + e) ac_compiler_gnu=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } @@ -3898,8 +3953,8 @@ printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_save_c_werror_flag=$ac_c_werror_flag +else case e in #( + e) ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" @@ -3917,8 +3972,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes -else $as_nop - CFLAGS="" +else case e in #( + e) CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -3933,8 +3988,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - ac_c_werror_flag=$ac_save_c_werror_flag +else case e in #( + e) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -3951,12 +4006,15 @@ if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag + ac_c_werror_flag=$ac_save_c_werror_flag ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } @@ -3983,8 +4041,8 @@ printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c11=no +else case e in #( + e) ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4001,25 +4059,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c11" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } - CC="$CC $ac_cv_prog_cc_c11" + CC="$CC $ac_cv_prog_cc_c11" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 - ac_prog_cc_stdc=c11 + ac_prog_cc_stdc=c11 ;; +esac fi fi if test x$ac_prog_cc_stdc = xno @@ -4029,8 +4090,8 @@ printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c99=no +else case e in #( + e) ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4047,25 +4108,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c99" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } - CC="$CC $ac_cv_prog_cc_c99" + CC="$CC $ac_cv_prog_cc_c99" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 - ac_prog_cc_stdc=c99 + ac_prog_cc_stdc=c99 ;; +esac fi fi if test x$ac_prog_cc_stdc = xno @@ -4075,8 +4139,8 @@ printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c89=no +else case e in #( + e) ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4093,25 +4157,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c89" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } - CC="$CC $ac_cv_prog_cc_c89" + CC="$CC $ac_cv_prog_cc_c89" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 - ac_prog_cc_stdc=c89 + ac_prog_cc_stdc=c89 ;; +esac fi fi @@ -4162,8 +4229,8 @@ printf %s "checking whether it is safe to define __EXTENSIONS__... " >&6; } if test ${ac_cv_safe_to_define___extensions__+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ # define __EXTENSIONS__ 1 @@ -4179,10 +4246,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_safe_to_define___extensions__=yes -else $as_nop - ac_cv_safe_to_define___extensions__=no +else case e in #( + e) ac_cv_safe_to_define___extensions__=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 printf "%s\n" "$ac_cv_safe_to_define___extensions__" >&6; } @@ -4192,8 +4261,8 @@ printf %s "checking whether _XOPEN_SOURCE should be defined... " >&6; } if test ${ac_cv_should_define__xopen_source+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_should_define__xopen_source=no +else case e in #( + e) ac_cv_should_define__xopen_source=no if test $ac_cv_header_wchar_h = yes then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -4212,8 +4281,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _XOPEN_SOURCE 500 @@ -4231,10 +4300,12 @@ if ac_fn_c_try_compile "$LINENO" then : ac_cv_should_define__xopen_source=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -fi +fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_should_define__xopen_source" >&5 printf "%s\n" "$ac_cv_should_define__xopen_source" >&6; } @@ -4259,6 +4330,8 @@ printf "%s\n" "$ac_cv_should_define__xopen_source" >&6; } printf "%s\n" "#define __STDC_WANT_IEC_60559_DFP_EXT__ 1" >>confdefs.h + printf "%s\n" "#define __STDC_WANT_IEC_60559_EXT__ 1" >>confdefs.h + printf "%s\n" "#define __STDC_WANT_IEC_60559_FUNCS_EXT__ 1" >>confdefs.h printf "%s\n" "#define __STDC_WANT_IEC_60559_TYPES_EXT__ 1" >>confdefs.h @@ -4278,8 +4351,9 @@ then : printf "%s\n" "#define _POSIX_1_SOURCE 2" >>confdefs.h -else $as_nop - MINIX= +else case e in #( + e) MINIX= ;; +esac fi if test $ac_cv_safe_to_define___extensions__ = yes then : @@ -4300,350 +4374,30 @@ if test -n "$want_auto_cflags" ; then STYLE_CFLAGS="${GCC:+-Wno-parentheses} ${GCC:+-Wno-format-security}" fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -printf %s "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test ${ac_cv_prog_CPP+y} + + # Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +printf %s "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test ${ac_cv_path_install+y} then : printf %s "(cached) " >&6 -else $as_nop - # Double quotes because $CC needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : - -else $as_nop - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : - # Broken: success on invalid input. -continue -else $as_nop - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok -then : - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -printf "%s\n" "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : - -else $as_nop - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.i conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO" -then : - # Broken: success on invalid input. -continue -else $as_nop - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.i conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.i conftest.err conftest.$ac_ext -if $ac_preproc_ok -then : - -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -printf %s "checking for grep that handles long lines and -e... " >&6; } -if test ${ac_cv_path_GREP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_prog in grep ggrep - do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_GREP" || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - printf %s 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - printf "%s\n" 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -printf "%s\n" "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -printf %s "checking for egrep... " >&6; } -if test ${ac_cv_path_EGREP+y} -then : - printf %s "(cached) " >&6 -else $as_nop - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_prog in egrep - do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext" - as_fn_executable_p "$ac_path_EGREP" || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - printf %s 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - printf "%s\n" 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -printf "%s\n" "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -if test $ac_cv_c_compiler_gnu = yes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 -printf %s "checking whether $CC needs -traditional... " >&6; } -if test ${ac_cv_prog_gcc_traditional+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_pattern="Autoconf.*'x'" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -Autoconf TIOCGETP -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1 -then : - ac_cv_prog_gcc_traditional=yes -else $as_nop - ac_cv_prog_gcc_traditional=no -fi -rm -rf conftest* - - - if test $ac_cv_prog_gcc_traditional = no; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -Autoconf TCGETA -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1 -then : - ac_cv_prog_gcc_traditional=yes -fi -rm -rf conftest* - - fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 -printf "%s\n" "$ac_cv_prog_gcc_traditional" >&6; } - if test $ac_cv_prog_gcc_traditional = yes; then - CC="$CC -traditional" - fi -fi - - - # Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 -printf %s "checking for a BSD-compatible install... " >&6; } -if test -z "$INSTALL"; then -if test ${ac_cv_path_install+y} -then : - printf %s "(cached) " >&6 -else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( @@ -4696,7 +4450,8 @@ esac IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir - + ;; +esac fi if test ${ac_cv_path_install+y}; then INSTALL=$ac_cv_path_install @@ -4727,8 +4482,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AR+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$AR"; then +else case e in #( + e) if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4750,7 +4505,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi AR=$ac_cv_prog_AR if test -n "$AR"; then @@ -4772,8 +4528,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_AR+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_AR"; then +else case e in #( + e) if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4795,7 +4551,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then @@ -4830,8 +4587,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_RANLIB+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$RANLIB"; then +else case e in #( + e) if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4853,7 +4610,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then @@ -4875,8 +4633,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_RANLIB+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_RANLIB"; then +else case e in #( + e) if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4898,7 +4656,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then @@ -4940,8 +4699,8 @@ printf %s "checking for an ANSI C-conforming const... " >&6; } if test ${ac_cv_c_const+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -5005,10 +4764,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_const=yes -else $as_nop - ac_cv_c_const=no +else case e in #( + e) ac_cv_c_const=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 printf "%s\n" "$ac_cv_c_const" >&6; } @@ -5023,8 +4784,8 @@ printf %s "checking for inline... " >&6; } if test ${ac_cv_c_inline+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_c_inline=no +else case e in #( + e) ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5042,7 +4803,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext test "$ac_cv_c_inline" != no && break done - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 printf "%s\n" "$ac_cv_c_inline" >&6; } @@ -5076,8 +4838,8 @@ printf %s "checking whether char is unsigned... " >&6; } if test ${ac_cv_c_char_unsigned+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int @@ -5094,10 +4856,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_char_unsigned=no -else $as_nop - ac_cv_c_char_unsigned=yes +else case e in #( + e) ac_cv_c_char_unsigned=yes ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_char_unsigned" >&5 printf "%s\n" "$ac_cv_c_char_unsigned" >&6; } @@ -5111,8 +4875,8 @@ printf %s "checking for working volatile... " >&6; } if test ${ac_cv_c_volatile+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -5129,10 +4893,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_volatile=yes -else $as_nop - ac_cv_c_volatile=no +else case e in #( + e) ac_cv_c_volatile=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5 printf "%s\n" "$ac_cv_c_volatile" >&6; } @@ -5147,20 +4913,22 @@ ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define size_t unsigned int" >>confdefs.h - + ;; +esac fi ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" if test "x$ac_cv_type_ssize_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define ssize_t int" >>confdefs.h - + ;; +esac fi @@ -5169,8 +4937,8 @@ printf %s "checking whether stat file-mode macros are broken... " >&6; } if test ${ac_cv_header_stat_broken+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -5195,10 +4963,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_header_stat_broken=no -else $as_nop - ac_cv_header_stat_broken=yes +else case e in #( + e) ac_cv_header_stat_broken=yes ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stat_broken" >&5 printf "%s\n" "$ac_cv_header_stat_broken" >&6; } @@ -5210,14 +4980,14 @@ fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`printf "%s\n" "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` + as_ac_Header=`printf "%s\n" "ac_cv_header_dirent_$ac_hdr" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 printf %s "checking for $ac_hdr that defines DIR... " >&6; } if eval test \${$as_ac_Header+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include <$ac_hdr> @@ -5234,10 +5004,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$as_ac_Header=yes" -else $as_nop - eval "$as_ac_Header=no" +else case e in #( + e) eval "$as_ac_Header=no" ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$as_ac_Header { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -5245,7 +5017,7 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Header"\" = x"yes" then : cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_$ac_hdr" | $as_tr_cpp` 1 +#define `printf "%s\n" "HAVE_$ac_hdr" | sed "$as_sed_cpp"` 1 _ACEOF ac_header_dirent=$ac_hdr; break @@ -5259,15 +5031,21 @@ printf %s "checking for library containing opendir... " >&6; } if test ${ac_cv_search_opendir+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char opendir (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (void); int main (void) { @@ -5298,11 +5076,13 @@ done if test ${ac_cv_search_opendir+y} then : -else $as_nop - ac_cv_search_opendir=no +else case e in #( + e) ac_cv_search_opendir=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 printf "%s\n" "$ac_cv_search_opendir" >&6; } @@ -5319,15 +5099,21 @@ printf %s "checking for library containing opendir... " >&6; } if test ${ac_cv_search_opendir+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char opendir (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (void); int main (void) { @@ -5358,11 +5144,13 @@ done if test ${ac_cv_search_opendir+y} then : -else $as_nop - ac_cv_search_opendir=no +else case e in #( + e) ac_cv_search_opendir=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 printf "%s\n" "$ac_cv_search_opendir" >&6; } @@ -5519,36 +5307,26 @@ then : fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 -printf %s "checking for uid_t in sys/types.h... " >&6; } -if test ${ac_cv_type_uid_t+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "uid_t" >/dev/null 2>&1 +ac_fn_c_check_type "$LINENO" "uid_t" "ac_cv_type_uid_t" "$ac_includes_default" +if test "x$ac_cv_type_uid_t" = xyes then : - ac_cv_type_uid_t=yes -else $as_nop - ac_cv_type_uid_t=no -fi -rm -rf conftest* - -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 -printf "%s\n" "$ac_cv_type_uid_t" >&6; } -if test $ac_cv_type_uid_t = no; then +else case e in #( + e) printf "%s\n" "#define uid_t int" >>confdefs.h + ;; +esac +fi +ac_fn_c_check_type "$LINENO" "gid_t" "ac_cv_type_gid_t" "$ac_includes_default" +if test "x$ac_cv_type_gid_t" = xyes +then : +else case e in #( + e) printf "%s\n" "#define gid_t int" >>confdefs.h - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for working chown" >&5 @@ -5556,8 +5334,8 @@ printf %s "checking for working chown... " >&6; } if test ${ac_cv_func_chown_works+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes +else case e in #( + e) if test "$cross_compiling" = yes then : case "$host_os" in # (( # Guess yes on glibc systems. @@ -5565,8 +5343,8 @@ then : # If we don't know, assume the worst. *) ac_cv_func_chown_works=no ;; esac -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default #include @@ -5594,15 +5372,18 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : ac_cv_func_chown_works=yes -else $as_nop - ac_cv_func_chown_works=no +else case e in #( + e) ac_cv_func_chown_works=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f conftest.chown - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_chown_works" >&5 printf "%s\n" "$ac_cv_func_chown_works" >&6; } @@ -5617,8 +5398,8 @@ printf %s "checking for working strcoll... " >&6; } if test ${ac_cv_func_strcoll_works+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes +else case e in #( + e) if test "$cross_compiling" = yes then : case "$host_os" in # (( # Guess yes on glibc systems. @@ -5626,8 +5407,8 @@ then : # If we don't know, assume the worst. *) ac_cv_func_strcoll_works=no ;; esac -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int @@ -5643,13 +5424,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : ac_cv_func_strcoll_works=yes -else $as_nop - ac_cv_func_strcoll_works=no +else case e in #( + e) ac_cv_func_strcoll_works=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strcoll_works" >&5 printf "%s\n" "$ac_cv_func_strcoll_works" >&6; } @@ -5807,31 +5591,34 @@ if test ${enable_largefile+y} then : enableval=$enable_largefile; fi - -if test "$enable_largefile" != no; then - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 -printf %s "checking for special C compiler options needed for large files... " >&6; } -if test ${ac_cv_sys_largefile_CC+y} +if test "$enable_largefile,$enable_year2038" != no,no +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable large file support" >&5 +printf %s "checking for $CC option to enable large file support... " >&6; } +if test ${ac_cv_sys_largefile_opts+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_sys_largefile_CC=no - if test "$GCC" != yes; then - ac_save_CC=$CC - while :; do - # IRIX 6.2 and later do not support large files by default, - # so use the C compiler's -n32 option if that helps. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) ac_save_CC="$CC" + ac_opt_found=no + for ac_opt in "none needed" "-D_FILE_OFFSET_BITS=64" "-D_LARGE_FILES=1" "-n32"; do + if test x"$ac_opt" != x"none needed" +then : + CC="$ac_save_CC $ac_opt" +fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, +#ifndef FTYPE +# define FTYPE off_t +#endif + /* Check that FTYPE can represent 2**63 - 1 correctly. + We can't simply define LARGE_FTYPE to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) +#define LARGE_FTYPE (((FTYPE) 1 << 31 << 31) - 1 + ((FTYPE) 1 << 31 << 31)) + int FTYPE_is_large[(LARGE_FTYPE % 2147483629 == 721 + && LARGE_FTYPE % 2147483647 == 1) ? 1 : -1]; int main (void) @@ -5841,142 +5628,88 @@ main (void) return 0; } _ACEOF - if ac_fn_c_try_compile "$LINENO" +if ac_fn_c_try_compile "$LINENO" then : - break -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - CC="$CC -n32" + if test x"$ac_opt" = x"none needed" +then : + # GNU/Linux s390x and alpha need _FILE_OFFSET_BITS=64 for wide ino_t. + CC="$CC -DFTYPE=ino_t" if ac_fn_c_try_compile "$LINENO" then : - ac_cv_sys_largefile_CC=' -n32'; break + +else case e in #( + e) CC="$CC -D_FILE_OFFSET_BITS=64" + if ac_fn_c_try_compile "$LINENO" +then : + ac_opt='-D_FILE_OFFSET_BITS=64' +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam - break - done - CC=$ac_save_CC - rm -f conftest.$ac_ext - fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 -printf "%s\n" "$ac_cv_sys_largefile_CC" >&6; } - if test "$ac_cv_sys_largefile_CC" != no; then - CC=$CC$ac_cv_sys_largefile_CC - fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -printf %s "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } -if test ${ac_cv_sys_file_offset_bits+y} -then : - printf %s "(cached) " >&6 -else $as_nop - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_sys_file_offset_bits=no; break + ac_cv_sys_largefile_opts=$ac_opt + ac_opt_found=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#define _FILE_OFFSET_BITS 64 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main (void) -{ + test $ac_opt_found = no || break + done + CC="$ac_save_CC" - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_sys_file_offset_bits=64; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_cv_sys_file_offset_bits=unknown - break -done + test $ac_opt_found = yes || ac_cv_sys_largefile_opts="support not detected" ;; +esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 -printf "%s\n" "$ac_cv_sys_file_offset_bits" >&6; } -case $ac_cv_sys_file_offset_bits in #( - no | unknown) ;; - *) -printf "%s\n" "#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits" >>confdefs.h -;; +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_opts" >&5 +printf "%s\n" "$ac_cv_sys_largefile_opts" >&6; } + +ac_have_largefile=yes +case $ac_cv_sys_largefile_opts in #( + "none needed") : + ;; #( + "supported through gnulib") : + ;; #( + "support not detected") : + ac_have_largefile=no ;; #( + "-D_FILE_OFFSET_BITS=64") : + +printf "%s\n" "#define _FILE_OFFSET_BITS 64" >>confdefs.h + ;; #( + "-D_LARGE_FILES=1") : + +printf "%s\n" "#define _LARGE_FILES 1" >>confdefs.h + ;; #( + "-n32") : + CC="$CC -n32" ;; #( + *) : + as_fn_error $? "internal error: bad value for \$ac_cv_sys_largefile_opts" "$LINENO" 5 ;; esac -rm -rf conftest* - if test $ac_cv_sys_file_offset_bits = unknown; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 -printf %s "checking for _LARGE_FILES value needed for large files... " >&6; } -if test ${ac_cv_sys_large_files+y} + +if test "$enable_year2038" != no +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option for timestamps after 2038" >&5 +printf %s "checking for $CC option for timestamps after 2038... " >&6; } +if test ${ac_cv_sys_year2038_opts+y} then : printf %s "(cached) " >&6 -else $as_nop - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" +else case e in #( + e) ac_save_CPPFLAGS="$CPPFLAGS" + ac_opt_found=no + for ac_opt in "none needed" "-D_TIME_BITS=64" "-D__MINGW_USE_VC2005_COMPAT" "-U_USE_32_BIT_TIME_T -D__MINGW_USE_VC2005_COMPAT"; do + if test x"$ac_opt" != x"none needed" then : - ac_cv_sys_large_files=no; break + CPPFLAGS="$ac_save_CPPFLAGS $ac_opt" fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define _LARGE_FILES 1 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; + + #include + /* Check that time_t can represent 2**32 - 1 correctly. */ + #define LARGE_TIME_T \\ + ((time_t) (((time_t) 1 << 30) - 1 + 3 * ((time_t) 1 << 30))) + int verify_time_t_range[(LARGE_TIME_T / 65537 == 65535 + && LARGE_TIME_T % 65537 == 0) + ? 1 : -1]; + int main (void) { @@ -5987,38 +5720,60 @@ main (void) _ACEOF if ac_fn_c_try_compile "$LINENO" then : - ac_cv_sys_large_files=1; break + ac_cv_sys_year2038_opts="$ac_opt" + ac_opt_found=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_cv_sys_large_files=unknown - break -done + test $ac_opt_found = no || break + done + CPPFLAGS="$ac_save_CPPFLAGS" + test $ac_opt_found = yes || ac_cv_sys_year2038_opts="support not detected" ;; +esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 -printf "%s\n" "$ac_cv_sys_large_files" >&6; } -case $ac_cv_sys_large_files in #( - no | unknown) ;; - *) -printf "%s\n" "#define _LARGE_FILES $ac_cv_sys_large_files" >>confdefs.h -;; +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_year2038_opts" >&5 +printf "%s\n" "$ac_cv_sys_year2038_opts" >&6; } + +ac_have_year2038=yes +case $ac_cv_sys_year2038_opts in #( + "none needed") : + ;; #( + "support not detected") : + ac_have_year2038=no ;; #( + "-D_TIME_BITS=64") : + +printf "%s\n" "#define _TIME_BITS 64" >>confdefs.h + ;; #( + "-D__MINGW_USE_VC2005_COMPAT") : + +printf "%s\n" "#define __MINGW_USE_VC2005_COMPAT 1" >>confdefs.h + ;; #( + "-U_USE_32_BIT_TIME_T"*) : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "the 'time_t' type is currently forced to be 32-bit. It +will stop working after mid-January 2038. Remove +_USE_32BIT_TIME_T from the compiler flags. +See 'config.log' for more details" "$LINENO" 5; } ;; #( + *) : + as_fn_error $? "internal error: bad value for \$ac_cv_sys_year2038_opts" "$LINENO" 5 ;; esac -rm -rf conftest* - fi + fi +fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for type of signal functions" >&5 printf %s "checking for type of signal functions... " >&6; } if test ${bash_cv_signal_vintage+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) if test ${bash_cv_posix_signals+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -6040,12 +5795,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : bash_cv_posix_signals=yes -else $as_nop - bash_cv_posix_signals=no - +else case e in #( + e) bash_cv_posix_signals=no + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + conftest$ac_exeext conftest.$ac_ext ;; +esac fi @@ -6055,8 +5812,8 @@ else if test ${bash_cv_bsd_signals+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -6075,12 +5832,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : bash_cv_bsd_signals=yes -else $as_nop - bash_cv_bsd_signals=no - +else case e in #( + e) bash_cv_bsd_signals=no + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + conftest$ac_exeext conftest.$ac_ext ;; +esac fi @@ -6090,8 +5849,8 @@ fi if test ${bash_cv_sysv_signals+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -6112,12 +5871,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : bash_cv_sysv_signals=yes -else $as_nop - bash_cv_sysv_signals=no - +else case e in #( + e) bash_cv_sysv_signals=no + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + conftest$ac_exeext conftest.$ac_ext ;; +esac fi @@ -6128,7 +5889,8 @@ fi fi fi fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_signal_vintage" >&5 @@ -6150,15 +5912,15 @@ printf %s "checking if signal handlers must be reinstalled when invoked... " >&6 if test ${bash_cv_must_reinstall_sighandlers+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes +else case e in #( + e) if test "$cross_compiling" = yes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot check signal handling if cross compiling -- defaulting to no" >&5 printf "%s\n" "$as_me: WARNING: cannot check signal handling if cross compiling -- defaulting to no" >&2;} bash_cv_must_reinstall_sighandlers=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -6207,13 +5969,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : bash_cv_must_reinstall_sighandlers=no -else $as_nop - bash_cv_must_reinstall_sighandlers=yes +else case e in #( + e) bash_cv_must_reinstall_sighandlers=yes ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_must_reinstall_sighandlers" >&5 @@ -6230,8 +5995,8 @@ printf %s "checking for presence of POSIX-style sigsetjmp/siglongjmp... " >&6; } if test ${bash_cv_func_sigsetjmp+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes +else case e in #( + e) if test "$cross_compiling" = yes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot check for sigsetjmp/siglongjmp if cross-compiling -- defaulting to $bash_cv_posix_signals" >&5 printf "%s\n" "$as_me: WARNING: cannot check for sigsetjmp/siglongjmp if cross-compiling -- defaulting to $bash_cv_posix_signals" >&2;} @@ -6241,8 +6006,8 @@ printf "%s\n" "$as_me: WARNING: cannot check for sigsetjmp/siglongjmp if cross-c bash_cv_func_sigsetjmp=missing fi -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_UNISTD_H @@ -6298,13 +6063,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : bash_cv_func_sigsetjmp=present -else $as_nop - bash_cv_func_sigsetjmp=missing +else case e in #( + e) bash_cv_func_sigsetjmp=missing ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_func_sigsetjmp" >&5 @@ -6319,8 +6087,8 @@ printf %s "checking for lstat... " >&6; } if test ${bash_cv_func_lstat+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -6337,11 +6105,13 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : bash_cv_func_lstat=yes -else $as_nop - bash_cv_func_lstat=no +else case e in #( + e) bash_cv_func_lstat=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + conftest$ac_exeext conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_func_lstat" >&5 printf "%s\n" "$bash_cv_func_lstat" >&6; } @@ -6355,15 +6125,15 @@ printf %s "checking whether or not strcoll and strcmp differ... " >&6; } if test ${bash_cv_func_strcoll_broken+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes +else case e in #( + e) if test "$cross_compiling" = yes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cannot check strcoll if cross compiling -- defaulting to no" >&5 printf "%s\n" "$as_me: WARNING: cannot check strcoll if cross compiling -- defaulting to no" >&2;} bash_cv_func_strcoll_broken=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -6406,30 +6176,306 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : bash_cv_func_strcoll_broken=yes -else $as_nop - bash_cv_func_strcoll_broken=no +else case e in #( + e) bash_cv_func_strcoll_broken=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + ;; +esac +fi + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_func_strcoll_broken" >&5 +printf "%s\n" "$bash_cv_func_strcoll_broken" >&6; } +if test $bash_cv_func_strcoll_broken = yes; then +printf "%s\n" "#define STRCOLL_BROKEN 1" >>confdefs.h + +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +printf %s "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= fi +if test -z "$CPP"; then + if test ${ac_cv_prog_CPP+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) # Double quotes because $CC needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + +else case e in #( + e) # Broken: fails on valid input. +continue ;; +esac +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else case e in #( + e) # Passes both tests. +ac_preproc_ok=: +break ;; +esac +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : + break +fi + + done + ac_cv_prog_CPP=$CPP + ;; +esac +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +printf "%s\n" "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + +else case e in #( + e) # Broken: fails on valid input. +continue ;; +esac +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO" +then : + # Broken: success on invalid input. +continue +else case e in #( + e) # Passes both tests. +ac_preproc_ok=: +break ;; +esac +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok +then : + +else case e in #( + e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See 'config.log' for more details" "$LINENO" 5; } ;; +esac +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep -e" >&5 +printf %s "checking for egrep -e... " >&6; } +if test ${ac_cv_path_EGREP_TRADITIONAL+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -z "$EGREP_TRADITIONAL"; then + ac_path_EGREP_TRADITIONAL_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in grep ggrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue +# Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. + # Check for GNU $ac_path_EGREP_TRADITIONAL +case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #( +*GNU*) + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; +#( +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" + "$ac_path_EGREP_TRADITIONAL" -E 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" + ac_path_EGREP_TRADITIONAL_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_TRADITIONAL_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then + : + fi +else + ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL +fi + + if test "$ac_cv_path_EGREP_TRADITIONAL" +then : + ac_cv_path_EGREP_TRADITIONAL="$ac_cv_path_EGREP_TRADITIONAL -E" +else case e in #( + e) if test -z "$EGREP_TRADITIONAL"; then + ac_path_EGREP_TRADITIONAL_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in egrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue +# Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. + # Check for GNU $ac_path_EGREP_TRADITIONAL +case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #( +*GNU*) + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; +#( +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" + "$ac_path_EGREP_TRADITIONAL" 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" + ac_path_EGREP_TRADITIONAL_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + $ac_path_EGREP_TRADITIONAL_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL fi - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_func_strcoll_broken" >&5 -printf "%s\n" "$bash_cv_func_strcoll_broken" >&6; } -if test $bash_cv_func_strcoll_broken = yes; then -printf "%s\n" "#define STRCOLL_BROKEN 1" >>confdefs.h - + ;; +esac +fi ;; +esac fi - +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP_TRADITIONAL" >&5 +printf "%s\n" "$ac_cv_path_EGREP_TRADITIONAL" >&6; } + EGREP_TRADITIONAL=$ac_cv_path_EGREP_TRADITIONAL { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether getpw functions are declared in pwd.h" >&5 printf %s "checking whether getpw functions are declared in pwd.h... " >&6; } if test ${bash_cv_getpw_declared+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -6440,14 +6486,16 @@ else $as_nop _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "getpwuid" >/dev/null 2>&1 + $EGREP_TRADITIONAL "getpwuid" >/dev/null 2>&1 then : bash_cv_getpw_declared=yes -else $as_nop - bash_cv_getpw_declared=no +else case e in #( + e) bash_cv_getpw_declared=no ;; +esac fi rm -rf conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_getpw_declared" >&5 @@ -6463,25 +6511,23 @@ printf %s "checking whether termios.h defines TIOCGWINSZ... " >&6; } if test ${ac_cv_sys_tiocgwinsz_in_termios_h+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +$ac_includes_default #include -#ifdef TIOCGWINSZ - yes -#endif +const int tiocgwinsz = TIOCGWINSZ; _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1 +if ac_fn_c_try_compile "$LINENO" then : ac_cv_sys_tiocgwinsz_in_termios_h=yes -else $as_nop - ac_cv_sys_tiocgwinsz_in_termios_h=no +else case e in #( + e) ac_cv_sys_tiocgwinsz_in_termios_h=no ;; +esac fi -rm -rf conftest* - +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_tiocgwinsz_in_termios_h" >&5 printf "%s\n" "$ac_cv_sys_tiocgwinsz_in_termios_h" >&6; } @@ -6492,25 +6538,23 @@ printf %s "checking whether sys/ioctl.h defines TIOCGWINSZ... " >&6; } if test ${ac_cv_sys_tiocgwinsz_in_sys_ioctl_h+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#include +$ac_includes_default #include -#ifdef TIOCGWINSZ - yes -#endif +const int tiocgwinsz = TIOCGWINSZ; _ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1 +if ac_fn_c_try_compile "$LINENO" then : ac_cv_sys_tiocgwinsz_in_sys_ioctl_h=yes -else $as_nop - ac_cv_sys_tiocgwinsz_in_sys_ioctl_h=no +else case e in #( + e) ac_cv_sys_tiocgwinsz_in_sys_ioctl_h=no ;; +esac fi -rm -rf conftest* - +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_tiocgwinsz_in_sys_ioctl_h" >&5 printf "%s\n" "$ac_cv_sys_tiocgwinsz_in_sys_ioctl_h" >&6; } @@ -6537,8 +6581,8 @@ printf %s "checking for sig_atomic_t in signal.h... " >&6; } if test ${ac_cv_have_sig_atomic_t+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -6552,11 +6596,13 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_have_sig_atomic_t=yes -else $as_nop - ac_cv_have_sig_atomic_t=no +else case e in #( + e) ac_cv_have_sig_atomic_t=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + conftest$ac_exeext conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_sig_atomic_t" >&5 printf "%s\n" "$ac_cv_have_sig_atomic_t" >&6; } @@ -6569,8 +6615,8 @@ printf %s "checking for sig_atomic_t... " >&6; } if test ${bash_cv_type_sig_atomic_t+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #if HAVE_STDLIB_H @@ -6589,14 +6635,16 @@ else $as_nop _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "sig_atomic_t" >/dev/null 2>&1 + $EGREP_TRADITIONAL "sig_atomic_t" >/dev/null 2>&1 then : bash_cv_type_sig_atomic_t=yes -else $as_nop - bash_cv_type_sig_atomic_t=no +else case e in #( + e) bash_cv_type_sig_atomic_t=no ;; +esac fi rm -rf conftest* - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_type_sig_atomic_t" >&5 @@ -6615,8 +6663,8 @@ printf %s "checking for TIOCSTAT in sys/ioctl.h... " >&6; } if test ${bash_cv_tiocstat_in_ioctl+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -6632,11 +6680,13 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : bash_cv_tiocstat_in_ioctl=yes -else $as_nop - bash_cv_tiocstat_in_ioctl=no - +else case e in #( + e) bash_cv_tiocstat_in_ioctl=no + ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_tiocstat_in_ioctl" >&5 @@ -6651,8 +6701,8 @@ printf %s "checking for FIONREAD in sys/ioctl.h... " >&6; } if test ${bash_cv_fionread_in_ioctl+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -6668,11 +6718,13 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : bash_cv_fionread_in_ioctl=yes -else $as_nop - bash_cv_fionread_in_ioctl=no - +else case e in #( + e) bash_cv_fionread_in_ioctl=no + ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_fionread_in_ioctl" >&5 @@ -6687,8 +6739,8 @@ printf %s "checking for speed_t in sys/types.h... " >&6; } if test ${bash_cv_speed_t_in_sys_types+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -6702,10 +6754,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : bash_cv_speed_t_in_sys_types=yes -else $as_nop - bash_cv_speed_t_in_sys_types=no +else case e in #( + e) bash_cv_speed_t_in_sys_types=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_speed_t_in_sys_types" >&5 @@ -6720,13 +6774,13 @@ printf %s "checking for struct winsize in sys/ioctl.h and termios.h... " >&6; } if test ${bash_cv_struct_winsize_header+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) if test ${bash_cv_struct_winsize_ioctl+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -6746,19 +6800,21 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : bash_cv_struct_winsize_ioctl=yes -else $as_nop - bash_cv_struct_winsize_ioctl=no +else case e in #( + e) bash_cv_struct_winsize_ioctl=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - + ;; +esac fi if test ${bash_cv_struct_winsize_termios+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -6778,11 +6834,13 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : bash_cv_struct_winsize_termios=yes -else $as_nop - bash_cv_struct_winsize_termios=no +else case e in #( + e) bash_cv_struct_winsize_termios=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - + ;; +esac fi @@ -6794,7 +6852,8 @@ elif test $bash_cv_struct_winsize_termios = yes; then else bash_cv_struct_winsize_header=other fi - + ;; +esac fi if test $bash_cv_struct_winsize_header = ioctl_h; then @@ -6818,8 +6877,8 @@ printf %s "checking for struct dirent.d_ino... " >&6; } if test ${bash_cv_dirent_has_d_ino+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ac_fn_c_check_member "$LINENO" "struct dirent" "d_ino" "ac_cv_member_struct_dirent_d_ino" " #include @@ -6849,11 +6908,13 @@ then : printf "%s\n" "#define HAVE_STRUCT_DIRENT_D_INO 1" >>confdefs.h bash_cv_dirent_has_d_ino=yes -else $as_nop - bash_cv_dirent_has_d_ino=no +else case e in #( + e) bash_cv_dirent_has_d_ino=no ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_dirent_has_d_ino" >&5 @@ -6869,8 +6930,8 @@ printf %s "checking for struct dirent.d_fileno... " >&6; } if test ${bash_cv_dirent_has_d_fileno+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) ac_fn_c_check_member "$LINENO" "struct dirent" "d_fileno" "ac_cv_member_struct_dirent_d_fileno" " #include @@ -6900,11 +6961,13 @@ then : printf "%s\n" "#define HAVE_STRUCT_DIRENT_D_FILENO 1" >>confdefs.h bash_cv_dirent_has_d_fileno=yes -else $as_nop - bash_cv_dirent_has_d_fileno=no +else case e in #( + e) bash_cv_dirent_has_d_fileno=no ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_dirent_has_d_fileno" >&5 @@ -6919,8 +6982,8 @@ printf %s "checking for struct timeval in sys/time.h and time.h... " >&6; } if test ${bash_cv_struct_timeval+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if HAVE_SYS_TIME_H #include @@ -6939,11 +7002,13 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : bash_cv_struct_timeval=yes -else $as_nop - bash_cv_struct_timeval=no +else case e in #( + e) bash_cv_struct_timeval=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_struct_timeval" >&5 @@ -6966,8 +7031,8 @@ printf %s "checking for $CC options needed to detect all undeclared functions... if test ${ac_cv_c_undeclared_builtin_options+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_save_CFLAGS=$CFLAGS +else case e in #( + e) ac_save_CFLAGS=$CFLAGS ac_cv_c_undeclared_builtin_options='cannot detect' for ac_arg in '' -fno-builtin; do CFLAGS="$ac_save_CFLAGS $ac_arg" @@ -6986,8 +7051,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - # This test program should compile successfully. +else case e in #( + e) # This test program should compile successfully. # No library function is consistently available on # freestanding implementations, so test against a dummy # declaration. Include always-available headers on the @@ -7015,26 +7080,29 @@ then : if test x"$ac_arg" = x then : ac_cv_c_undeclared_builtin_options='none needed' -else $as_nop - ac_cv_c_undeclared_builtin_options=$ac_arg +else case e in #( + e) ac_cv_c_undeclared_builtin_options=$ac_arg ;; +esac fi break fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done CFLAGS=$ac_save_CFLAGS - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_undeclared_builtin_options" >&5 printf "%s\n" "$ac_cv_c_undeclared_builtin_options" >&6; } case $ac_cv_c_undeclared_builtin_options in #( 'cannot detect') : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot make $CC report undeclared builtins -See \`config.log' for more details" "$LINENO" 5; } ;; #( +See 'config.log' for more details" "$LINENO" 5; } ;; #( 'none needed') : ac_c_undeclared_builtin_options='' ;; #( *) : @@ -7046,8 +7114,9 @@ ac_fn_check_decl "$LINENO" "AUDIT_USER_TTY" "ac_cv_have_decl_AUDIT_USER_TTY" "#i if test "x$ac_cv_have_decl_AUDIT_USER_TTY" = xyes then : ac_have_decl=1 -else $as_nop - ac_have_decl=0 +else case e in #( + e) ac_have_decl=0 ;; +esac fi printf "%s\n" "#define HAVE_DECL_AUDIT_USER_TTY $ac_have_decl" >>confdefs.h @@ -7066,27 +7135,33 @@ fi if test ${bash_cv_termcap_lib+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_fn_c_check_func "$LINENO" "tgetent" "ac_cv_func_tgetent" +else case e in #( + e) ac_fn_c_check_func "$LINENO" "tgetent" "ac_cv_func_tgetent" if test "x$ac_cv_func_tgetent" = xyes then : bash_cv_termcap_lib=libc -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tgetent in -ltermcap" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tgetent in -ltermcap" >&5 printf %s "checking for tgetent in -ltermcap... " >&6; } if test ${ac_cv_lib_termcap_tgetent+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ltermcap $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char tgetent (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char tgetent (void); int main (void) { @@ -7098,34 +7173,42 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_termcap_tgetent=yes -else $as_nop - ac_cv_lib_termcap_tgetent=no +else case e in #( + e) ac_cv_lib_termcap_tgetent=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_termcap_tgetent" >&5 printf "%s\n" "$ac_cv_lib_termcap_tgetent" >&6; } if test "x$ac_cv_lib_termcap_tgetent" = xyes then : bash_cv_termcap_lib=libtermcap -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tgetent in -ltinfo" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tgetent in -ltinfo" >&5 printf %s "checking for tgetent in -ltinfo... " >&6; } if test ${ac_cv_lib_tinfo_tgetent+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ltinfo $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char tgetent (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char tgetent (void); int main (void) { @@ -7137,34 +7220,42 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_tinfo_tgetent=yes -else $as_nop - ac_cv_lib_tinfo_tgetent=no +else case e in #( + e) ac_cv_lib_tinfo_tgetent=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tinfo_tgetent" >&5 printf "%s\n" "$ac_cv_lib_tinfo_tgetent" >&6; } if test "x$ac_cv_lib_tinfo_tgetent" = xyes then : bash_cv_termcap_lib=libtinfo -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tgetent in -lcurses" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tgetent in -lcurses" >&5 printf %s "checking for tgetent in -lcurses... " >&6; } if test ${ac_cv_lib_curses_tgetent+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lcurses $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char tgetent (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char tgetent (void); int main (void) { @@ -7176,34 +7267,42 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_curses_tgetent=yes -else $as_nop - ac_cv_lib_curses_tgetent=no +else case e in #( + e) ac_cv_lib_curses_tgetent=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curses_tgetent" >&5 printf "%s\n" "$ac_cv_lib_curses_tgetent" >&6; } if test "x$ac_cv_lib_curses_tgetent" = xyes then : bash_cv_termcap_lib=libcurses -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tgetent in -lncurses" >&5 -printf %s "checking for tgetent in -lncurses... " >&6; } -if test ${ac_cv_lib_ncurses_tgetent+y} +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tgetent in -lncursesw" >&5 +printf %s "checking for tgetent in -lncursesw... " >&6; } +if test ${ac_cv_lib_ncursesw_tgetent+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lncurses $LIBS" +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lncursesw $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char tgetent (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char tgetent (void); int main (void) { @@ -7214,35 +7313,43 @@ return tgetent (); _ACEOF if ac_fn_c_try_link "$LINENO" then : - ac_cv_lib_ncurses_tgetent=yes -else $as_nop - ac_cv_lib_ncurses_tgetent=no + ac_cv_lib_ncursesw_tgetent=yes +else case e in #( + e) ac_cv_lib_ncursesw_tgetent=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_tgetent" >&5 -printf "%s\n" "$ac_cv_lib_ncurses_tgetent" >&6; } -if test "x$ac_cv_lib_ncurses_tgetent" = xyes +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncursesw_tgetent" >&5 +printf "%s\n" "$ac_cv_lib_ncursesw_tgetent" >&6; } +if test "x$ac_cv_lib_ncursesw_tgetent" = xyes then : - bash_cv_termcap_lib=libncurses -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tgetent in -lncursesw" >&5 -printf %s "checking for tgetent in -lncursesw... " >&6; } -if test ${ac_cv_lib_ncursesw_tgetent+y} + bash_cv_termcap_lib=libncursesw +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tgetent in -lncurses" >&5 +printf %s "checking for tgetent in -lncurses... " >&6; } +if test ${ac_cv_lib_ncurses_tgetent+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS -LIBS="-lncursesw $LIBS" +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS +LIBS="-lncurses $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char tgetent (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char tgetent (void); int main (void) { @@ -7253,33 +7360,42 @@ return tgetent (); _ACEOF if ac_fn_c_try_link "$LINENO" then : - ac_cv_lib_ncursesw_tgetent=yes -else $as_nop - ac_cv_lib_ncursesw_tgetent=no + ac_cv_lib_ncurses_tgetent=yes +else case e in #( + e) ac_cv_lib_ncurses_tgetent=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncursesw_tgetent" >&5 -printf "%s\n" "$ac_cv_lib_ncursesw_tgetent" >&6; } -if test "x$ac_cv_lib_ncursesw_tgetent" = xyes +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_tgetent" >&5 +printf "%s\n" "$ac_cv_lib_ncurses_tgetent" >&6; } +if test "x$ac_cv_lib_ncurses_tgetent" = xyes then : - bash_cv_termcap_lib=libncursesw -else $as_nop - bash_cv_termcap_lib=gnutermcap + bash_cv_termcap_lib=libncurses +else case e in #( + e) bash_cv_termcap_lib=gnutermcap ;; +esac fi - + ;; +esac fi - + ;; +esac fi - + ;; +esac fi - + ;; +esac fi - + ;; +esac fi - + ;; +esac fi if test "X$_bash_needmsg" = "Xyes"; then @@ -7298,6 +7414,9 @@ TERMCAP_DEP= elif test $bash_cv_termcap_lib = libtinfo; then TERMCAP_LIB=-ltinfo TERMCAP_DEP= +elif test $bash_cv_termcap_lib = libncursesw; then +TERMCAP_LIB=-lncursesw +TERMCAP_DEP= elif test $bash_cv_termcap_lib = libncurses; then TERMCAP_LIB=-lncurses TERMCAP_DEP= @@ -7338,6 +7457,7 @@ esac case "$TERMCAP_LIB" in -ltinfo) TERMCAP_PKG_CONFIG_LIB=tinfo ;; -lcurses) TERMCAP_PKG_CONFIG_LIB=ncurses ;; +-lncursesw) TERMCAP_PKG_CONFIG_LIB=ncursesw ;; -lncurses) TERMCAP_PKG_CONFIG_LIB=ncurses ;; -ltermcap) TERMCAP_PKG_CONFIG_LIB=termcap ;; *) TERMCAP_PKG_CONFIG_LIB=termcap ;; @@ -7349,8 +7469,8 @@ printf %s "checking for nl_langinfo and CODESET... " >&6; } if test ${am_cv_langinfo_codeset+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -7364,12 +7484,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : am_cv_langinfo_codeset=yes -else $as_nop - am_cv_langinfo_codeset=no +else case e in #( + e) am_cv_langinfo_codeset=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $am_cv_langinfo_codeset" >&5 printf "%s\n" "$am_cv_langinfo_codeset" >&6; } @@ -7458,13 +7580,14 @@ if test "x$ac_cv_func_mbschr" = xyes then : printf "%s\n" "#define HAVE_MBSCHR 1" >>confdefs.h -else $as_nop - case " $LIBOBJS " in +else case e in #( + e) case " $LIBOBJS " in *" mbschr.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS mbschr.$ac_objext" ;; esac - + ;; +esac fi @@ -7516,13 +7639,14 @@ if test "x$ac_cv_func_wcswidth" = xyes then : printf "%s\n" "#define HAVE_WCSWIDTH 1" >>confdefs.h -else $as_nop - case " $LIBOBJS " in +else case e in #( + e) case " $LIBOBJS " in *" wcswidth.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS wcswidth.$ac_objext" ;; esac - + ;; +esac fi @@ -7532,8 +7656,8 @@ printf %s "checking whether mbrtowc and mbstate_t are properly declared... " >&6 if test ${ac_cv_func_mbrtowc+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int @@ -7551,11 +7675,13 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_func_mbrtowc=yes -else $as_nop - ac_cv_func_mbrtowc=no +else case e in #( + e) ac_cv_func_mbrtowc=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + conftest$ac_exeext conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mbrtowc" >&5 printf "%s\n" "$ac_cv_func_mbrtowc" >&6; } @@ -7609,8 +7735,8 @@ printf %s "checking for wchar_t in wchar.h... " >&6; } if test ${bash_cv_type_wchar_t+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -7628,11 +7754,13 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : bash_cv_type_wchar_t=yes -else $as_nop - bash_cv_type_wchar_t=no - +else case e in #( + e) bash_cv_type_wchar_t=no + ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_type_wchar_t" >&5 printf "%s\n" "$bash_cv_type_wchar_t" >&6; } @@ -7647,8 +7775,8 @@ printf %s "checking for wctype_t in wctype.h... " >&6; } if test ${bash_cv_type_wctype_t+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -7666,11 +7794,13 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : bash_cv_type_wctype_t=yes -else $as_nop - bash_cv_type_wctype_t=no - +else case e in #( + e) bash_cv_type_wctype_t=no + ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_type_wctype_t" >&5 printf "%s\n" "$bash_cv_type_wctype_t" >&6; } @@ -7685,8 +7815,8 @@ printf %s "checking for wint_t in wctype.h... " >&6; } if test ${bash_cv_type_wint_t+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -7704,11 +7834,13 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : bash_cv_type_wint_t=yes -else $as_nop - bash_cv_type_wint_t=no - +else case e in #( + e) bash_cv_type_wint_t=no + ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_type_wint_t" >&5 printf "%s\n" "$bash_cv_type_wint_t" >&6; } @@ -7723,13 +7855,13 @@ printf %s "checking for wcwidth broken with unicode combining characters... " >& if test ${bash_cv_wcwidth_broken+y} then : printf %s "(cached) " >&6 -else $as_nop - if test "$cross_compiling" = yes +else case e in #( + e) if test "$cross_compiling" = yes then : bash_cv_wcwidth_broken=no -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -7756,13 +7888,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : bash_cv_wcwidth_broken=yes -else $as_nop - bash_cv_wcwidth_broken=no +else case e in #( + e) bash_cv_wcwidth_broken=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $bash_cv_wcwidth_broken" >&5 printf "%s\n" "$bash_cv_wcwidth_broken" >&6; } @@ -7787,28 +7922,30 @@ fi # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of wchar_t" >&5 printf %s "checking size of wchar_t... " >&6; } if test ${ac_cv_sizeof_wchar_t+y} then : printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (wchar_t))" "ac_cv_sizeof_wchar_t" "$ac_includes_default" +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (wchar_t))" "ac_cv_sizeof_wchar_t" "$ac_includes_default" then : -else $as_nop - if test "$ac_cv_type_wchar_t" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) if test "$ac_cv_type_wchar_t" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (wchar_t) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_wchar_t=0 - fi + fi ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_wchar_t" >&5 printf "%s\n" "$ac_cv_sizeof_wchar_t" >&6; } @@ -7933,6 +8070,7 @@ CFLAGS="$CFLAGS $STYLE_CFLAGS" + ac_config_files="$ac_config_files Makefile doc/Makefile examples/Makefile shlib/Makefile readline.pc history.pc" @@ -7949,8 +8087,8 @@ cat >confcache <<\_ACEOF # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the +# 'ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* 'ac_cv_foo' will be assigned the # following values. _ACEOF @@ -7980,14 +8118,14 @@ printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote + # 'set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) - # `set' quotes correctly as required by POSIX, so do not add quotes. + # 'set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | @@ -8048,6 +8186,12 @@ LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs +# Check whether --enable-year2038 was given. +if test ${enable_year2038+y} +then : + enableval=$enable_year2038; +fi + : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 @@ -8077,7 +8221,6 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh @@ -8086,12 +8229,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else $as_nop - case `(set -o) 2>/dev/null` in #( +else case e in #( + e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi @@ -8163,7 +8307,7 @@ IFS=$as_save_IFS ;; esac -# We did not find ourselves, most probably we were run as `sh COMMAND' +# We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 @@ -8192,7 +8336,6 @@ as_fn_error () } # as_fn_error - # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -8232,11 +8375,12 @@ then : { eval $1+=\$2 }' -else $as_nop - as_fn_append () +else case e in #( + e) as_fn_append () { eval $1=\$$1\$2 - } + } ;; +esac fi # as_fn_append # as_fn_arith ARG... @@ -8250,11 +8394,12 @@ then : { as_val=$(( $* )) }' -else $as_nop - as_fn_arith () +else case e in #( + e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` - } + } ;; +esac fi # as_fn_arith @@ -8337,9 +8482,9 @@ if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then @@ -8420,10 +8565,12 @@ as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated exec 6>&1 @@ -8439,7 +8586,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # values after options handling. ac_log=" This file was extended by readline $as_me 8.3, which was -generated by GNU Autoconf 2.71. Invocation command line was +generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -8471,7 +8618,7 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions +'$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. @@ -8507,10 +8654,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ readline config.status 8.3 -configured by $0, generated by GNU Autoconf 2.71, +configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" -Copyright (C) 2021 Free Software Foundation, Inc. +Copyright (C) 2023 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -8570,8 +8717,8 @@ do ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; + as_fn_error $? "ambiguous option: '$1' +Try '$0 --help' for more information.";; --help | --hel | -h ) printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ @@ -8579,8 +8726,8 @@ Try \`$0 --help' for more information.";; ac_cs_silent=: ;; # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; + -*) as_fn_error $? "unrecognized option: '$1' +Try '$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; @@ -8637,7 +8784,7 @@ do "history.pc") CONFIG_FILES="$CONFIG_FILES history.pc" ;; "stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS stamp-h" ;; - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: '$ac_config_target'" "$LINENO" 5;; esac done @@ -8657,7 +8804,7 @@ fi # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. +# after its creation but before its name has been assigned to '$tmp'. $debug || { tmp= ac_tmp= @@ -8681,7 +8828,7 @@ ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. +# This happens for instance with './config.status config.h'. if test -n "$CONFIG_FILES"; then @@ -8839,13 +8986,13 @@ fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. +# This happens for instance with './config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF -# Transform confdefs.h into an awk script `defines.awk', embedded as +# Transform confdefs.h into an awk script 'defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. @@ -8955,7 +9102,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag '$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -8977,19 +9124,19 @@ do -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. + # because $ac_f cannot contain ':'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done - # Let's still pretend it is `configure' which instantiates (i.e., don't + # Let's still pretend it is 'configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` @@ -9117,7 +9264,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 esac _ACEOF -# Neutralize VPATH when `$srcdir' = `.'. +# Neutralize VPATH when '$srcdir' = '.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 @@ -9147,9 +9294,9 @@ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" diff --git a/configure.ac b/configure.ac index 4604750..1783dae 100644 --- a/configure.ac +++ b/configure.ac @@ -20,7 +20,7 @@ dnl Process this file with autoconf to produce a configure script. # You should have received a copy of the GNU General Public License # along with this program. If not, see . -AC_REVISION([for Readline 8.3, version 2.98]) +AC_REVISION([for Readline 8.3, version 2.101]) AC_INIT(readline, 8.3, bug-readline@gnu.org) @@ -122,7 +122,8 @@ if test -n "$want_auto_cflags" ; then STYLE_CFLAGS="${GCC:+-Wno-parentheses} ${GCC:+-Wno-format-security}" fi -AC_PROG_GCC_TRADITIONAL +dnl this macro is obsolete +dnl AC_PROG_GCC_TRADITIONAL AC_PROG_INSTALL AC_CHECK_TOOL(AR, ar) dnl Set default for ARFLAGS, since autoconf does not have a macro for it. @@ -221,6 +222,7 @@ esac case "$TERMCAP_LIB" in -ltinfo) TERMCAP_PKG_CONFIG_LIB=tinfo ;; -lcurses) TERMCAP_PKG_CONFIG_LIB=ncurses ;; +-lncursesw) TERMCAP_PKG_CONFIG_LIB=ncursesw ;; -lncurses) TERMCAP_PKG_CONFIG_LIB=ncurses ;; -ltermcap) TERMCAP_PKG_CONFIG_LIB=termcap ;; *) TERMCAP_PKG_CONFIG_LIB=termcap ;; @@ -326,6 +328,7 @@ AC_SUBST(CFLAGS) AC_SUBST(LOCAL_CFLAGS) AC_SUBST(LOCAL_LDFLAGS) AC_SUBST(LOCAL_DEFS) +AC_SUBST(STYLE_CFLAGS) AC_SUBST(AR) AC_SUBST(ARFLAGS) diff --git a/display.c b/display.c index 1c486f1..f002369 100644 --- a/display.c +++ b/display.c @@ -1,6 +1,6 @@ /* display.c -- readline redisplay facility. */ -/* Copyright (C) 1987-2023 Free Software Foundation, Inc. +/* Copyright (C) 1987-2024 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. @@ -1111,7 +1111,7 @@ rl_redisplay (void) #endif { #if 0 - /* TAG: readline-8.3 20230227 */ + /* TAG: readline-8.4 20230227 */ /* https://savannah.gnu.org/support/index.php?110830 asking for non-printing meta characters to be printed using an escape sequence. */ @@ -1474,13 +1474,22 @@ rl_redisplay (void) changed_screen_line = _rl_last_v_pos != cursor_linenum; if (changed_screen_line) { + int physpos; + + /* The physpos calculation is to account for lines with differing + numbers of invisible characters. */ + if (mb_cur_max == 1 || rl_byte_oriented) + physpos = _rl_last_c_pos - WRAP_OFFSET (_rl_last_v_pos, visible_wrap_offset); + + /* Move to the line where the cursor will be. */ _rl_move_vert (cursor_linenum); + /* If we moved up to the line with the prompt using _rl_term_up, the physical cursor position on the screen stays the same, but the buffer position needs to be adjusted to account for invisible characters. */ - if ((mb_cur_max == 1 || rl_byte_oriented) && cursor_linenum == 0 && wrap_offset) - _rl_last_c_pos += wrap_offset; + if ((mb_cur_max == 1 || rl_byte_oriented) && cursor_linenum == prompt_last_screen_line) + _rl_last_c_pos = physpos + WRAP_OFFSET (cursor_linenum, wrap_offset);; } /* Now we move the cursor to where it needs to be. First, make @@ -1492,20 +1501,29 @@ rl_redisplay (void) only need to reprint it if the cursor is before the last invisible character in the prompt string. */ /* XXX - why not use local_prompt_len? */ - /* XXX - This is right only if the prompt is a single line. */ nleft = prompt_visible_length + wrap_offset; - if (cursor_linenum == 0 && wrap_offset > 0 && _rl_last_c_pos > 0 && - _rl_last_c_pos < PROMPT_ENDING_INDEX && local_prompt) + if (cursor_linenum == prompt_last_screen_line && wrap_offset > 0 && + _rl_last_c_pos > 0 && local_prompt && + _rl_last_c_pos < PROMPT_ENDING_INDEX) { + int pmt_offset; + _rl_cr (); if (modmark) _rl_output_some_chars ("*", 1); - _rl_output_some_chars (local_prompt, nleft); + /* If the number of characters in local_prompt is greater than + the screen width, the prompt wraps. We only want to print the + portion after the line wrap. */ + pmt_offset = local_prompt_newlines[cursor_linenum]; + if (cursor_linenum > 0 && pmt_offset > 0 && nleft > pmt_offset) + _rl_output_some_chars (local_prompt + pmt_offset, nleft - pmt_offset); + else + _rl_output_some_chars (local_prompt, nleft); if (mb_cur_max > 1 && rl_byte_oriented == 0) _rl_last_c_pos = _rl_col_width (local_prompt, 0, nleft, 1) - wrap_offset + modmark; else - _rl_last_c_pos = nleft + modmark; + _rl_last_c_pos = nleft + modmark; /* buffer position */ } /* Where on that line? And where does that line start @@ -1524,6 +1542,7 @@ rl_redisplay (void) the prompt, and there's no good way to tell it, we compensate for those characters here and call _rl_backspace() directly if necessary */ + /* XXX - might need to check cursor_linenum == prompt_last_screen_line like above. */ if (wrap_offset && cursor_linenum == 0 && nleft < _rl_last_c_pos) { /* TX == new physical cursor position in multibyte locale. */ @@ -1732,7 +1751,7 @@ update_line (char *old, char *old_face, char *new, char *new_face, int current_l { char *ofd, *ols, *oe, *nfd, *nls, *ne; char *ofdf, *nfdf, *olsf, *nlsf; - int temp, lendiff, wsatend, od, nd, twidth, o_cpos; + int temp, lendiff, wsatend, od, nd, o_cpos; int current_invis_chars; int col_lendiff, col_temp; int bytes_to_insert; @@ -1863,7 +1882,7 @@ update_line (char *old, char *old_face, char *new, char *new_face, int current_l _rl_output_some_chars below. */ if (newwidth > 0) { - int count, i, j; + int i, j; char *optr; puts_face (new, new_face, newbytes); diff --git a/doc/Makefile.in b/doc/Makefile.in index a6640cb..b0ac6d9 100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@ -1,7 +1,7 @@ # This makefile for Readline library documentation is in -*- text -*- mode. # Emacs likes it that way. -# Copyright (C) 1996-2009 Free Software Foundation, Inc. +# Copyright (C) 1996-2024 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -38,7 +38,7 @@ man3ext = .3 man3dir = $(mandir)/$(manpfx)3 # set this to a value to have the HTML documentation installed -htmldir = +htmldir = @htmldir@ # Support an alternate destination root directory for package building DESTDIR = @@ -83,7 +83,7 @@ INFOOBJ = readline.info history.info rluserman.info PSOBJ = readline.ps history.ps rluserman.ps readline_3.ps history_3.ps HTMLOBJ = readline.html history.html rluserman.html TEXTOBJ = readline.0 history.0 -PDFOBJ = readline.pdf history.pdf rluserman.pdf +PDFOBJ = readline.pdf history.pdf rluserman.pdf readline_3.pdf history_3.pdf INTERMEDIATE_OBJ = rlman.dvi @@ -95,9 +95,17 @@ DIST_DOCS = $(DVIOBJ) $(PSOBJ) $(HTMLOBJ) $(INFOOBJ) $(TEXTOBJ) $(PDFOBJ) $(RM) $@ -${NROFF} -man $< > $@ -.ps.pdf: +.3.pdf: $(RM) $@ - -${PSPDF} $< + -${GROFF} -man -T pdf $< > $@ + +.3.ps: + $(RM) $@ + -${GROFF} -man $< > $@ + +#.ps.pdf: +# $(RM) $@ +# -${PSPDF} $< .dvi.pdf: $(RM) $@ @@ -107,8 +115,9 @@ DIST_DOCS = $(DVIOBJ) $(PSOBJ) $(HTMLOBJ) $(INFOOBJ) $(TEXTOBJ) $(PDFOBJ) # $(RM) $@ # -${TEXI2PDF} $< -all: info dvi html ps text pdf +all: info html text pdf dvi nodvi: info html text +everything: all ps xdist: $(DIST_DOCS) @@ -120,24 +129,38 @@ text: $(TEXTOBJ) pdf: $(PDFOBJ) readline.dvi: $(RLSRC) - TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/rlman.texi - mv rlman.dvi readline.dvi + $(RM) $@ + TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2DVI) -o $@ $(srcdir)/rlman.texi readline.info: $(RLSRC) + $(RM) $@ $(MAKEINFO) --no-split -I $(TEXINPUTDIR) -o $@ $(srcdir)/rlman.texi +readline.pdf: $(RLSRC) + $(RM) $@ + TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2PDF) -o $@ $(srcdir)/rlman.texi + rluserman.dvi: $(RLSRC) + $(RM) $@ TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/rluserman.texi rluserman.info: $(RLSRC) + $(RM) $@ $(MAKEINFO) --no-split -I $(TEXINPUTDIR) -o $@ $(srcdir)/rluserman.texi +rluserman.pdf: $(RLSRC) + $(RM) $@ + TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2PDF) -o $@ $(srcdir)/rlman.texi + history.dvi: ${HISTSRC} TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2DVI) $(srcdir)/history.texi history.info: ${HISTSRC} $(MAKEINFO) --no-split -I $(TEXINPUTDIR) -o $@ $(srcdir)/history.texi +history.pdf: $(HISTSRC) + TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2PDF) $(srcdir)/history.texi + readline.ps: readline.dvi $(RM) $@ $(DVIPS) readline.dvi @@ -154,7 +177,7 @@ history.ps: history.dvi # This leaves readline.html and rlman.html -- rlman.html is for www.gnu.org # readline.html: ${RLSRC} - $(MAKEINFO) -o $@ --html --no-split -I$(TEXINPUTDIR) $(srcdir)/rlman.texi + $(MAKEINFO) -o $@ --html --no-split -I$(TEXINPUTDIR) -o $@ $(srcdir)/rlman.texi rlman.html: ${RLSRC} $(MAKEINFO) -o $@ --html --no-split -I$(TEXINPUTDIR) $(srcdir)/rlman.texi @@ -166,47 +189,47 @@ history.html: ${HISTSRC} $(MAKEINFO) --html --no-split -I$(TEXINPUTDIR) $(srcdir)/history.texi readline.0: readline.3 +history.0: history.3 readline_3.ps: $(srcdir)/readline.3 - ${RM} $@ - ${GROFF} -man < $(srcdir)/readline.3 > $@ + $(RM) $@ + -${GROFF} -man $< > $@ -history.0: history.3 +readline_3.pdf: $(srcdir)/readline.3 + $(RM) $@ + -${GROFF} -man -T pdf $< > $@ history_3.ps: $(srcdir)/history.3 - ${RM} $@ - ${GROFF} -man < $(srcdir)/history.3 > $@ - -readline.pdf: $(RLSRC) - TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2PDF) $(srcdir)/rlman.texi - mv rlman.pdf $@ + $(RM) $@ + -${GROFF} -man $< > $@ -history.pdf: $(HISTSRC) - TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2PDF) $(srcdir)/history.texi +history_3.pdf: $(srcdir)/history.3 + $(RM) $@ + -${GROFF} -man -T pdf $< > $@ -rluserman.pdf: $(RLSRC) - TEXINPUTS=.:$(TEXINPUTDIR):$$TEXINPUTS $(TEXI2PDF) $(srcdir)/rluserman.texi +.PHONY: clean maintainer-clean distclean mostlyclean maybe-clean -clean: +mostlyclean: $(RM) *.aux *.bak *.cp *.fn *.ky *.log *.pg *.toc *.tp *.vr *.cps \ *.pgs *.bt *.bts *.rw *.rws *.fns *.kys *.tps *.vrs *.o \ core *.core -mostlyclean: clean +clean: mostlyclean distclean: clean maybe-clean $(RM) $(INTERMEDIATE_OBJ) $(RM) Makefile maybe-clean: - -if test "X$(topdir)" != "X.." && test "X$(topdir)" != "X$(BUILD_DIR)"; then \ + -TD=$$(cd $(topdir) && pwd -P) ; \ + BD=$$(cd $(BUILD_DIR) && pwd -P) ; \ + if test "X$$TD" != "X$$BD"; then \ $(RM) $(DIST_DOCS); \ fi maintainer-clean: clean $(RM) $(DIST_DOCS) $(RM) $(INTERMEDIATE_OBJ) - $(RM) $(PDFOBJ) $(RM) Makefile installdirs: $(topdir)/support/mkdirs @@ -259,6 +282,29 @@ install: installdirs fi ; \ fi +install-html: html + -if test -n "${htmldir}" ; then \ + if test -f readline.html; then \ + ${INSTALL_DATA} readline.html $(DESTDIR)$(htmldir)/readline.html; \ + else \ + ${INSTALL_DATA} $(srcdir)/readline.html $(DESTDIR)$(htmldir)/readline.html; \ + fi ; \ + if test -f history.html; then \ + ${INSTALL_DATA} history.html $(DESTDIR)$(htmldir)/history.html; \ + else \ + ${INSTALL_DATA} $(srcdir)/history.html $(DESTDIR)$(htmldir)/history.html; \ + fi ; \ + if test -f rluserman.html; then \ + ${INSTALL_DATA} rluserman.html $(DESTDIR)$(htmldir)/rluserman.html; \ + else \ + ${INSTALL_DATA} $(srcdir)/rluserman.html $(DESTDIR)$(htmldir)/rluserman.html; \ + fi ; \ + fi + +install-dvi: +install-pdf: +install-ps: + uninstall: $(RM) $(DESTDIR)$(infodir)/readline.info $(RM) $(DESTDIR)$(infodir)/rluserman.info @@ -270,3 +316,10 @@ uninstall: $(RM) $(DESTDIR)$(htmldir)/rluserman.html ; \ $(RM) $(DESTDIR)$(htmldir)/history.html ; \ fi + +uninstall-html: + -if test -n "${htmldir}" ; then \ + $(RM) $(DESTDIR)$(htmldir)/readline.html ; \ + $(RM) $(DESTDIR)$(htmldir)/rluserman.html ; \ + $(RM) $(DESTDIR)$(htmldir)/history.html ; \ + fi diff --git a/doc/history.0 b/doc/history.0 index 7abcb7d..e532aba 100644 --- a/doc/history.0 +++ b/doc/history.0 @@ -10,9 +10,16 @@ CCOOPPYYRRIIGGHHTT DDEESSCCRRIIPPTTIIOONN Many programs read input from the user a line at a time. The GNU His- tory library is able to keep track of those lines, associate arbitrary - data with each line, and utilize information from previous lines in + data with each line, and utilize information from previous lines when composing new ones. + The History library provides functions that allow applications to their + _h_i_s_t_o_r_y, the set of previously-typed lines, which it keeps in a list. + Applications can choose which lines to save into a history list, how + many commands to save, save a history list to a file, read a history + list from a file, and display lines from the history in various for- + mats. + HHIISSTTOORRYY EEXXPPAANNSSIIOONN The history library supports a history expansion feature that is iden- tical to the history expansion in bbaasshh. This section describes what @@ -25,146 +32,159 @@ HHIISSTTOORRYY EEXXPPAANNSSIIOONN History expansion is usually performed immediately after a complete line is read. It takes place in two parts. The first is to determine - which line from the history list to use during substitution. The sec- - ond is to select portions of that line for inclusion into the current - one. The line selected from the history is the _e_v_e_n_t, and the portions - of that line that are acted upon are _w_o_r_d_s. Various _m_o_d_i_f_i_e_r_s are - available to manipulate the selected words. The line is broken into - words in the same fashion as bbaasshh does when reading input, so that sev- - eral words that would otherwise be separated are considered one word - when surrounded by quotes (see the description of hhiissttoorryy__ttookkeenniizzee(()) - below). + which history list entry to use during substitution. The second is to + select portions of that entry to include into the current one. + + The entry selected from the history is the _e_v_e_n_t, and the portions of + that entry that are acted upon are _w_o_r_d_s. Various _m_o_d_i_f_i_e_r_s are avail- + able to manipulate the selected words. The entry is split into words + in the same fashion as bbaasshh does when reading input, so that several + words that would otherwise be separated are considered one word when + surrounded by quotes (see the description of hhiissttoorryy__ttookkeenniizzee(()) below). + The _e_v_e_n_t _d_e_s_i_g_n_a_t_o_r selects the event, the optional _w_o_r_d _d_e_s_i_g_n_a_t_o_r + selects words from the event, and various optional _m_o_d_i_f_i_e_r_s are avail- + able to manipulate the selected words. History expansions are introduced by the appearance of the history ex- - pansion character, which is !! by default. Only backslash (\\) and sin- - gle quotes can quote the history expansion character. + pansion character, which is !! by default. History expansions may ap- + pear anywhere in the input, but do not nest. + + Only backslash (\\) and single quotes can quote the history expansion + character. There is a special abbreviation for substitution, active when the _q_u_i_c_k - _s_u_b_s_t_i_t_u_t_i_o_n character (default ^^) is the first character on the line. - It selects the previous history list entry, using an event designator - equivalent to !!!!, and substitutes one string for another in that line. + _s_u_b_s_t_i_t_u_t_i_o_n character (default ^^) is the first character on the line. + It selects the previous history list entry, using an event designator + equivalent to !!!!, and substitutes one string for another in that entry. It is described below under EEvveenntt DDeessiiggnnaattoorrss. This is the only his- tory expansion that does not begin with the history expansion charac- ter. EEvveenntt DDeessiiggnnaattoorrss - An event designator is a reference to a command line entry in the his- - tory list. Unless the reference is absolute, events are relative to - the current position in the history list. - - !! Start a history substitution, except when followed by a bbllaannkk, - newline, = or (. - !!_n Refer to command line _n. - !!--_n Refer to the current command minus _n. - !!!! Refer to the previous command. This is a synonym for "!-1". + An event designator is a reference to an entry in the history list. + The event designator consists of the portion of the word beginning with + the history expansion character and ending with the word designator if + present, or the end of the word. Unless the reference is absolute, + events are relative to the current position in the history list. + + !! Start a history substitution, except when followed by a bbllaannkk, + newline, carriage return, =, or (. + !!_n Refer to history list entry _n. + !!--_n Refer to the current entry minus _n. + !!!! Refer to the previous entry. This is a synonym for "!-1". !!_s_t_r_i_n_g - Refer to the most recent command preceding the current position + Refer to the most recent command preceding the current position in the history list starting with _s_t_r_i_n_g. !!??_s_t_r_i_n_g[[??]] - Refer to the most recent command preceding the current position - in the history list containing _s_t_r_i_n_g. The trailing ?? may be - omitted if _s_t_r_i_n_g is followed immediately by a newline. If - _s_t_r_i_n_g is missing, the string from the most recent search is - used; it is an error if there is no previous search string. + Refer to the most recent command preceding the current position + in the history list containing _s_t_r_i_n_g. The trailing ?? may be + omitted if _s_t_r_i_n_g is followed immediately by a newline. If + _s_t_r_i_n_g is missing, this uses the string from the most recent + search; it is an error if there is no previous search string. ^^_s_t_r_i_n_g_1^^_s_t_r_i_n_g_2^^ - Quick substitution. Repeat the last command, replacing _s_t_r_i_n_g_1 - with _s_t_r_i_n_g_2. Equivalent to "!!:s^_s_t_r_i_n_g_1^_s_t_r_i_n_g_2^" (see MMooddii-- - ffiieerrss below). + Quick substitution. Repeat the previous command, replacing + _s_t_r_i_n_g_1 with _s_t_r_i_n_g_2. Equivalent to "!!:s^_s_t_r_i_n_g_1^_s_t_r_i_n_g_2^" + (see MMooddiiffiieerrss below). !!## The entire command line typed so far. WWoorrdd DDeessiiggnnaattoorrss - Word designators are used to select desired words from the event. A :: - separates the event specification from the word designator. It may be - omitted if the word designator begins with a ^^, $$, **, --, or %%. Words - are numbered from the beginning of the line, with the first word being - denoted by 0 (zero). Words are inserted into the current line sepa- - rated by single spaces. + Word designators are used to select desired words from the event. They + are optional; if the word designator isn't supplied, the history expan- + sion uses the entire event. A :: separates the event specification from + the word designator. It may be omitted if the word designator begins + with a ^^, $$, **, --, or %%. Words are numbered from the beginning of the + line, with the first word being denoted by 0 (zero). Words are in- + serted into the current line separated by single spaces. 00 ((zzeerroo)) - The zeroth word. For the shell, this is the command word. + The zeroth word. For the shell, and many other applications, + this is the command word. _n The _nth word. - ^^ The first argument. That is, word 1. - $$ The last word. This is usually the last argument, but will ex- - pand to the zeroth word if there is only one word in the line. + ^^ The first argument: word 1. + $$ The last word. This is usually the last argument, but expands + to the zeroth word if there is only one word in the line. %% The first word matched by the most recent "?_s_t_r_i_n_g?" search, if the search string begins with a character that is part of a - word. + word. By default, searches begin at the end of each line and + proceed to the beginning, so the first word matched is the one + closest to the end of the line. _x--_y A range of words; "-_y" abbreviates "0-_y". ** All of the words but the zeroth. This is a synonym for "_1_-_$". It is not an error to use ** if there is just one word in the - event; the empty string is returned in that case. + event; it expands to the empty string in that case. xx** Abbreviates _x_-_$. xx-- Abbreviates _x_-_$ like xx**, but omits the last word. If xx is miss- ing, it defaults to 0. If a word designator is supplied without an event specification, the - previous command is used as the event. + previous command is used as the event, equivalent to !!!!. MMooddiiffiieerrss - After the optional word designator, there may appear a sequence of one - or more of the following modifiers, each preceded by a ":". These mod- - ify, or edit, the word or words selected from the history event. + After the optional word designator, the expansion may include a se- + quence of one or more of the following modifiers, each preceded by a + ":". These modify, or edit, the word or words selected from the his- + tory event. - hh Remove a trailing file name component, leaving only the head. - tt Remove all leading file name components, leaving the tail. + hh Remove a trailing filename component, leaving only the head. + tt Remove all leading filename components, leaving the tail. rr Remove a trailing suffix of the form _._x_x_x, leaving the basename. ee Remove all but the trailing suffix. pp Print the new command but do not execute it. qq Quote the substituted words, escaping further substitutions. xx Quote the substituted words as with qq, but break into words at bbllaannkkss and newlines. The qq and xx modifiers are mutually exclu- - sive; the last one supplied is used. + sive; expansion uses the last one supplied. ss//_o_l_d//_n_e_w// Substitute _n_e_w for the first occurrence of _o_l_d in the event line. Any character may be used as the delimiter in place of /. The final delimiter is optional if it is the last character of - the event line. The delimiter may be quoted in _o_l_d and _n_e_w with - a single backslash. If & appears in _n_e_w, it is replaced by _o_l_d. - A single backslash will quote the &. If _o_l_d is null, it is set - to the last _o_l_d substituted, or, if no previous history substi- - tutions took place, the last _s_t_r_i_n_g in a !!??_s_t_r_i_n_g[[??]] search. - If _n_e_w is null, each matching _o_l_d is deleted. + the event line. A single backslash quotes the delimiter in _o_l_d + and _n_e_w. If & appears in _n_e_w, it is replaced with _o_l_d. A sin- + gle backslash quotes the &. If _o_l_d is null, it is set to the + last _o_l_d substituted, or, if no previous history substitutions + took place, the last _s_t_r_i_n_g in a !!??_s_t_r_i_n_g[[??]] search. If _n_e_w is + null, each matching _o_l_d is deleted. && Repeat the previous substitution. gg Cause changes to be applied over the entire event line. This is - used in conjunction with "::ss" (e.g., "::ggss//_o_l_d//_n_e_w//") or "::&&". - If used with "::ss", any delimiter can be used in place of /, and - the final delimiter is optional if it is the last character of + used in conjunction with "::ss" (e.g., "::ggss//_o_l_d//_n_e_w//") or "::&&". + If used with "::ss", any delimiter can be used in place of /, and + the final delimiter is optional if it is the last character of the event line. An aa may be used as a synonym for gg. GG Apply the following "ss" or "&&" modifier once to each word in the event line. PPRROOGGRRAAMMMMIINNGG WWIITTHH HHIISSTTOORRYY FFUUNNCCTTIIOONNSS - This section describes how to use the History library in other pro- + This section describes how to use the History library in other pro- grams. IInnttrroodduuccttiioonn ttoo HHiissttoorryy - A programmer using the History library has available functions for re- - membering lines on a history list, associating arbitrary data with a - line, removing lines from the list, searching through the list for a - line containing an arbitrary text string, and referencing any line in + A programmer using the History library has available functions for re- + membering lines on a history list, associating arbitrary data with a + line, removing lines from the list, searching through the list for a + line containing an arbitrary text string, and referencing any line in the list directly. In addition, a history _e_x_p_a_n_s_i_o_n function is avail- - able which provides for a consistent user interface across different + able which provides for a consistent user interface across different programs. - The user using programs written with the History library has the bene- - fit of a consistent user interface with a set of well-known commands - for manipulating the text of previous lines and using that text in new + The user using programs written with the History library has the bene- + fit of a consistent user interface with a set of well-known commands + for manipulating the text of previous lines and using that text in new commands. The basic history manipulation commands are identical to the history substitution provided by bbaasshh. - The programmer can also use the readline library, which includes some + The programmer can also use the readline library, which includes some history manipulation by default, and has the added advantage of command line editing. - Before declaring any functions using any functionality the History li- - brary provides in other code, an application writer should include the - file _<_r_e_a_d_l_i_n_e_/_h_i_s_t_o_r_y_._h_> 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 + Before declaring any functions using any functionality the History li- + brary provides in other code, an application writer should include the + file _<_r_e_a_d_l_i_n_e_/_h_i_s_t_o_r_y_._h_> 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. HHiissttoorryy SSttoorraaggee - The history list is an array of history entries. A history entry is + The history list is an array of history entries. A history entry is declared as follows: _t_y_p_e_d_e_f _v_o_i_d _* hhiissttddaattaa__tt;; @@ -179,7 +199,7 @@ PPRROOGGRRAAMMMMIINNGG WWIITTHH HHIISSTTOORRYY FFUUNNC _H_I_S_T___E_N_T_R_Y _*_* tthhee__hhiissttoorryy__lliisstt;; - The state of the History library is encapsulated into a single struc- + The state of the History library is encapsulated into a single struc- ture: /* @@ -196,16 +216,16 @@ PPRROOGGRRAAMMMMIINNGG WWIITTHH HHIISSTTOORRYY FFUUNNC If the flags member includes HHSS__SSTTIIFFLLEEDD, the history has been stifled. HHiissttoorryy FFuunnccttiioonnss - This section describes the calling sequence for the various functions + This section describes the calling sequence for the various functions exported by the GNU History library. IInniittiiaalliizziinngg HHiissttoorryy aanndd SSttaattee MMaannaaggeemmeenntt - This section describes functions used to initialize and manage the + This section describes functions used to initialize and manage the state of the History library when you want to use the history functions in your program. _v_o_i_d uussiinngg__hhiissttoorryy (_v_o_i_d) - Begin a session in which the history functions might be used. This + Begin a session in which the history functions might be used. This initializes the interactive variables. _H_I_S_T_O_R_Y___S_T_A_T_E _* hhiissttoorryy__ggeett__hhiissttoorryy__ssttaattee (_v_o_i_d) @@ -215,17 +235,17 @@ HHiissttoorryy FFuunnccttiioonnss Set the state of the history list according to _s_t_a_t_e. HHiissttoorryy LLiisstt MMaannaaggeemmeenntt - These functions manage individual entries on the history list, or set + These functions manage individual entries on the history list, or set parameters managing the list itself. _v_o_i_d aadddd__hhiissttoorryy (_c_o_n_s_t _c_h_a_r _*_s_t_r_i_n_g) Place _s_t_r_i_n_g at the end of the history list. The associated data field - (if any) is set to NNUULLLL. If the maximum number of history entries has - been set using ssttiiffllee__hhiissttoorryy(()), and the new number of history entries + (if any) is set to NNUULLLL. If the maximum number of history entries has + been set using ssttiiffllee__hhiissttoorryy(()), and the new number of history entries would exceed that maximum, the oldest history entry is removed. _v_o_i_d aadddd__hhiissttoorryy__ttiimmee (_c_o_n_s_t _c_h_a_r _*_s_t_r_i_n_g) - Change the time stamp associated with the most recent history entry to + Change the time stamp associated with the most recent history entry to _s_t_r_i_n_g. _H_I_S_T___E_N_T_R_Y _* rreemmoovvee__hhiissttoorryy (_i_n_t _w_h_i_c_h) @@ -235,26 +255,26 @@ HHiissttoorryy FFuunnccttiioonnss _h_i_s_t_d_a_t_a___t ffrreeee__hhiissttoorryy__eennttrryy (_H_I_S_T___E_N_T_R_Y _*_h_i_s_t_e_n_t) Free the history entry _h_i_s_t_e_n_t and any history library private data as- - sociated with it. Returns the application-specific data so the caller + sociated with it. Returns the application-specific data so the caller can dispose of it. - _H_I_S_T___E_N_T_R_Y _* rreeppllaaccee__hhiissttoorryy__eennttrryy (_i_n_t _w_h_i_c_h_, _c_o_n_s_t _c_h_a_r _*_l_i_n_e_, _h_i_s_t_- + _H_I_S_T___E_N_T_R_Y _* rreeppllaaccee__hhiissttoorryy__eennttrryy (_i_n_t _w_h_i_c_h_, _c_o_n_s_t _c_h_a_r _*_l_i_n_e_, _h_i_s_t_- _d_a_t_a___t _d_a_t_a) - Make the history entry at offset _w_h_i_c_h have _l_i_n_e and _d_a_t_a. This re- - turns the old entry so the caller can dispose of any application-spe- - cific data. In the case of an invalid _w_h_i_c_h, a NNUULLLL pointer is re- + Make the history entry at offset _w_h_i_c_h have _l_i_n_e and _d_a_t_a. This re- + turns the old entry so the caller can dispose of any application-spe- + cific data. In the case of an invalid _w_h_i_c_h, a NNUULLLL pointer is re- turned. _v_o_i_d cclleeaarr__hhiissttoorryy (_v_o_i_d) Clear the history list by deleting all the entries. _v_o_i_d ssttiiffllee__hhiissttoorryy (_i_n_t _m_a_x) - Stifle the history list, remembering only the last _m_a_x entries. The + Stifle the history list, remembering only the last _m_a_x entries. The history list will contain only _m_a_x entries at a time. _i_n_t uunnssttiiffllee__hhiissttoorryy (_v_o_i_d) - Stop stifling the history. This returns the previously-set maximum - number of history entries (as set by ssttiiffllee__hhiissttoorryy(())). history was + Stop stifling the history. This returns the previously-set maximum + number of history entries (as set by ssttiiffllee__hhiissttoorryy(())). history was stifled. The value is positive if the history was stifled, negative if it wasn't. @@ -267,29 +287,29 @@ HHiissttoorryy FFuunnccttiioonnss _H_I_S_T___E_N_T_R_Y _*_* hhiissttoorryy__lliisstt (_v_o_i_d) Return a NNUULLLL terminated array of _H_I_S_T___E_N_T_R_Y _* which is the current in- - put history. Element 0 of this list is the beginning of time. If + put history. Element 0 of this list is the beginning of time. If there is no history, return NNUULLLL. _i_n_t wwhheerree__hhiissttoorryy (_v_o_i_d) Returns the offset of the current history element. _H_I_S_T___E_N_T_R_Y _* ccuurrrreenntt__hhiissttoorryy (_v_o_i_d) - Return the history entry at the current position, as determined by + Return the history entry at the current position, as determined by wwhheerree__hhiissttoorryy(()). If there is no entry there, return a NNUULLLL pointer. _H_I_S_T___E_N_T_R_Y _* hhiissttoorryy__ggeett (_i_n_t _o_f_f_s_e_t) Return the history entry at position _o_f_f_s_e_t. The range of valid values - of _o_f_f_s_e_t starts at hhiissttoorryy__bbaassee and ends at hhiissttoorryy__lleennggtthh - 1. If - there is no entry there, or if _o_f_f_s_e_t is outside the valid range, re- + of _o_f_f_s_e_t starts at hhiissttoorryy__bbaassee and ends at hhiissttoorryy__lleennggtthh - 1. If + there is no entry there, or if _o_f_f_s_e_t is outside the valid range, re- turn a NNUULLLL pointer. _t_i_m_e___t hhiissttoorryy__ggeett__ttiimmee (_H_I_S_T___E_N_T_R_Y _*) - Return the time stamp associated with the history entry passed as the + Return the time stamp associated with the history entry passed as the argument. _i_n_t hhiissttoorryy__ttoottaall__bbyytteess (_v_o_i_d) - Return the number of bytes that the primary history entries are using. - This function returns the sum of the lengths of all the lines in the + Return the number of bytes that the primary history entries are using. + This function returns the sum of the lengths of all the lines in the history. MMoovviinngg AArroouunndd tthhee HHiissttoorryy LLiisstt @@ -298,103 +318,102 @@ HHiissttoorryy FFuunnccttiioonnss _i_n_t hhiissttoorryy__sseett__ppooss (_i_n_t _p_o_s) Set the current history offset to _p_o_s, an absolute index into the list. - Returns 1 on success, 0 if _p_o_s is less than zero or greater than the + Returns 1 on success, 0 if _p_o_s is less than zero or greater than the number of history entries. _H_I_S_T___E_N_T_R_Y _* pprreevviioouuss__hhiissttoorryy (_v_o_i_d) - Back up the current history offset to the previous history entry, and - return a pointer to that entry. If there is no previous entry, return + Back up the current history offset to the previous history entry, and + return a pointer to that entry. If there is no previous entry, return a NNUULLLL pointer. _H_I_S_T___E_N_T_R_Y _* nneexxtt__hhiissttoorryy (_v_o_i_d) - If the current history offset refers to a valid history entry, incre- - ment the current history offset. If the possibly-incremented history + If the current history offset refers to a valid history entry, incre- + ment the current history offset. If the possibly-incremented history offset refers to a valid history entry, return a pointer to that entry; otherwise, return a NNUULLLL pointer. SSeeaarrcchhiinngg tthhee HHiissttoorryy LLiisstt - These functions allow searching of the history list for entries con- + These functions allow searching of the history list for entries con- taining a specific string. Searching may be performed both forward and - backward from the current history position. The search may be _a_n_- + backward from the current history position. The search may be _a_n_- _c_h_o_r_e_d, meaning that the string must match at the beginning of the his- tory entry. _i_n_t hhiissttoorryy__sseeaarrcchh (_c_o_n_s_t _c_h_a_r _*_s_t_r_i_n_g_, _i_n_t _d_i_r_e_c_t_i_o_n) - Search the history for _s_t_r_i_n_g, starting at the current history offset. - If _d_i_r_e_c_t_i_o_n is less than 0, then the search is through previous en- - tries, otherwise through subsequent entries. If _s_t_r_i_n_g is found, then - the current history index is set to that history entry, and the value + Search the history for _s_t_r_i_n_g, starting at the current history offset. + If _d_i_r_e_c_t_i_o_n is less than 0, then the search is through previous en- + tries, otherwise through subsequent entries. If _s_t_r_i_n_g is found, then + the current history index is set to that history entry, and the value returned is the offset in the line of the entry where _s_t_r_i_n_g was found. Otherwise, nothing is changed, and the function returns -1. _i_n_t hhiissttoorryy__sseeaarrcchh__pprreeffiixx (_c_o_n_s_t _c_h_a_r _*_s_t_r_i_n_g_, _i_n_t _d_i_r_e_c_t_i_o_n) - Search the history for _s_t_r_i_n_g, starting at the current history offset. - The search is anchored: matching lines must begin with _s_t_r_i_n_g. If _d_i_- - _r_e_c_t_i_o_n is less than 0, then the search is through previous entries, - otherwise through subsequent entries. If _s_t_r_i_n_g is found, then the - current history index is set to that entry, and the return value is 0. + Search the history for _s_t_r_i_n_g, starting at the current history offset. + The search is anchored: matching lines must begin with _s_t_r_i_n_g. If _d_i_- + _r_e_c_t_i_o_n is less than 0, then the search is through previous entries, + otherwise through subsequent entries. If _s_t_r_i_n_g is found, then the + current history index is set to that entry, and the return value is 0. Otherwise, nothing is changed, and the function returns -1. _i_n_t hhiissttoorryy__sseeaarrcchh__ppooss (_c_o_n_s_t _c_h_a_r _*_s_t_r_i_n_g_, _i_n_t _d_i_r_e_c_t_i_o_n_, _i_n_t _p_o_s) Search for _s_t_r_i_n_g in the history list, starting at _p_o_s, an absolute in- dex into the list. If _d_i_r_e_c_t_i_o_n is negative, the search proceeds back- - ward from _p_o_s, otherwise forward. Returns the absolute index of the + ward from _p_o_s, otherwise forward. Returns the absolute index of the history element where _s_t_r_i_n_g was found, or -1 otherwise. MMaannaaggiinngg tthhee HHiissttoorryy FFiillee - The History library can read the history from and write it to a file. + The History library can read the history from and write it to a file. This section documents the functions for managing a history file. _i_n_t rreeaadd__hhiissttoorryy (_c_o_n_s_t _c_h_a_r _*_f_i_l_e_n_a_m_e) Add the contents of _f_i_l_e_n_a_m_e to the history list, a line at a time. If - _f_i_l_e_n_a_m_e is NNUULLLL, then read from _~_/_._h_i_s_t_o_r_y. Returns 0 if successful, + _f_i_l_e_n_a_m_e is NNUULLLL, then read from _~_/_._h_i_s_t_o_r_y. Returns 0 if successful, or eerrrrnnoo if not. _i_n_t rreeaadd__hhiissttoorryy__rraannggee (_c_o_n_s_t _c_h_a_r _*_f_i_l_e_n_a_m_e_, _i_n_t _f_r_o_m_, _i_n_t _t_o) - Read a range of lines from _f_i_l_e_n_a_m_e, adding them to the history list. - Start reading at line _f_r_o_m and end at _t_o. If _f_r_o_m is zero, start at + Read a range of lines from _f_i_l_e_n_a_m_e, adding them to the history list. + Start reading at line _f_r_o_m and end at _t_o. If _f_r_o_m is zero, start at the beginning. If _t_o is less than _f_r_o_m, then read until the end of the - file. If _f_i_l_e_n_a_m_e is NNUULLLL, then read from _~_/_._h_i_s_t_o_r_y. Returns 0 if + file. If _f_i_l_e_n_a_m_e is NNUULLLL, then read from _~_/_._h_i_s_t_o_r_y. Returns 0 if successful, or eerrrrnnoo if not. _i_n_t wwrriittee__hhiissttoorryy (_c_o_n_s_t _c_h_a_r _*_f_i_l_e_n_a_m_e) - Write the current history to _f_i_l_e_n_a_m_e, overwriting _f_i_l_e_n_a_m_e if neces- - sary. If _f_i_l_e_n_a_m_e is NNUULLLL, then write the history list to _~_/_._h_i_s_t_o_r_y. + Write the current history to _f_i_l_e_n_a_m_e, overwriting _f_i_l_e_n_a_m_e if neces- + sary. If _f_i_l_e_n_a_m_e is NNUULLLL, then write the history list to _~_/_._h_i_s_t_o_r_y. Returns 0 on success, or eerrrrnnoo on a read or write error. _i_n_t aappppeenndd__hhiissttoorryy (_i_n_t _n_e_l_e_m_e_n_t_s_, _c_o_n_s_t _c_h_a_r _*_f_i_l_e_n_a_m_e) Append the last _n_e_l_e_m_e_n_t_s of the history list to _f_i_l_e_n_a_m_e. If _f_i_l_e_n_a_m_e - is NNUULLLL, then append to _~_/_._h_i_s_t_o_r_y. Returns 0 on success, or eerrrrnnoo on + is NNUULLLL, then append to _~_/_._h_i_s_t_o_r_y. Returns 0 on success, or eerrrrnnoo on a read or write error. _i_n_t hhiissttoorryy__ttrruunnccaattee__ffiillee (_c_o_n_s_t _c_h_a_r _*_f_i_l_e_n_a_m_e_, _i_n_t _n_l_i_n_e_s) Truncate the history file _f_i_l_e_n_a_m_e, leaving only the last _n_l_i_n_e_s lines. - If _f_i_l_e_n_a_m_e is NNUULLLL, then _~_/_._h_i_s_t_o_r_y is truncated. Returns 0 on suc- + If _f_i_l_e_n_a_m_e is NNUULLLL, then _~_/_._h_i_s_t_o_r_y is truncated. Returns 0 on suc- cess, or eerrrrnnoo on failure. HHiissttoorryy EExxppaannssiioonn These functions implement history expansion. _i_n_t hhiissttoorryy__eexxppaanndd (_c_o_n_s_t _c_h_a_r _*_s_t_r_i_n_g_, _c_h_a_r _*_*_o_u_t_p_u_t) - Expand _s_t_r_i_n_g, placing the result into _o_u_t_p_u_t, a pointer to a string. + Expand _s_t_r_i_n_g, placing the result into _o_u_t_p_u_t, a pointer to a string. Returns: - 0 If no expansions took place (or, if the only change in - the text was the removal of escape characters preceding + 0 If no expansions took place (or, if the only change in + the text was the removal of escape characters preceding the history expansion character); 1 if expansions did take place; -1 if there was an error in expansion; - 2 if the returned line should be displayed, but not exe- + 2 if the returned line should be displayed, but not exe- cuted, as with the ::pp modifier. - If an error occurred in expansion, then _o_u_t_p_u_t contains a descriptive + If an error occurred in expansion, then _o_u_t_p_u_t contains a descriptive error message. _c_h_a_r _* ggeett__hhiissttoorryy__eevveenntt (_c_o_n_s_t _c_h_a_r _*_s_t_r_i_n_g_, _i_n_t _*_c_i_n_d_e_x_, _i_n_t _q_c_h_a_r) - Returns the text of the history event beginning at _s_t_r_i_n_g + _*_c_i_n_d_e_x. + Returns the text of the history event beginning at _s_t_r_i_n_g + _*_c_i_n_d_e_x. _*_c_i_n_d_e_x is modified to point to after the event specifier. At function - entry, _c_i_n_d_e_x points to the index into _s_t_r_i_n_g where the history event - specification begins. _q_c_h_a_r is a character that is allowed to end the - event specification in addition to the ``normal'' terminating charac- - ters. + entry, _c_i_n_d_e_x points to the index into _s_t_r_i_n_g where the history event + specification begins. _q_c_h_a_r is a character that is allowed to end the + event specification in addition to the "normal" terminating characters. _c_h_a_r _*_* hhiissttoorryy__ttookkeenniizzee (_c_o_n_s_t _c_h_a_r _*_s_t_r_i_n_g) Return an array of tokens parsed out of _s_t_r_i_n_g, much as the shell @@ -424,8 +443,8 @@ HHiissttoorryy FFuunnccttiioonnss preserved between sessions. The default value is 0, meaning that time- stamps are not saved. The current timestamp format uses the value of _h_i_s_t_o_r_y___c_o_m_m_e_n_t___c_h_a_r to delimit timestamp entries in the history file. - If that variable does not have a value (the default), timestamps will - not be written. + If that variable does not have a value (the default), the history li- + brary will not write timestamps. _c_h_a_r hhiissttoorryy__eexxppaannssiioonn__cchhaarr The character that introduces a history event. The default is !!. Set- @@ -464,14 +483,14 @@ HHiissttoorryy FFuunnccttiioonnss _i_n_t hhiissttoorryy__qquuoottiinngg__ssttaattee An application may set this variable to indicate that the current line - being expanded is subject to existing quoting. If set to _', the history - expansion function will assume that the line is single-quoted and in- - hibit expansion until it reads an unquoted closing single quote; if set - to _", history expansion will assume the line is double quoted until it - reads an unquoted closing double quote. If set to zero, the default, - the history expansion function will assume the line is not quoted and - treat quote characters within the line as described above. This is - only effective if hhiissttoorryy__qquuootteess__iinnhhiibbiitt__eexxppaannssiioonn is set. + being expanded is subject to existing quoting. If set to _', history + expansion assumes that the line is single-quoted and inhibit expansion + until it reads an unquoted closing single quote; if set to _", history + expansion assumes the line is double quoted until it reads an unquoted + closing double quote. If set to zero, the default, history expansion + assumes the line is not quoted and treats quote characters within the + line as described above. This is only effective if hhiissttoorryy__qquuootteess__iinn-- + hhiibbiitt__eexxppaannssiioonn is set. _r_l___l_i_n_e_b_u_f___f_u_n_c___t _* hhiissttoorryy__iinnhhiibbiitt__eexxppaannssiioonn__ffuunnccttiioonn This should be set to the address of a function that takes two argu- @@ -506,11 +525,11 @@ BBUUGG RREEPPOORRTTSS Once you have determined that a bug actually exists, mail a bug report to _b_u_g_-_r_e_a_d_l_i_n_e@_g_n_u_._o_r_g. If you have a fix, you are welcome to mail - that as well! Suggestions and `philosophical' bug reports may be + that as well! Suggestions and "philosophical" bug reports may be mailed to _b_u_g_-_r_e_a_d_l_i_n_e@_g_n_u_._o_r_g or posted to the Usenet newsgroup ggnnuu..bbaasshh..bbuugg. Comments and bug reports concerning this manual page should be directed to _c_h_e_t_._r_a_m_e_y_@_c_a_s_e_._e_d_u. -GNU History 8.3 2024 March 29 _H_I_S_T_O_R_Y(3) +GNU History 8.3 2024 November 29 _H_I_S_T_O_R_Y(3) diff --git a/doc/history.3 b/doc/history.3 index af31f1c..514d6f8 100644 --- a/doc/history.3 +++ b/doc/history.3 @@ -6,9 +6,9 @@ .\" Case Western Reserve University .\" chet.ramey@case.edu .\" -.\" Last Change: Fri Mar 29 12:03:51 EDT 2024 +.\" Last Change: Fri Nov 29 18:17:58 EST 2024 .\" -.TH HISTORY 3 "2024 March 29" "GNU History 8.3" +.TH HISTORY 3 "2024 November 29" "GNU History 8.3" .\" .ie \n(.g \{\ .ds ' \(aq @@ -18,7 +18,7 @@ .\} .el \{\ .ds ' ' -.\" not usable in macro arguments on AT&T troff (DWB, Solaris 10) +.\" \*" is not usable in macro arguments on AT&T troff (DWB, Solaris 10) .ds " ""\" two adjacent quotes and no space before this comment .ds ^ ^ .ds ~ ~ @@ -26,6 +26,7 @@ . .\" Fix broken EX/EE macros on DWB troff. .\" Detect it: only DWB sets up a `)Y` register. +.if \n(.g .nr )Y 0 \" silence "groff -wreg" warning .if \n()Y \{\ .\" Revert the undesired changes to indentation. .am EX @@ -38,10 +39,15 @@ . .\" File Name macro. This used to be `.PN', for Path Name, .\" but Sun doesn't seem to like that very much. +.\" \% at the beginning of the string protects the filename from hyphenation. .\" .de FN \%\fI\|\\$1\|\fP .. +.\" +.\" Quotation macro: generate consistent quoted strings that don't rely +.\" on the presence of the `CW' constant-width font. +.\" .de Q .ie \n(.g \(lq\\$1\(rq\\$2 .el \{\ @@ -76,10 +82,19 @@ history \- GNU History Library .if t The GNU History Library is Copyright \(co 1989-2024 by the Free Software Foundation, Inc. .if n The GNU History Library is Copyright (C) 1989-2024 by the Free Software Foundation, Inc. .SH DESCRIPTION -Many programs read input from the user a line at a time. The GNU +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 -data with each line, and utilize information from previous lines in +data with each line, and utilize information from previous lines when composing new ones. +.PP +The History library provides functions that allow applications to their +\fIhistory\fP, the set of previously-typed lines, +which it keeps in a list. +Applications can choose which lines to save into a history list, how +many commands to save, save a history list to a file, read a history +list from a file, and display lines from the history in various +formats. .SH "HISTORY EXPANSION" The history library supports a history expansion feature that is identical to the history expansion in @@ -94,21 +109,28 @@ fix errors in previous commands quickly. History expansion is usually performed immediately after a complete line is read. It takes place in two parts. -The first is to determine which line from the history list +The first is to determine which history list entry to use during substitution. -The second is to select portions of that line for inclusion into +The second is to select portions of that entry to include into the current one. -The line selected from the history is the \fIevent\fP, -and the portions of that line that are acted upon are \fIwords\fP. +.PP +The entry selected from the history is the \fIevent\fP, +and the portions of that entry that are acted upon are \fIwords\fP. Various \fImodifiers\fP are available to manipulate the selected words. -The line is broken into words in the same fashion as \fBbash\fP +The entry is split into words in the same fashion as \fBbash\fP does when reading input, so that several words that would otherwise be separated are considered one word when surrounded by quotes (see the description of \fBhistory_tokenize()\fP below). +The \fIevent designator\fP selects the event, the optional +\fIword designator\fP selects words from the event, and +various optional \fImodifiers\fP are available to manipulate the +selected words. .PP History expansions are introduced by the appearance of the history expansion character, which is \^\fB!\fP\^ by default. +History expansions may appear anywhere in the input, but do not nest. +.PP Only backslash (\^\fB\e\fP\^) and single quotes can quote the history expansion character. .PP @@ -117,13 +139,16 @@ There is a special abbreviation for substitution, active when the is the first character on the line. It selects the previous history list entry, using an event designator equivalent to \fB!!\fP, -and substitutes one string for another in that line. +and substitutes one string for another in that entry. It is described below under \fBEvent Designators\fP. This is the only history expansion that does not begin with the history expansion character. .SS Event Designators -An event designator is a reference to a command line entry in the -history list. +An event designator is a reference to an entry in the history list. +The event designator +consists of the portion of the word beginning with the history +expansion character and ending with the word designator if present, +or the end of the word. Unless the reference is absolute, events are relative to the current position in the history list. .PP @@ -132,18 +157,20 @@ position in the history list. .B ! Start a history substitution, except when followed by a .BR blank , -newline, = or (. +newline, carriage return, =, +or (. .TP .B !\fIn\fP -Refer to command line +Refer to history list entry .IR n . .TP .B !\-\fIn\fP -Refer to the current command minus +Refer to the current entry minus .IR n . .TP .B !! -Refer to the previous command. This is a synonym for +Refer to the previous entry. +This is a synonym for .Q !\-1 . .TP .B !\fIstring\fP @@ -158,16 +185,20 @@ history list containing The trailing \fB?\fP may be omitted if .I string is followed immediately by a newline. -If \fIstring\fP is missing, the string from the most recent search is used; +If \fIstring\fP is missing, this uses +the string from the most recent search; it is an error if there is no previous search string. .TP -.B \*^\fIstring1\fP\*^\fIstring2\fP\*^ -Quick substitution. Repeat the last command, replacing +.B \d\s+2\*^\s-2\u\fIstring1\fP\d\s+2\*^\s-2\u\fIstring2\fP\d\s+2\*^\s-2\u +.\" was .B \*^\fIstring1\fP\*^\fIstring2\fP\*^ +Quick substitution. +Repeat the previous command, replacing .I string1 with .IR string2 . Equivalent to -.Q !!:s\*^\fIstring1\fP\*^\fIstring2\fP\*^ +.Q !!:s\d\s+2\*^\s-2\u\fIstring1\fP\d\s+2\*^\s-2\u\fIstring2\fP\d\s+2\*^\s-2\u +.\" was .Q !!:s\*^\fIstring1\fP\*^\fIstring2\fP\*^ (see \fBModifiers\fP below). .TP .B !# @@ -175,6 +206,8 @@ The entire command line typed so far. .PD .SS Word Designators Word designators are used to select desired words from the event. +They are optional; if the word designator isn't supplied, the history +expansion uses the entire event. A .B : separates the event specification from the word designator. @@ -192,17 +225,18 @@ Words are inserted into the current line separated by single spaces. .PD 0 .TP .B 0 (zero) -The zeroth word. For the shell, this is the command -word. +The zeroth word. +For the shell, and many other applications, this is the command word. .TP .I n The \fIn\fPth word. .TP .B \*^ -The first argument. That is, word 1. +The first argument: word 1. .TP .B $ -The last word. This is usually the last argument, but will expand to the +The last word. +This is usually the last argument, but expands to the zeroth word if there is only one word in the line. .TP .B % @@ -210,6 +244,9 @@ The first word matched by the most recent .Q ?\fIstring\fP? search, if the search string begins with a character that is part of a word. +By default, searches begin at the end of each line and proceed to the +beginning, so the first word matched is the one closest to the end of +the line. .TP .I x\fB\-\fPy A range of words; @@ -223,8 +260,8 @@ This is a synonym for .Q \fI1\-$\fP . It is not an error to use .B * -if there is just one -word in the event; the empty string is returned in that case. +if there is just one word in the event; +it expands to the empty string in that case. .TP .B x* Abbreviates \fIx\-$\fP. @@ -235,21 +272,20 @@ If \fBx\fP is missing, it defaults to 0. .PD .PP If a word designator is supplied without an event specification, the -previous command is used as the event. +previous command is used as the event, equivalent to \fB!!\fP. .SS Modifiers -After the optional word designator, there may appear a sequence of -one or more of the following modifiers, each preceded by a +After the optional word designator, the expansion may include a +sequence of one or more of the following modifiers, each preceded by a .Q : . These modify, or edit, the word or words selected from the history event. .PP .PD 0 -.PP .TP .B h -Remove a trailing file name component, leaving only the head. +Remove a trailing filename component, leaving only the head. .TP .B t -Remove all leading file name components, leaving the tail. +Remove all leading filename components, leaving the tail. .TP .B r Remove a trailing suffix of the form \fI.xxx\fP, leaving the @@ -270,8 +306,8 @@ Quote the substituted words as with but break into words at .B blanks and newlines. -The \fBq\fP and \fBx\fP modifiers are mutually exclusive; the last one -supplied is used. +The \fBq\fP and \fBx\fP modifiers are mutually exclusive; +expansion uses the last one supplied. .TP .B s/\fIold\fP/\fInew\fP/ Substitute @@ -282,15 +318,15 @@ in the event line. Any character may be used as the delimiter in place of /. The final delimiter is optional if it is the last character of the event line. -The delimiter may be quoted in +A single backslash quotes the delimiter in .I old and -.I new -with a single backslash. If & appears in +.IR new . +If & appears in .IR new , -it is replaced by +it is replaced with .IR old . -A single backslash will quote the &. +A single backslash quotes the &. If .I old is null, it is set to the last @@ -334,7 +370,7 @@ modifier once to each word in the event line. .PD .SH "PROGRAMMING WITH HISTORY FUNCTIONS" This section describes how to use the History library in other programs. -.SS Introduction to History +.SS "Introduction to History" A 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 @@ -369,11 +405,13 @@ declared as follows: .Vb "typedef void *" histdata_t; .PP .nf +.EX typedef struct _hist_entry { char *line; char *timestamp; histdata_t data; } HIST_ENTRY; +.EE .fi .PP The history list itself might therefore be declared as @@ -611,7 +649,9 @@ Returns the text of the history event beginning at \fIstring\fP + specifier. At function entry, \fIcindex\fP points to the index into \fIstring\fP where the history event specification begins. \fIqchar\fP is a character that is allowed to end the event specification in addition -to the ``normal'' terminating characters. +to the +.Q normal +terminating characters. .PP .F1 "char **" history_tokenize "const char *string" Return an array of tokens parsed out of \fIstring\fP, much as the @@ -643,16 +683,20 @@ If non-zero, timestamps are written to the history file, so they can be preserved between sessions. The default value is 0, meaning that timestamps are not saved. The current timestamp format uses the value of \fIhistory_comment_char\fP -to delimit timestamp entries in the history file. If that variable does -not have a value (the default), timestamps will not be written. +to delimit timestamp entries in the history file. +If that variable does +not have a value (the default), +the history library will not write timestamps. .PP .Vb char history_expansion_char -The character that introduces a history event. The default is \fB!\fP. +The character that introduces a history event. +The default is \fB!\fP. Setting this to 0 inhibits history expansion. .PP .Vb char history_subst_char The character that invokes word substitution if found at the start of -a line. The default is \fB\*^\fP. +a line. +The default is \fB\*^\fP. .PP .Vb char history_comment_char During tokenization, if this character is seen as the first character @@ -684,13 +728,15 @@ The default value is 0. .PP .Vb int history_quoting_state An application may set this variable to indicate that the current line -being expanded is subject to existing quoting. If set to \fI\*'\fP, the -history expansion function will assume that the line is single-quoted and -inhibit expansion until it reads an unquoted closing single quote; if set -to \fI\*"\fP, history expansion will assume the line is double quoted until -it reads an unquoted closing double quote. If set to zero, the default, -the history expansion function will assume the line is not quoted and -treat quote characters within the line as described above. +being expanded is subject to existing quoting. +If set to \fI\*'\fP, +history expansion assumes that the line is single-quoted and +inhibit expansion until it reads an unquoted closing single quote; +if set to \fI\*"\fP, history expansion assumes the line is double quoted +until it reads an unquoted closing double quote. +If set to zero, the default, +history expansion assumes the line is not quoted and +treats quote characters within the line as described above. This is only effective if \fBhistory_quotes_inhibit_expansion\fP is set. .PP .Vb "rl_linebuf_func_t *" history_inhibit_expansion_function @@ -740,7 +786,9 @@ library that you have. Once you have determined that a bug actually exists, mail a bug report to \fIbug\-readline\fP@\fIgnu.org\fP. If you have a fix, you are welcome to mail that -as well! Suggestions and `philosophical' bug reports may be mailed +as well! Suggestions and +.Q philosophical +bug reports may be mailed to \fIbug\-readline\fP@\fIgnu.org\fP or posted to the Usenet newsgroup .BR gnu.bash.bug . diff --git a/doc/history.dvi b/doc/history.dvi index 9c2608f..24cfd07 100644 Binary files a/doc/history.dvi and b/doc/history.dvi differ diff --git a/doc/history.html b/doc/history.html index 3627384..e633f7e 100644 --- a/doc/history.html +++ b/doc/history.html @@ -4,11 +4,11 @@ @@ -184,8 +185,8 @@ Next:

-

The following paragraphs describe the notation used to represent -keystrokes. +

The following paragraphs use Emacs style to +describe the notation used to represent keystrokes.

The text C-k is read as ‘Control-K’ and describes the character produced when the k key is pressed while the Control key @@ -193,29 +194,45 @@ is depressed.

The text M-k is read as ‘Meta-K’ and describes the character produced when the Meta key (if you have one) is depressed, and the k -key is pressed. -The Meta key is labeled ALT on many keyboards. +key is pressed (a meta character), then both are released. +The Meta key is labeled ALT or Option on many keyboards. On keyboards with two keys labeled ALT (usually to either side of the space bar), the ALT on the left side is generally set to work as a Meta key. -The ALT key on the right may also be configured to work as a -Meta key or may be configured as some other modifier, such as a +One of the ALT keys may also be configured +as some other modifier, such as a Compose key for typing accented characters.

+

On some keyboards, the Meta key modifier produces characters with +the eighth bit (0200) set. +You can use the enable-meta-key variable +to control whether or not it does this, if the keyboard allows it. +On many others, the terminal or terminal emulator converts the metafied +key to a key sequence beginning with ESC as described in the +next paragraph. +

If you do not have a Meta or ALT key, or another key working as -a Meta key, the identical keystroke can be generated by typing ESC +a Meta key, you can generally achieve the latter effect by typing ESC first, and then typing k. -Either process is known as metafying the k key. +The ESC character is known as the meta prefix). +

+

Either process is known as metafying the k key. +

+

If your Meta key produces a key sequence with the ESC meta prefix, +you can make M-key key bindings you specify +(see Key Bindings in Readline Init File Syntax) +do the same thing by setting the force-meta-prefix variable.

The text M-C-k is read as ‘Meta-Control-k’ and describes the -character produced by metafying C-k. +character produced by metafying C-k.

-

In addition, several keys have their own names. Specifically, +

In addition, several keys have their own names. +Specifically, DEL, ESC, LFD, SPC, RET, and TAB all stand for themselves when seen in this text, or in an init file (see Readline Init File). If your keyboard lacks a LFD key, typing C-j will -produce the desired character. +output the appropriate character. The RET key may be labeled Return or Enter on some keyboards.

@@ -230,13 +247,15 @@ Next:

Often during an interactive session you type in a long line of text, -only to notice that the first word on the line is misspelled. The -Readline library gives you a set of commands for manipulating the text +only to notice that the first word on the line is misspelled. +The Readline library gives you a set of commands for manipulating the text as you type it in, allowing you to just fix your typo, and not forcing -you to retype the majority of the line. Using these editing commands, +you to retype the majority of the line. +Using these editing commands, you move the cursor to the place that needs correction, and delete or -insert the text of the corrections. Then, when you are satisfied with -the line, you simply press RET. You do not have to be at the +insert the text of the corrections. +Then, when you are satisfied with the line, you simply press RET. +You do not have to be at the end of the line to press RET; the entire line is accepted regardless of the location of the cursor within the line.

@@ -259,23 +278,27 @@ Next: -

In order to enter characters into the line, simply type them. The typed +

In order to enter characters into the line, simply type them. +The typed character appears where the cursor was, and then the cursor moves one -space to the right. If you mistype a character, you can use your +space to the right. +If you mistype a character, you can use your erase character to back up and delete the mistyped character.

Sometimes you may mistype a character, and -not notice the error until you have typed several other characters. In -that case, you can type C-b to move the cursor to the left, and then -correct your mistake. Afterwards, you can move the cursor to the right -with C-f. +not notice the error until you have typed several other characters. +In that case, you can type C-b to move the cursor to the left, +and then correct your mistake. +Afterwards, you can move the cursor to the right with C-f.

When you add text in the middle of a line, you will notice that characters to the right of the cursor are ‘pushed over’ to make room for the text -that you have inserted. Likewise, when you delete text behind the cursor, +that you have inserted. +Likewise, when you delete text behind the cursor, characters to the right of the cursor are ‘pulled back’ to fill in the -blank space created by the removal of the text. A list of the bare -essentials for editing the text of an input line follows. +blank space created by the removal of the text. +These are the bare +essentials for editing the text of an input line:

C-b
@@ -294,15 +317,15 @@ essentials for editing the text of an input line follows.

Insert the character into the line at the cursor.

C-_ or C-x C-u
-

Undo the last editing command. You can undo all the way back to an -empty line. +

Undo the last editing command. +You can undo all the way back to an empty line.

-

(Depending on your configuration, the Backspace key might be set to +

Depending on your configuration, the Backspace key might be set to delete the character to the left of the cursor and the DEL key set to delete the character underneath the cursor, like C-d, rather -than the character to the left of the cursor.) +than the character to the left of the cursor.


@@ -313,12 +336,11 @@ Next:

-

The above table describes the most basic keystrokes that you need -in order to do editing of the input line. For your convenience, many -other commands have been added in addition to C-b, C-f, -C-d, and DEL. Here are some commands for moving more rapidly -about the line. +in order to do editing of the input line. +For your convenience, many other commands are available in +addition to C-b, C-f, C-d, and DEL. +Here are some commands for moving more rapidly within the line.

C-a
@@ -339,7 +361,8 @@ about the line.

Notice how C-f moves forward a character, while M-f moves -forward a word. It is a loose convention that control keystrokes +forward a word. +It is a loose convention that control keystrokes operate on characters while meta keystrokes operate on words.


@@ -365,8 +388,8 @@ place later.

When you use a kill command, the text is saved in a kill-ring. Any number of consecutive kills save all of the killed text together, so -that when you yank it back, you get it all. The kill -ring is not line specific; the text that you killed on a previously +that when you yank it back, you get it all. +The kill ring is not line specific; the text that you killed on a previously typed line is available to be yanked back later, when you are typing another line. @@ -391,14 +414,16 @@ Word boundaries are the same as those used by M-b.

C-w
-

Kill from the cursor to the previous whitespace. This is different than +

Kill from the cursor to the previous whitespace. +This is different than M-DEL because the word boundaries differ.

Here is how to yank the text back into the line. Yanking -means to copy the most-recently-killed text from the kill buffer. +means to copy the most-recently-killed text from the kill buffer +into the line at the current cursor position.

C-y
@@ -406,8 +431,8 @@ means to copy the most-recently-killed text from the kill buffer.

M-y
-

Rotate the kill-ring, and yank the new top. You can only do this if -the prior command is C-y or M-y. +

Rotate the kill-ring, and yank the new top. +You can only do this if the prior command is C-y or M-y.

@@ -420,18 +445,23 @@ Next:

-

You can pass numeric arguments to Readline commands. Sometimes the +

You can pass numeric arguments to Readline commands. +Sometimes the argument acts as a repeat count, other times it is the sign of the -argument that is significant. If you pass a negative argument to a +argument that is significant. +If you pass a negative argument to a command which normally acts in a forward direction, that command will -act in a backward direction. For example, to kill text back to the +act in a backward direction. +For example, to kill text back to the start of the line, you might type ‘M-- C-k’.

The general way to pass numeric arguments to a command is to type meta -digits before the command. If the first ‘digit’ typed is a minus -sign (‘-’), then the sign of the argument will be negative. Once -you have typed one meta digit to get the argument started, you can type -the remainder of the digits, and then the command. For example, to give +digits before the command. +If the first ‘digit’ typed is a minus +sign (‘-’), then the sign of the argument will be negative. +Once you have typed one meta digit to get the argument started, you can +type the remainder of the digits, and then the command. +For example, to give the C-d command an argument of 10, you could type ‘M-1 0 C-d’, which will delete the next ten characters on the input line.

@@ -454,23 +484,24 @@ As each character of the search string is typed, Readline displays the next entry from the history matching the string typed so far. An incremental search requires only as many characters as needed to find the desired history entry. -To search backward in the history for a particular string, type -C-r. Typing C-s searches forward through the history. +When using emacs editing mode, type C-r +to search backward in the history for a particular string. +Typing C-s searches forward through the history. The characters present in the value of the isearch-terminators variable are used to terminate an incremental search. If that variable has not been assigned a value, the ESC and -C-J characters will terminate an incremental search. -C-g will abort an incremental search and restore the original line. +C-j characters terminate an incremental search. +C-g aborts an incremental search and restores the original line. When the search is terminated, the history entry containing the search string becomes the current line.

To find other matching entries in the history list, type C-r or C-s as appropriate. -This will search backward or forward in the history for the next +This searches backward or forward in the history for the next entry matching the search string typed so far. -Any other key sequence bound to a Readline command will terminate -the search and execute that command. -For instance, a RET will terminate the search and accept +Any other key sequence bound to a Readline command terminates +the search and executes that command. +For instance, a RET terminates the search and accepts the line, thereby executing the command from the history list. A movement command will terminate the search, make the last line found the current line, and begin editing. @@ -480,7 +511,7 @@ If two C-rs are typed without any intervening characters a new search string, Readline uses any remembered search string.

Non-incremental searches read the entire search string before starting -to search for matching history lines. +to search for matching history entries. The search string may be typed by the user or be part of the contents of the current line.

@@ -499,16 +530,15 @@ Next:

There are only a few basic constructs allowed in the -Readline init file. Blank lines are ignored. +Readline init file. +Blank lines are ignored. Lines beginning with a ‘#’ are comments. Lines beginning with a ‘$’ indicate conditional -constructs (see Conditional Init Constructs). Other lines -denote variable settings and key bindings. +constructs (see Conditional Init Constructs). +Other lines denote variable settings and key bindings.

Variable Settings
@@ -553,8 +584,8 @@ change from the default Emacs-like key binding to use
set editing-mode vi
 
-

Variable names and values, where appropriate, are recognized without regard -to case. +

Variable names and values, where appropriate, are recognized without +regard to case. Unrecognized variable names are ignored.

Boolean variables (those that can be set to on or off) are set to on if @@ -595,8 +626,8 @@ A sample value might be ‘\e[0m’.

bell-style

Controls what happens when Readline wants to ring the terminal bell. -If set to ‘none’, Readline never rings the bell. If set to -‘visible’, Readline uses a visible bell if one is available. +If set to ‘none’, Readline never rings the bell. +If set to ‘visible’, Readline uses a visible bell if one is available. If set to ‘audible’ (the default), Readline attempts to ring the terminal’s bell.

@@ -613,8 +644,8 @@ including the special control characters (usually cchars
blink-matching-paren

If set to ‘on’, Readline attempts to briefly move the cursor to an -opening parenthesis when a closing parenthesis is inserted. The default -is ‘off’. +opening parenthesis when a closing parenthesis is inserted. +The default is ‘off’.

colored-completion-prefix
@@ -637,9 +668,9 @@ The default is ‘off’.

comment-begin
-

The string to insert at the beginning of the line when the -insert-comment command is executed. The default value -is "#". +

The string to insert at the beginning of the line by the +insert-comment command. +The default value is "#".

completion-display-width
@@ -647,7 +678,7 @@ is "#". when performing completion. The value is ignored if it is less than 0 or greater than the terminal screen width. -A value of 0 will cause matches to be displayed one per line. +A value of 0 causes matches to be displayed one per line. The default value is -1.

@@ -665,79 +696,90 @@ The default value is ‘off’.

completion-prefix-display-length
-

The length in characters of the common prefix of a list of possible -completions that is displayed without modification. When set to a -value greater than zero, common prefixes longer than this value are -replaced with an ellipsis when displaying possible completions. +

The maximum +length in characters of the common prefix of a list of possible +completions that is displayed without modification. +When set to a value greater than zero, Readline +replaces common prefixes longer than this value +with an ellipsis when displaying possible completions. +If a completion begins with a period, +and Readline is completing filenames, +it uses three underscores instead of an ellipsis.

completion-query-items
-

The number of possible completions that determines when the user is -asked whether the list of possibilities should be displayed. -If the number of possible completions is greater than or equal to this value, -Readline will ask whether or not the user wishes to view them; -otherwise, they are simply listed. +

The number of possible completions that determines when the user is asked +whether the list of possibilities should be displayed. +If the number of possible completions is greater than +or equal to this value, +Readline asks whether or not the user wishes to view them; +otherwise, Readline simply lists the completions. This variable must be set to an integer value greater than or equal to zero. -A zero value means Readline should never ask; negative values are -treated as zero. +A zero value means Readline should never ask; negative +values are treated as zero. The default limit is 100.

convert-meta
-

If set to ‘on’, Readline will convert characters with the -eighth bit set to an ASCII key sequence by stripping the eighth -bit and prefixing an ESC character, converting them to a -meta-prefixed key sequence. -The default value is ‘on’, but -will be set to ‘off’ if the locale is one that contains -eight-bit characters. +

If set to ‘on’, Readline converts characters it reads +that have the eighth bit set to an ASCII key sequence by +clearing the eighth bit and prefixing an ESC character, +converting them to a meta-prefixed key sequence. +The default value is ‘on’, but Readline sets it to ‘off’ +if the locale contains +characters whose encodings may include bytes with the eighth bit set. This variable is dependent on the LC_CTYPE locale category, and -may change if the locale is changed. +may change if the locale changes. +This variable also affects key bindings; +see the description of force-meta-prefix below.

disable-completion
-

If set to ‘On’, Readline will inhibit word completion. -Completion characters will be inserted into the line as if they had -been mapped to self-insert. The default is ‘off’. +

If set to ‘On’, Readline inhibits word completion. +Completion characters are inserted into the line as if they +had been mapped to self-insert. +The default is ‘off’.

echo-control-characters

When set to ‘on’, on operating systems that indicate they support it, Readline echoes a character corresponding to a signal generated from the -keyboard. The default is ‘on’. +keyboard. +The default is ‘on’.

editing-mode
-

The editing-mode variable controls which default set of -key bindings is used. By default, Readline starts up in Emacs editing -mode, where the keystrokes are most similar to Emacs. This variable can be -set to either ‘emacs’ or ‘vi’. +

The editing-mode variable controls the default set of +key bindings. +By default, Readline starts up in emacs editing mode, where +the keystrokes are most similar to Emacs. +This variable can be set to either ‘emacs’ or ‘vi’.

emacs-mode-string

If the show-mode-in-prompt variable is enabled, this string is displayed immediately before the last line of the primary -prompt when emacs editing mode is active. The value is expanded like a -key binding, so the standard set of meta- and control prefixes and +prompt when emacs editing mode is active. +The value is expanded like a +key binding, so the standard set of meta- and control- prefixes and backslash escape sequences is available. -Use the ‘\1’ and ‘\2’ escapes to begin and end sequences of +The ‘\1’ and ‘\2’ escapes begin and end sequences of non-printing characters, which can be used to embed a terminal control sequence into the mode string. The default is ‘@’.

-
enable-active-region
-

The point is the current cursor position, and mark refers -to a saved cursor position (see Commands For Moving). +

enable-active-region
+

point is the current cursor position, and mark refers to a +saved cursor position (see Commands For Moving). The text between the point and mark is referred to as the region. When this variable is set to ‘On’, Readline allows certain commands to designate the region as active. When the region is active, Readline highlights the text in the region using the value of the active-region-start-color, which defaults to the -string that enables -the terminal’s standout mode. +string that enables the terminal’s standout mode. The active region shows the text inserted by bracketed-paste and any -matching text found by incremental and non-incremental history searches. +matching text found by incremental and non-incremental history searches. The default is ‘On’.

@@ -746,34 +788,58 @@ The default is ‘On’. 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 bracketed paste mode; -it prevents Readline from executing any editing commands bound to key -sequences appearing in the pasted text. -The default is ‘On’. +it prevents Readline from executing any editing commands bound +to key sequences appearing in the pasted text. +The default is ‘On’.

enable-keypad
-

When set to ‘on’, Readline will try to enable the application -keypad when it is called. Some systems need this to enable the -arrow keys. The default is ‘off’. +

When set to ‘on’, Readline tries to enable the application +keypad when it is called. +Some systems need this to enable the arrow keys. +The default is ‘off’.

-
enable-meta-key
-

When set to ‘on’, Readline will try to enable any meta modifier -key the terminal claims to support when it is called. On many terminals, -the meta key is used to send eight-bit characters. +

enable-meta-key
+

When set to ‘on’, Readline tries to enable any meta +modifier key the terminal claims to support when it is called. +On many terminals, the Meta key is used to send eight-bit characters; +this variable checks for the terminal capability that indicates the +terminal can enable and disable a mode that sets the eighth bit of a +character (0200) if the Meta key is held down when the character is +typed (a meta character). The default is ‘on’.

expand-tilde
-

If set to ‘on’, tilde expansion is performed when Readline -attempts word completion. The default is ‘off’. +

If set to ‘on’, Readline attempts tilde expansion when it +attempts word completion. +The default is ‘off’. +

+
+
force-meta-prefix
+

If set to ‘on’, Readline modifies its behavior when binding key +sequences containing \M- or Meta- +(see Key Bindings in Readline Init File Syntax) +by converting a key sequence of the form +\M-C or Meta-C to the two-character sequence +ESC C (adding the meta prefix). +If force-meta-prefix is set to ‘off’ (the default), +Readline uses the value of the convert-meta variable to determine +whether to perform this conversion: +if convert-meta is ‘on’, +Readline performs the conversion described above; +if it is ‘off’, Readline converts C to a meta character by +setting the eighth bit (0200). +The default is ‘off’.

history-preserve-point

If set to ‘on’, the history code attempts to place the point (the current cursor position) at the same location on each history line retrieved with previous-history -or next-history. The default is ‘off’. +or next-history. +The default is ‘off’.

history-size
@@ -783,36 +849,37 @@ are saved. If set to a value less than zero, the number of history entries is not limited. By default, the number of history entries is not limited. -If an attempt is made to set history-size to a non-numeric value, +If you try to set history-size to a non-numeric value, the maximum number of history entries will be set to 500.

horizontal-scroll-mode
-

This variable can be set to either ‘on’ or ‘off’. Setting it -to ‘on’ means that the text of the lines being edited will scroll -horizontally on a single screen line when they are longer than the width -of the screen, instead of wrapping onto a new screen line. +

Setting this variable to ‘on’ means that the text of the lines +being edited will scroll horizontally on a single screen line when +the lines are longer than the width of the screen, instead of wrapping +onto a new screen line. This variable is automatically set to ‘on’ for terminals of height 1. By default, this variable is set to ‘off’.

input-meta
-

If set to ‘on’, Readline will enable eight-bit input (it -will not clear the eighth bit in the characters it reads), -regardless of what the terminal claims it can support. The -default value is ‘off’, but Readline will set it to ‘on’ if the -locale contains eight-bit characters. -The name meta-flag is a synonym for this variable. +

If set to ‘on’, Readline enables eight-bit input (that is, it +does not clear the eighth bit in the characters it reads), +regardless of what the terminal claims it can support. +The default value is ‘off’, but Readline sets it to ‘on’ +if the locale contains characters whose encodings may include bytes +with the eighth bit set. This variable is dependent on the LC_CTYPE locale category, and -may change if the locale is changed. +its value may change if the locale changes. +The name meta-flag is a synonym for input-meta.

isearch-terminators

The string of characters that should terminate an incremental search without subsequently executing the character as a command (see Searching for Commands in the History). If this variable has not been given a value, the characters ESC and -C-J will terminate an incremental search. +C-j terminate an incremental search.

keymap
@@ -829,43 +896,42 @@ Built-in keymap names are vi is equivalent to vi-command (vi-move is also a synonym); emacs is equivalent to emacs-standard. Applications may add additional names. -The default value is emacs. -The value of the editing-mode variable also affects the +The default value is emacs; +the value of the editing-mode variable also affects the default keymap.

keyseq-timeout
-

Specifies the duration Readline will wait for a character when reading an -ambiguous key sequence (one that can form a complete key sequence using -the input read so far, or can take additional input to complete a longer -key sequence). -If no input is received within the timeout, Readline will use the shorter -but complete key sequence. +

Specifies the duration Readline will wait for a character when +reading an ambiguous key sequence +(one that can form a complete key sequence using the input read so far, +or can take additional input to complete a longer key sequence). +If Readline doesn’t receive any input within the timeout, it uses the +shorter but complete key sequence. Readline uses this value to determine whether or not input is available on the current input source (rl_instream by default). The value is specified in milliseconds, so a value of 1000 means that Readline will wait one second for additional input. If this variable is set to a value less than or equal to zero, or to a -non-numeric value, Readline will wait until another key is pressed to +non-numeric value, Readline waits until another key is pressed to decide which key sequence to complete. The default value is 500.

mark-directories
-

If set to ‘on’, completed directory names have a slash -appended. The default is ‘on’. +

If set to ‘on’, completed directory names have a slash appended. +The default is ‘on’.

mark-modified-lines
-

This variable, when set to ‘on’, causes Readline to display an +

When this variable is set to ‘on’, Readline displays an asterisk (‘*’) at the start of history lines which have been modified. This variable is ‘off’ by default.

mark-symlinked-directories
-

If set to ‘on’, completed names which are symbolic links -to directories have a slash appended (subject to the value of -mark-directories). +

If set to ‘on’, completed names which are symbolic links to directories +have a slash appended, subject to the value of mark-directories. The default is ‘off’.

@@ -881,36 +947,45 @@ This variable is ‘on’ by default.
menu-complete-display-prefix

If set to ‘on’, menu completion displays the common prefix of the list of possible completions (which may be empty) before cycling through -the list. The default is ‘off’. +the list. +The default is ‘off’.

output-meta
-

If set to ‘on’, Readline will display characters with the +

If set to ‘on’, Readline displays characters with the eighth bit set directly rather than as a meta-prefixed escape sequence. -The default is ‘off’, but Readline will set it to ‘on’ if the -locale contains eight-bit characters. +The default is ‘off’, but Readline sets it to ‘on’ +if the locale contains characters whose encodings may include +bytes with the eighth bit set. This variable is dependent on the LC_CTYPE locale category, and -may change if the locale is changed. +its value may change if the locale changes.

page-completions
-

If set to ‘on’, Readline uses an internal more-like pager +

If set to ‘on’, Readline uses an internal pager resembling +more(1) to display a screenful of possible completions at a time. This variable is ‘on’ by default.

+
prefer-visible-bell
+

See bell-style. +

+
print-completions-horizontally
-

If set to ‘on’, Readline will display completions with matches +

If set to ‘on’, Readline displays completions with matches sorted horizontally in alphabetical order, rather than down the screen. The default is ‘off’.

revert-all-at-newline

If set to ‘on’, Readline will undo all changes to history lines -before returning when accept-line is executed. By default, +before returning when executing accept-line. +By default, history lines may be modified and retain individual undo lists across -calls to readline(). The default is ‘off’. +calls to readline(). +The default is ‘off’.

search-ignore-case
@@ -920,8 +995,8 @@ The default value is ‘off’.

show-all-if-ambiguous
-

This alters the default behavior of the completion functions. If -set to ‘on’, +

This alters the default behavior of the completion functions. +If set to ‘on’, words which have more than one possible completion cause the matches to be listed immediately instead of ringing the bell. The default value is ‘off’. @@ -947,15 +1022,15 @@ The default value is ‘off’.

skip-completed-text

If set to ‘on’, this alters the default completion behavior when -inserting a single match into the line. It’s only active when -performing completion in the middle of a word. If enabled, Readline -does not insert characters from the completion that match characters -after point in the word being completed, so portions of the word -following the cursor are not duplicated. +inserting a single match into the line. +It’s only active when performing completion in the middle of a word. +If enabled, Readline does not insert characters from the completion +that match characters after point in the word being completed, +so portions of the word following the cursor are not duplicated. For instance, if this is enabled, attempting completion when the cursor -is after the ‘e’ in ‘Makefile’ will result in ‘Makefile’ -rather than ‘Makefilefile’, assuming there is a single possible -completion. +is after the first ‘e’ in ‘Makefile’ will result in +‘Makefile’ rather than ‘Makefilefile’, +assuming there is a single possible completion. The default value is ‘off’.

@@ -963,10 +1038,9 @@ The default value is ‘off’.

If the show-mode-in-prompt variable is enabled, this string is displayed immediately before the last line of the primary prompt when vi editing mode is active and in command mode. -The value is expanded like a -key binding, so the standard set of meta- and control prefixes and -backslash escape sequences is available. -Use the ‘\1’ and ‘\2’ escapes to begin and end sequences of +The value is expanded like a key binding, so the standard set of +meta- and control- prefixes and backslash escape sequences is available. +The ‘\1’ and ‘\2’ escapes begin and end sequences of non-printing characters, which can be used to embed a terminal control sequence into the mode string. The default is ‘(cmd)’. @@ -976,10 +1050,9 @@ The default is ‘(cmd)’.

If the show-mode-in-prompt variable is enabled, this string is displayed immediately before the last line of the primary prompt when vi editing mode is active and in insertion mode. -The value is expanded like a -key binding, so the standard set of meta- and control prefixes and -backslash escape sequences is available. -Use the ‘\1’ and ‘\2’ escapes to begin and end sequences of +The value is expanded like a key binding, so the standard set of +meta- and control- prefixes and backslash escape sequences is available. +The ‘\1’ and ‘\2’ escapes begin and end sequences of non-printing characters, which can be used to embed a terminal control sequence into the mode string. The default is ‘(ins)’. @@ -988,16 +1061,18 @@ The default is ‘(ins)’.

visible-stats

If set to ‘on’, a character denoting a file’s type is appended to the filename when listing possible -completions. The default is ‘off’. +completions. +The default is ‘off’.

Key Bindings
-

The syntax for controlling key bindings in the init file is -simple. First you need to find the name of the command that you -want to change. The following sections contain tables of the command +

The syntax for controlling key bindings in the init file is simple. +First you need to find the name of the command that you +want to change. +The following sections contain tables of the command name, the default keybinding, if any, and a short description of what the command does.

@@ -1012,11 +1087,14 @@ what you find most comfortable.

In addition to command names, Readline allows keys to be bound to a string that is inserted when the key is pressed (a macro). +The difference between a macro and a command is that a macro is +enclosed in single or double quotes.

keynamefunction-name or macro
-

keyname is the name of a key spelled out in English. For example: +

keyname is the name of a key spelled out in English. +For example:

Control-u: universal-argument
 Meta-Rubout: backward-kill-word
@@ -1030,8 +1108,7 @@ Control-o: "> output"
 expressed on the right hand side (that is, to insert the text
 ‘> output’ into the line).
 

-

A number of symbolic character names are recognized while -processing this key binding syntax: +

This key binding syntax recognizes a number of symbolic character names: DEL, ESC, ESCAPE, @@ -1039,7 +1116,8 @@ processing this key binding syntax: NEWLINE, RET, RETURN, -RUBOUT, +RUBOUT +(a destructive backspace), SPACE, SPC, and @@ -1049,9 +1127,10 @@ and

"keyseq": function-name or macro

keyseq differs from keyname above in that strings denoting an entire key sequence can be specified, by placing -the key sequence in double quotes. Some GNU Emacs style key -escapes can be used, as in the following example, but the -special character names are not recognized. +the key sequence in double quotes. +Some GNU Emacs style key escapes can be used, +as in the following example, but none of the +special character names are recognized.

"\C-u": universal-argument
@@ -1073,22 +1152,24 @@ specifying key sequences:
 

\C-
-

control prefix +

A control prefix.

\M-
-

meta prefix +

Adding the meta prefix or converting the following character to a meta +character, as described above under force-meta-prefix +(see Variable Settings in Readline Init File Syntax).

\e
-

an escape character +

An escape character.

\\
-

backslash +

Backslash.

\"
-

", a double quotation mark +

", a double quotation mark.

\'
-

', a single quote or apostrophe +

', a single quote or apostrophe.

@@ -1121,19 +1202,20 @@ set of backslash escapes is available:

vertical tab

\nnn
-

the eight-bit character whose value is the octal value nnn -(one to three digits) +

The eight-bit character whose value is the octal value nnn +(one to three digits).

\xHH
-

the eight-bit character whose value is the hexadecimal value HH -(one or two hex digits) +

The eight-bit character whose value is the hexadecimal value HH +(one or two hex digits).

When entering the text of a macro, single or double quotes must be used to indicate a macro definition. Unquoted text is assumed to be a function name. -In the macro body, the backslash escapes described above are expanded. +Tthe backslash escapes described above are expanded +in the macro body. Backslash will quote any other character in the macro text, including ‘"’ and ‘'’. For example, the following binding will make ‘C-x \’ @@ -1157,13 +1239,15 @@ Next: ,

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 -of tests. There are four parser directives used. +of tests. +There are four parser directives available.

$if

The $if construct allows bindings to be made based on the editing mode, the terminal being used, or the application using -Readline. The text of the test, after any comparison operator, +Readline. +The text of the test, after any comparison operator, extends to the end of the line; unless otherwise noted, no characters are required to isolate it.

@@ -1180,11 +1264,13 @@ Readline is starting out in emacs mode.
term

The term= form may be used to include terminal-specific key bindings, perhaps to bind the key sequences output by the -terminal’s function keys. The word on the right side of the -‘=’ is tested against both the full name of the terminal and -the portion of the terminal name before the first ‘-’. This -allows sun to match both sun and sun-cmd, -for instance. +terminal’s function keys. +The word on the right side of the +‘=’ +is tested against both the full name of the terminal and the portion +of the terminal name before the first ‘-’. +This allows xterm to match both xterm and +xterm-256color, for instance.

version
@@ -1196,8 +1282,9 @@ The set of comparison operators includes and ‘>’. The version number supplied on the right side of the operator consists of a major version number, an optional decimal point, and an optional -minor version (e.g., ‘7.1’). If the minor version is omitted, it -is assumed to be ‘0’. +minor version (e.g., ‘7.1’). +If the minor version is omitted, it +defaults to ‘0’. The operator may be separated from the string version and from the version number argument by whitespace. The following example sets a variable if the Readline version being used @@ -1211,11 +1298,13 @@ $endif
application

The application construct is used to include -application-specific settings. Each program using the Readline +application-specific settings. +Each program using the Readline library sets the application name, and you can test for a particular value. This could be used to bind key sequences to functions useful for -a specific program. For instance, the following command adds a +a specific program. +For instance, the following command adds a key sequence that quotes the current or previous word in Bash:

$if Bash
@@ -1232,7 +1321,8 @@ The permitted comparison operators are ‘=’
 The variable name must be separated from the comparison operator by
 whitespace; the operator may be separated from the value on the right hand
 side by whitespace.
-Both string and boolean variables may be tested. Boolean variables must be
+String and boolean variables may be tested.
+Boolean variables must be
 tested against the values on and off.
 The following example is equivalent to the mode=emacs test described
 above:
@@ -1244,20 +1334,20 @@ $endif
 
- -
$endif
-

This command, as seen in the previous example, terminates an -$if command. -

$else

Commands in this branch of the $if directive are executed if the test fails.

+
$endif
+

This command, as seen in the previous example, terminates an +$if command. +

+
$include

This directive takes a single filename as an argument and reads commands -and bindings from that file. +and key bindings from that file. For example, the following directive reads from /etc/inputrc:

$include /etc/inputrc
@@ -1398,6 +1488,12 @@ Command names without an accompanying key sequence are unbound by default.
 position, and mark refers to a cursor position saved by the
 set-mark command.
 The text between the point and mark is referred to as the region.
+Readline has the concept of an active region:
+when the region is active,
+Readline redisplay highlights the region using the
+value of the active-region-start-color variable.
+The enable-active-region variable turns this on and off.
+Several commands set the region to active; those are noted below.
 

  • Commands For Moving
  • @@ -1419,18 +1515,22 @@ Next:
    beginning-of-line (C-a)

    Move to the start of the current line. +This may also be bound to the Home key on some keyboards.

    end-of-line (C-e)

    Move to the end of the line. +This may also be bound to the End key on some keyboards.

    forward-char (C-f)

    Move forward a character. +This may also be bound to the right arrow key on some keyboards.

    backward-char (C-b)

    Move back a character. +This may also be bound to the left arrow key on some keyboards.

    forward-word (M-f)
    @@ -1446,14 +1546,16 @@ Words are composed of letters and digits.
previous-screen-line ()

Attempt to move point to the same physical screen column on the previous -physical screen line. This will not have the desired effect if the current +physical screen line. +This will not have the desired effect if the current Readline line does not take up more than one physical line or if point is not greater than the length of the prompt plus the screen width.

next-screen-line ()

Attempt to move point to the same physical screen column on the next -physical screen line. This will not have the desired effect if the current +physical screen line. +This will not have the desired effect if the current 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. @@ -1489,19 +1591,20 @@ Next:

accept-line (Newline or Return)

Accept the line regardless of where the cursor is. -If this line is -non-empty, it may be added to the history list for future recall with +If this line is non-empty, you can add it to the history list using add_history(). -If this line is a modified history line, the history line is restored +If this line is a modified history line, then restore the history line to its original state.

previous-history (C-p)

Move ‘back’ through the history list, fetching the previous command. +This may also be bound to the up arrow key on some keyboards.

next-history (C-n)

Move ‘forward’ through the history list, fetching the next command. +This may also be bound to the down arrow key on some keyboards.

beginning-of-history (M-<)
@@ -1515,14 +1618,16 @@ being entered.
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. +the history as necessary. +This is an incremental search. +This command sets the region to the matched text and activates the region.

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. +the history as necessary. +This is an incremental search. +This command sets the region to the matched text and activates the region.

non-incremental-reverse-search-history (M-p)
@@ -1539,32 +1644,34 @@ for a string supplied by the user. The search string may match anywhere in a history line.

-
history-search-forward ()
-

Search forward through the history for the string of characters +

history-search-backward ()
+

Search backward through the history for the string of characters between the start of the current line and the point. The search string must match at the beginning of a history line. This is a non-incremental search. -By default, this command is unbound. +By default, this command is unbound, but may be bound to the Page Down +key on some keyboards.

-
history-search-backward ()
-

Search backward through the history for the string of characters +

history-search-forward ()
+

Search forward through the history for the string of characters between the start of the current line and the point. The search string must match at the beginning of a history line. This is a non-incremental search. -By default, this command is unbound. +By default, this command is unbound, but may be bound to the Page Up +key on some keyboards.

-
history-substring-search-forward ()
-

Search forward through the history for the string of characters +

history-substring-search-backward ()
+

Search backward through the history for the string of characters between the start of the current line and the point. The search string may match anywhere in a history line. This is a non-incremental search. By default, this command is unbound.

-
history-substring-search-backward ()
-

Search backward through the history for the string of characters +

history-substring-search-forward ()
+

Search forward through the history for the string of characters between the start of the current line and the point. The search string may match anywhere in a history line. This is a non-incremental search. @@ -1576,10 +1683,13 @@ By default, this command is unbound. the second word on the previous line) at point. With an argument n, insert the nth word from the previous command (the words -in the previous command begin with word 0). A negative argument -inserts the nth word from the end of the previous command. -Once the argument n is computed, the argument is extracted -as if the ‘!n’ history expansion had been specified. +in the previous command begin with word 0). +A negative argument inserts the nth word from the end of +the previous command. +Once the argument n is computed, +this uses the history expansion facilities to extract the +nth word, as if the +‘!n’ history expansion had been specified.

yank-last-arg (M-. or M-_)
@@ -1590,10 +1700,12 @@ Successive calls to yank-last-arg move back through th list, inserting the last word (or the word specified by the argument to the first call) of each line in turn. Any numeric argument supplied to these successive calls determines -the direction to move through the history. A negative argument switches -the direction through the history (back or forward). -The history expansion facilities are used to extract the last argument, -as if the ‘!$’ history expansion had been specified. +the direction to move through the history. +A negative argument switches the direction through the history +(back or forward). +This uses the history expansion facilities to extract the +last word, as if the +‘!$’ history expansion had been specified.

operate-and-get-next (C-o)
@@ -1601,8 +1713,8 @@ as if the ‘!$’ history expansion had been newline had been entered, and fetch the next line relative to the current line from the history for editing. -A numeric argument, if supplied, specifies the history entry to use instead -of the current line. +A numeric argument, if supplied, specifies the history entry +to use instead of the current line.

fetch-history ()
@@ -1625,31 +1737,37 @@ Next:
end-of-file (usually C-d)

The character indicating end-of-file as set, for example, by -stty. If this character is read when there are no characters +stty. +If this character is read when there are no characters on the line, and point is at the beginning of the line, Readline interprets it as the end of input and returns EOF.

delete-char (C-d)
-

Delete the character at point. If this function is bound to the +

Delete the character at point. +If this function is bound to the same character as the tty EOF character, as C-d commonly is, see above for the effects. +This may also be bound to the Delete key on some keyboards.

backward-delete-char (Rubout)
-

Delete the character behind the cursor. A numeric argument means -to kill the characters instead of deleting them. +

Delete the character behind the cursor. +A numeric argument means +to kill the characters, saving them on the kill ring, +instead of deleting them.

forward-backward-delete-char ()

Delete the character under the cursor, unless the cursor is at the end of the line, in which case the character behind the cursor is -deleted. By default, this is not bound to a key. +deleted. +By default, this is not bound to a key.

quoted-insert (C-q or C-v)
-

Add the next character typed to the line verbatim. This is -how to insert key sequences like C-q, for example. +

Add the next character typed to the line verbatim. +This is how to insert key sequences like C-q, for example.

tab-insert (M-TAB)
@@ -1657,27 +1775,28 @@ how to insert key sequences like C-q, for example.

self-insert (a, b, A, 1, !, …)
-

Insert yourself. +

Insert the character typed.

bracketed-paste-begin ()

This function is intended to be bound to the "bracketed paste" escape sequence sent by some terminals, and such a binding is assigned by default. It allows Readline to insert the pasted text as a single unit without treating -each character as if it had been read from the keyboard. The characters +each character as if it had been read from the keyboard. +The characters are inserted as if each one was bound to 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 active mark: when the -mark is active, Readline redisplay uses the terminal’s standout mode to -denote the region. +to the inserted text. +It sets the active region.

transpose-chars (C-t)

Drag the character before the cursor forward over the character at the cursor, moving the -cursor forward as well. If the insertion point +cursor forward as well. +If the insertion point is at the end of the line, then this transposes the last two characters of the line. Negative arguments have no effect. @@ -1692,25 +1811,29 @@ the last two words on the line.

upcase-word (M-u)
-

Uppercase the current (or following) word. With a negative argument, +

Uppercase the current (or following) word. +With a negative argument, uppercase the previous word, but do not move the cursor.

downcase-word (M-l)
-

Lowercase the current (or following) word. With a negative argument, +

Lowercase the current (or following) word. +With a negative argument, lowercase the previous word, but do not move the cursor.

capitalize-word (M-c)
-

Capitalize the current (or following) word. With a negative argument, +

Capitalize the current (or following) word. +With a negative argument, capitalize the previous word, but do not move the cursor.

overwrite-mode ()
-

Toggle overwrite mode. With an explicit positive numeric argument, -switches to overwrite mode. With an explicit non-positive numeric -argument, switches to insert mode. This command affects only -emacs mode; vi mode does overwrite differently. +

Toggle overwrite mode. +With an explicit positive numeric argument, switches to overwrite mode. +With an explicit non-positive numeric argument, switches to insert mode. +This command affects only emacs mode; +vi mode does overwrite differently. Each call to readline() starts in insert mode.

In overwrite mode, characters bound to self-insert replace @@ -1718,7 +1841,8 @@ the text at point rather than pushing the text to the right. Characters bound to backward-delete-char replace the character before point with a space.

-

By default, this command is unbound. +

By default, this command is unbound, but may be bound to the Insert +key on some keyboards.

@@ -1734,15 +1858,15 @@ Next:
kill-line (C-k)
-

Kill the text from point to the end of the line. +

Kill the text from point to the end of the current line. With a negative numeric argument, kill backward from the cursor to the -beginning of the current line. +beginning of the line.

backward-kill-line (C-x Rubout)

Kill backward from the cursor to the beginning of the current line. With a negative numeric argument, kill forward from the cursor to the -end of the current line. +end of the line.

unix-line-discard (C-u)
@@ -1767,18 +1891,19 @@ Word boundaries are the same as backward-word.
unix-word-rubout (C-w)
-

Kill the word behind point, using white space as a word boundary. -The killed text is saved on the kill-ring. +

Kill the word behind point, using white space as a word boundary, +saving the killed text on the kill-ring.

unix-filename-rubout ()

Kill the word behind point, using white space and the slash character -as the word boundaries. -The killed text is saved on the kill-ring. +as the word boundaries, +saving the killed text on the kill-ring.

delete-horizontal-space ()
-

Delete all spaces and tabs around point. By default, this is unbound. +

Delete all spaces and tabs around point. +By default, this is unbound.

kill-region ()
@@ -1788,7 +1913,8 @@ By default, this command is unbound.
copy-region-as-kill ()

Copy the text in the region to the kill buffer, so it can be yanked -right away. By default, this command is unbound. +right away. +By default, this command is unbound.

copy-backward-word ()
@@ -1808,7 +1934,8 @@ By default, this command is unbound.

yank-pop (M-y)
-

Rotate the kill-ring, and yank the new top. You can only do this if +

Rotate the kill-ring, and yank the new top. +You can only do this if the prior command is yank or yank-pop.

@@ -1824,7 +1951,8 @@ Next:
digit-argument (M-0, M-1, … M--)

Add this digit to the argument already accumulating, or start a new -argument. M-- starts a negative argument. +argument. +M-- starts a negative argument.

universal-argument ()
@@ -1868,20 +1996,21 @@ the environment variable COLUMNS, or the screen width,
insert-completions (M-*)

Insert all completions of the text before point that would have -been generated by possible-completions. +been generated by possible-completions, +separated by a space.

menu-complete ()

Similar to complete, but replaces the word to be completed with a single match from the list of possible completions. -Repeated execution of menu-complete steps through the list +Repeatedly executing menu-complete steps through the list of possible completions, inserting each match in turn. -At the end of the list of completions, the bell is rung +At the end of the list of completions, +menu-complete rings the bell (subject to the setting of bell-style) -and the original text is restored. +and restores the original text. An argument of n moves n positions forward in the list -of matches; a negative argument may be used to move backward -through the list. +of matches; a negative argument moves backward through the list. This command is intended to be bound to TAB, but is unbound by default.

@@ -1890,13 +2019,42 @@ by default.

Identical to menu-complete, but moves backward through the list of possible completions, as if menu-complete had been given a negative argument. +This command is unbound by default. +

+
+
export-completions ()
+

Perform completion on the word before point as described above +and write the list of possible completions to Readline’s output stream +using the following format, writing information on separate lines: +

+
    +
  • the number of matches N; +
  • the word being completed; +
  • S:E, +where S and E are the start and end offsets of the word +in the Readline line buffer; then +
  • each match, one per line +
+ +

If there are no matches, the first line will be “0”, +and this command does not print any output after the S:E. +If there is only a single match, this prints a single line containing it. +If there is more than one match, this prints the common prefix of the +matches, which may be empty, on the first line after the S:E, +then the matches on subsequent lines. +In this case, N will include the first line with the common prefix. +

+

The user or application +should be able to accommodate the possibility of a blank line. +The intent is that the user or application reads N lines after +the line containing S:E to obtain the match list. +This command is unbound by default.

delete-char-or-list ()

Deletes the character under the cursor if not at the beginning or end of the line (like delete-char). -If at the end of the line, behaves identically to -possible-completions. +At the end of the line, it behaves identically to possible-completions. This command is unbound by default.

@@ -1959,9 +2117,8 @@ The behavior is undefined if x is already lower case.

prefix-meta (ESC)
-

Metafy the next character typed. This is for keyboards -without a meta key. Typing ‘ESC f’ is equivalent to typing -M-f. +

Metafy the next character typed. +Typing ‘ESC f’ is equivalent to typing M-f.

undo (C-_ or C-x C-u)
@@ -1969,8 +2126,9 @@ without a meta key. Typing ‘ESC

revert-line (M-r)
-

Undo all changes made to this line. This is like executing the undo -command enough times to get back to the beginning. +

Undo all changes made to this line. +This is like executing the undo +command enough times to get back to the initial state.

tilde-expand (M-~)
@@ -1978,66 +2136,83 @@ command enough times to get back to the beginning.

set-mark (C-@)
-

Set the mark to the point. If a -numeric argument is supplied, the mark is set to that position. +

Set the mark to the point. +If a numeric argument is supplied, set the mark to that position.

exchange-point-and-mark (C-x C-x)
-

Swap the point with the mark. The current cursor position is set to -the saved position, and the old cursor position is saved as the mark. +

Swap the point with the mark. +Set the current cursor position to the saved position, +then set the mark to the old cursor position.

character-search (C-])
-

A character is read and point is moved to the next occurrence of that -character. A negative argument searches for previous occurrences. +

Read a character and move point to the next occurrence of that character. +A negative argument searches for previous occurrences.

character-search-backward (M-C-])
-

A character is read and point is moved to the previous occurrence -of that character. A negative argument searches for subsequent -occurrences. +

Read a character and move point to the previous occurrence of that character. +A negative argument searches for subsequent occurrences.

skip-csi-sequence ()

Read enough characters to consume a multi-key sequence such as those -defined for keys like Home and End. Such sequences begin with a -Control Sequence Indicator (CSI), usually ESC-[. If this sequence is -bound to "\e[", keys producing such sequences will have no effect -unless explicitly bound to a Readline command, instead of inserting -stray characters into the editing buffer. This is unbound by default, -but usually bound to ESC-[. +defined for keys like Home and End. +CSI sequences begin with a Control Sequence Indicator (CSI), usually +ESC [. +If this sequence is bound to "\e[", +keys producing CSI sequences have no effect +unless explicitly bound to a Readline command, +instead of inserting stray characters into the editing buffer. +This is unbound by default, but usually bound to +ESC [.

insert-comment (M-#)
-

Without a numeric argument, the value of the comment-begin -variable is inserted at the beginning of the current line. +

Without a numeric argument, insert the value of the comment-begin +variable at the beginning of the current line. If a numeric argument is supplied, this command acts as a toggle: if the characters at the beginning of the line do not match the value -of comment-begin, the value is inserted, otherwise -the characters in comment-begin are deleted from the beginning of -the line. +of comment-begin, insert the value; otherwise delete +the characters in comment-begin from the beginning of the line. In either case, the line is accepted as if a newline had been typed.

dump-functions ()
-

Print all of the functions and their key bindings to the -Readline output stream. If a numeric argument is supplied, +

Print all of the functions and their key bindings +to the Readline output stream. +If a numeric argument is supplied, the output is formatted in such a way that it can be made part -of an inputrc file. This command is unbound by default. +of an inputrc file. +This command is unbound by default.

dump-variables ()
-

Print all of the settable variables and their values to the -Readline output stream. If a numeric argument is supplied, +

Print all of the settable variables and their values +to the Readline output stream. +If a numeric argument is supplied, the output is formatted in such a way that it can be made part -of an inputrc file. This command is unbound by default. +of an inputrc file. +This command is unbound by default.

dump-macros ()

Print all of the Readline key sequences bound to macros and the -strings they output. If a numeric argument is supplied, +strings they output +to the Readline output stream. +If a numeric argument is supplied, the output is formatted in such a way that it can be made part -of an inputrc file. This command is unbound by default. +of an inputrc file. +This command is unbound by default. +

+
+
execute-named-command (M-x)
+

Read a bindable Readline command name from the input and execute the +function to which it’s bound, as if the key sequence to which it was +bound appeared in the input. +If this function is supplied with a numeric argument, it passes that +argument to the function it executes.

@@ -2051,14 +2226,6 @@ editing mode. editing mode.

- -
execute-named-command (M-x)
-

Read a bindable readline command name from the input and execute the -function to which it’s bound, as if the key sequence to which it was -bound appeared in the input. -If this function is supplied with a numeric argument, it passes that -argument to the function it executes. -

@@ -2074,8 +2241,9 @@ Previous:

,

2.1 Basic Behavior

Many programs provide a command line interface, such as mail, -ftp, and sh. For such programs, the default behaviour of -Readline is sufficient. This section describes how to use Readline in +ftp, and sh. +For such programs, the default behaviour of Readline is sufficient. +This section describes how to use Readline in the simplest way possible, perhaps to replace calls in your code to -gets() or fgets(). +fgets().

@@ -2138,8 +2307,9 @@ and then reads and returns a single line of text from the user. Since it’s possible to enter characters into the line while quoting them to disable any Readline editing function they might normally have, this line may include embedded newlines and other special characters. -If prompt is NULL or the empty string, no prompt is displayed. -The line readline returns is allocated with malloc(); +If prompt is NULL or the empty string, +readline() does not display a prompt. +The line readline() returns is allocated with malloc(); the caller should free() the line when it has finished with it. The declaration for readline in ANSI C is

@@ -2154,13 +2324,16 @@ The declaration for readline in ANSI C is

in order to read a line of text from the user. The line returned has the final newline removed, so only the text remains. +This means that lines consisting of a newline return the empty string.

-

If readline encounters an EOF while reading the line, and the -line is empty at that point, then (char *)NULL is returned. +

If Readline encounters an EOF while reading the line, +and the line is empty at that point, +then readline() returns (char *)NULL. Otherwise, the line is ended just as if a newline had been typed.

Readline performs some expansion on the prompt before it is -displayed on the screen. See the description of rl_expand_prompt +displayed on the screen. +See the description of rl_expand_prompt (see Redisplay) for additional details, especially if prompt will contain characters that do not consume physical screen space when displayed. @@ -2176,8 +2349,8 @@ line away in a history list of such lines.

For full details on the GNU History Library, see the associated manual.

It is preferable to avoid saving empty lines on the history list, since -users rarely have a burning need to reuse a blank line. Here is -a function which usefully replaces the standard gets() library +users rarely have a burning need to reuse a blank line. +Here is a function which usefully replaces the standard gets() library function, and has the advantage of no static buffer to overflow:

@@ -2210,8 +2383,9 @@ rl_gets ()

This function gives the user the default behaviour of TAB -completion: completion on file names. If you do not want Readline to -complete on filenames, you can change the binding of the TAB key +completion: filename completion. +If you do not want Readline to +complete filenames, you can change the binding of the TAB key with rl_bind_key().

@@ -2220,8 +2394,8 @@ with rl_bind_key().

rl_bind_key() takes two arguments: key is the character that you want to bind, and function is the address of the function to -call when key is pressed. Binding TAB to rl_insert() -makes TAB insert itself. +call when key is pressed. +Binding TAB to rl_insert() makes TAB insert itself. rl_bind_key() returns non-zero if key is not a valid ASCII character code (between 0 and 255).

@@ -2246,21 +2420,25 @@ Next:
-

This is the line gathered so far. You are welcome to modify the -contents of the line, but see Allowing Undoing. The -function rl_extend_line_buffer is available to increase +

This is the line gathered so far. +You are welcome to modify the contents of the line, +but see Allowing Undoing. +The function rl_extend_line_buffer will increase the memory allocated to rl_line_buffer.

@@ -2390,15 +2574,17 @@ the memory allocated to rl_line_buffer.
Variable: int rl_end
-

The number of characters present in rl_line_buffer. When -rl_point is at the end of the line, rl_point and -rl_end are equal. +

The number of characters present in rl_line_buffer. +When rl_point is at the end of the line, +rl_point and rl_end are equal.

Variable: int rl_mark
-

The mark (saved position) in the current line. If set, the mark -and point define a region. +

The mark (saved position) in the current line. +If set, the mark and point define a region. +Some Readline commands set the mark as part of operating; +users can also set the mark explicitly.

@@ -2411,8 +2597,9 @@ to accept-line and is about to return the line to the
Variable: int rl_eof_found
-

Readline will set this variable when it has read an EOF character (e.g., the -stty ‘EOF’ character) on an empty line or encountered a read error and +

Readline will set this variable when it has read an EOF character +(e.g., the stty ‘EOF’ character) on an empty line +or has encountered a read error or EOF and is about to return a NULL line to the caller.

@@ -2425,14 +2612,15 @@ than reading up to a character bound to accept-line.
Variable: int rl_pending_input
-

Setting this to a value makes it the next keystroke read. This is a -way to stuff a single character into the input stream. +

Setting this to a value makes it the next keystroke read. +This is a way to stuff a single character into the input stream.

Variable: int rl_dispatching

Set to a non-zero value if a function is being called from a key binding; -zero otherwise. Application functions can test this to discover whether +zero otherwise. +Application functions can test this to discover whether they were called directly or by Readline’s dispatching mechanism.

@@ -2440,21 +2628,25 @@ they were called directly or by Readline’s dispatching mechanism.
Variable: int rl_erase_empty_line

Setting this to a non-zero value causes Readline to completely erase the current line, including any prompt, any time a newline is typed as -the only character on an otherwise-empty line. The cursor is moved to -the beginning of the newly-blank line. +the only character on an otherwise-empty line. +This moves the cursor to the beginning of the newly-blank line.

Variable: char * rl_prompt
-

The prompt Readline uses. This is set from the argument to +

The prompt Readline uses. +This is set from the argument to readline(), and should not be assigned to directly. The rl_set_prompt() function (see Redisplay) may be used to modify the prompt string after calling readline(). +Readline performs some prompt expansions and analyzes the prompt for +line breaks, so rl_set_prompt() is preferred.

Variable: char * rl_display_prompt
-

The string displayed as the prompt. This is usually identical to +

The string displayed as the prompt. +This is usually identical to rl_prompt, but may be changed temporarily by functions that use the prompt string as a message area, such as incremental search.

@@ -2472,14 +2664,16 @@ never sets it.
Variable: const char * rl_library_version
-

The version number of this revision of the library. +

The version number of this revision of the Readline library, as a string +(e.g., "4.2").

Variable: int rl_readline_version
-

An integer encoding the current version of the library. The encoding is -of the form 0xMMmm, where MM is the two-digit major version -number, and mm is the two-digit minor version number. +

An integer encoding the current version of the library. +The encoding is of the form 0xMMmm, +where MM is the two-digit major version number, +and mm is the two-digit minor version number. For example, for Readline-4.2, rl_readline_version would have the value 0x0402.

@@ -2492,9 +2686,12 @@ emulation.
Variable: const char * rl_terminal_name
-

The terminal type, used for initialization. If not set by the application, +

The terminal type, used for initialization. +If not set by the application, Readline sets this to the value of the TERM environment variable the first time it is called. +Readline uses this to look up the terminal capabilities it needs in +the terminfo database.

@@ -2525,21 +2722,21 @@ from the kernel when computing the screen dimensions.
Variable: rl_command_func_t * rl_last_func
-

The address of the last command function Readline executed. May be used to -test whether or not a function is being executed twice in succession, for -example. +

The address of the last command function Readline executed. +This may be used to test whether or not a function is being executed +twice in succession, for example.

Variable: rl_hook_func_t * rl_startup_hook

If non-zero, this is the address of a function to call just -before readline prints the first prompt. +before Readline prints the first prompt.

Variable: rl_hook_func_t * rl_pre_input_hook

If non-zero, this is the address of a function to call after -the first prompt has been printed and just before readline +the first prompt has been printed and just before Readline starts reading input characters.

@@ -2554,9 +2751,9 @@ is no keyboard input.
Variable: rl_getc_func_t * rl_getc_function

If non-zero, Readline will call indirectly through this pointer -to get a character from the input stream. By default, it is set to -rl_getc, the default Readline character input function -(see Character Input). +to get a character from the input stream. +By default, it is set to rl_getc, the Readline character +input function (see Character Input). In general, an application that sets rl_getc_function should consider setting rl_input_available_hook as well.

@@ -2564,7 +2761,7 @@ setting rl_input_available_hook as well.
Variable: rl_hook_func_t * rl_signal_event_hook

If non-zero, this is the address of a function to call if a read system -call is interrupted when Readline is reading terminal input. +call is interrupted by a signal when Readline is reading terminal input.

@@ -2600,7 +2797,7 @@ setting rl_input_available_hook as well.
Variable: rl_voidfunc_t * rl_redisplay_function
-

If non-zero, Readline will call indirectly through this pointer +

Readline will call indirectly through this pointer to update the display with the current contents of the editing buffer. By default, it is set to rl_redisplay, the default Readline redisplay function (see Redisplay). @@ -2609,7 +2806,8 @@ redisplay function (see Redisplay).

Variable: rl_vintfunc_t * rl_prep_term_function

If non-zero, Readline will call indirectly through this pointer -to initialize the terminal. The function takes a single argument, an +to initialize the terminal. +The function takes a single argument, an int flag that says whether or not to use eight-bit characters. By default, this is set to rl_prep_terminal (see Terminal Management). @@ -2618,8 +2816,8 @@ By default, this is set to rl_prep_terminal

Variable: rl_voidfunc_t * rl_deprep_term_function

If non-zero, Readline will call indirectly through this pointer -to reset the terminal. This function should undo the effects of -rl_prep_term_function. +to reset the terminal. +This function should undo the effects of rl_prep_term_function. By default, this is set to rl_deprep_terminal (see Terminal Management).

@@ -2671,8 +2869,10 @@ Readline function.
Variable: int rl_readline_state

A variable with bit values that encapsulate the current Readline state. A bit is set with the RL_SETSTATE macro, and unset with the -RL_UNSETSTATE macro. Use the RL_ISSTATE macro to test -whether a particular state bit is set. Current state bits include: +RL_UNSETSTATE macro. +Use the RL_ISSTATE macro to test whether a particular state +bit is set. +Current state bits include:

RL_STATE_NONE
@@ -2725,7 +2925,7 @@ macro.

Readline is performing word completion.

RL_STATE_SIGHANDLER
-

Readline is currently executing the readline signal handler. +

Readline is currently executing the Readline signal handler.

RL_STATE_UNDOING

Readline is performing an undo. @@ -2761,7 +2961,8 @@ elapsed) and is returning that status to the caller.

RL_STATE_EOF

Readline has read an EOF character (e.g., the stty ‘EOF’ character) -or encountered a read error and is about to return a NULL line to the caller. +or encountered a read error or EOF +and is about to return a NULL line to the caller.

@@ -2770,24 +2971,25 @@ or encountered a read error and is about to return a NULL line to the caller.
Variable: int rl_explicit_arg

Set to a non-zero value if an explicit numeric argument was specified by -the user. Only valid in a bindable command function. +the user. +It is only valid in a bindable command function.

Variable: int rl_numeric_arg

Set to the value of any numeric argument explicitly specified by the user -before executing the current Readline function. Only valid in a bindable -command function. +before executing the current Readline function. +It is only valid in a bindable command function.

Variable: int rl_editing_mode
-

Set to a value denoting Readline’s current editing mode. A value of -1 means Readline is currently in emacs mode; 0 -means that vi mode is active. +

Set to a value denoting Readline’s current editing mode. +A value of 1 means Readline is currently in emacs mode; +0 means that vi mode is active. +This determines the current keymap and key bindings.

-
@@ -2822,24 +3024,29 @@ Next: , Up:

2.4.1 Naming a Function

-

The user can dynamically change the bindings of keys while using -Readline. This is done by representing the function with a descriptive -name. The user is able to type the descriptive name when referring to -the function. Thus, in an init file, one might find +

Readline has a descriptive +string name for every function a user can bind to a key sequence, +so users can dynamically change the bindings associated with key +sequences while using Readline, +using the descriptive name when referring to the function. +Thus, in an init file, one might find

Meta-Rubout:	backward-kill-word
 

This binds the keystroke Meta-Rubout to the function -descriptively named backward-kill-word. You, as the -programmer, should bind the functions you write to descriptive names as -well. Readline provides a function for doing that: +descriptively named backward-kill-word. +As the programmer, you +should bind the functions you write to descriptive names as well. +Readline provides a function for doing that:

Function: int rl_add_defun (const char *name, rl_command_func_t *function, int key)
-

Add name to the list of named functions. Make function be -the function that gets called. If key is not -1, then bind it to +

Add name to the list of named functions. +Make function be the function that gets called by key sequences +that bind to name. +If key is not -1, then bind it to function using rl_bind_key().

@@ -2858,14 +3065,16 @@ Next: , Previou

2.4.2 Selecting a Keymap

-

Key bindings take place on a keymap. The keymap is the -association between the keys that the user types and the functions that -get run. You can make your own keymaps, copy existing keymaps, and tell +

Key bindings take place on a keymap. +The keymap is the association between the keys that the user types and +the functions that get run. +You can make your own keymaps, copy existing keymaps, and tell Readline which keymap to use.

Function: Keymap rl_make_bare_keymap (void)
-

Returns a new, empty keymap. The space for the keymap is allocated with +

Returns a new, empty keymap. +The space for the keymap is allocated with malloc(); the caller should free it by calling rl_free_keymap() when done.

@@ -2890,8 +3099,9 @@ The caller should free keymap.
Function: void rl_free_keymap (Keymap keymap)
-

Free all storage associated with keymap. This calls -rl_discard_keymap to free subordindate keymaps and macros. +

Free all storage associated with keymap. +This calls rl_discard_keymap to free subordindate +keymaps and macros.

@@ -2900,8 +3110,9 @@ The caller should free keymap. zero if there are any keys bound.

-

Readline has several internal keymaps. These functions allow you to -change which keymap is active. +

Readline has several internal keymaps. +These functions allow you to change which keymap is active. +This is one way to switch editing modes, for example.

Function: Keymap rl_get_keymap (void)
@@ -2915,19 +3126,22 @@ change which keymap is active.
Function: Keymap rl_get_keymap_by_name (const char *name)
-

Return the keymap matching name. name is one which would -be supplied in a set keymap inputrc line (see Readline Init File). +

Return the keymap matching name. +name is one which would be supplied in a +set keymap inputrc line (see Readline Init File).

Function: char * rl_get_keymap_name (Keymap keymap)
-

Return the name matching keymap. name is one which would -be supplied in a set keymap inputrc line (see Readline Init File). +

Return the name matching keymap. +name is one which would be supplied in a +set keymap inputrc line (see Readline Init File).

Function: int rl_set_keymap_name (const char *name, Keymap keymap)
-

Set the name of keymap. This name will then be "registered" and +

Set the name of keymap. +This name will then be "registered" and available for use in a set keymap inputrc directive see Readline Init File). The name may not be one of Readline’s builtin keymap names; @@ -2953,7 +3167,7 @@ Next: 2.4.3 Binding Keys -

Key sequences are associate with functions through the keymap. +

Key sequences are associated with functions through the keymap. Readline has several internal keymaps: emacs_standard_keymap, emacs_meta_keymap, emacs_ctlx_keymap, vi_movement_keymap, and vi_insertion_keymap. @@ -2963,7 +3177,8 @@ this manual assume that.

Since readline() installs a set of default key bindings the first time it is called, there is always the danger that a custom binding installed before the first call to readline() will be overridden. -An alternate mechanism is to install custom key bindings in an +An alternate mechanism that can avoid this +is to install custom key bindings in an initialization function assigned to the rl_startup_hook variable (see Readline Variables).

@@ -2999,12 +3214,14 @@ already bound.
Function: int rl_unbind_key (int key)

Bind key to the null function in the currently active keymap. +This is not the same as binding it to self-insert. Returns non-zero in case of error.

Function: int rl_unbind_key_in_map (int key, Keymap map)

Bind key to the null function in map. +This is not the same as binding it to self-insert. Returns non-zero in case of error.

@@ -3029,7 +3246,8 @@ The return value is non-zero if keyseq is invalid.
Function: int rl_bind_keyseq_in_map (const char *keyseq, rl_command_func_t *function, Keymap map)

Bind the key sequence represented by the string keyseq to the function -function. This makes new keymaps as necessary. +function in map. +This makes new keymaps as necessary. Initial bindings are performed in map. The return value is non-zero if keyseq is invalid.

@@ -3057,10 +3275,14 @@ already bound.
Function: int rl_generic_bind (int type, const char *keyseq, char *data, Keymap map)

Bind the key sequence represented by the string keyseq to the arbitrary -pointer data. type says what kind of data is pointed to by -data; this can be a function (ISFUNC), a macro -(ISMACR), or a keymap (ISKMAP). This makes new keymaps as -necessary. The initial keymap in which to do bindings is map. +pointer data. +type says what kind of data is pointed to by data; this can be +a function (ISFUNC), +a macro (ISMACR), +or a keymap (ISKMAP). +This makes new keymaps as necessary. +The initial keymap in which to do bindings is map. +Returns non-zero in the case of an invalid keyseq, zero otherwise.

@@ -3086,31 +3308,34 @@ Next: ,

2.4.4 Associating Function Names and Bindings

These functions allow you to find out what keys invoke named functions -and the functions invoked by a particular key sequence. You may also -associate a new function name with an arbitrary function. +and the functions invoked by a particular key sequence. +You may also associate a new function name with an arbitrary function.

Function: rl_command_func_t * rl_named_function (const char *name)

Return the function with name name. +name is a descriptive name users might use in a key binding.

Function: rl_command_func_t * rl_function_of_keyseq (const char *keyseq, Keymap map, int *type)

Return the function invoked by keyseq in keymap map. -If map is NULL, the current keymap is used. If type is -not NULL, the type of the object is returned in the int variable -it points to (one of ISFUNC, ISKMAP, or ISMACR). -It takes a "translated" key sequence and should not be used if the key sequence -can include NUL. +If map is NULL, this uses the current keymap. +If type is not NULL, this returns the type of the object +in the int variable it points to +(one of ISFUNC, ISKMAP, or ISMACR). +It takes a "translated" key sequence and should not be used +if the key sequence can include NUL.

Function: rl_command_func_t * rl_function_of_keyseq_len (const char *keyseq, size_t len, Keymap map, int *type)

Return the function invoked by keyseq of length len -in keymap map. Equivalent to rl_function_of_keyseq with the -addition of the len parameter. -It takes a "translated" key sequence and should be used if the key sequence -can include NUL. +in keymap map. +Equivalent to rl_function_of_keyseq with the addition +of the len parameter. +It takes a "translated" key sequence and should be used +if the key sequence can include NUL.

@@ -3119,7 +3344,7 @@ can include NUL. including digits, return the index of the first character in keyseq following the numeric argument. This can be used to skip over the numeric argument (which is available as -rl_numeric_arg while traversing the key sequence that invoked the +rl_numeric_arg) while traversing the key sequence that invoked the current command.

@@ -3142,7 +3367,7 @@ keymap map. If map is NULL, this uses the current keymap. If readable is non-zero, the list is formatted in such a way that it can be made part of an -inputrc file and re-read. +inputrc file and re-read to recreate the key binding.

@@ -3161,16 +3386,19 @@ the list is formatted in such a way that it can be made part of an
Function: const char ** rl_funmap_names (void)
-

Return a NULL terminated array of known function names. The array is -sorted. The array itself is allocated, but not the strings inside. You -should free the array, but not the pointers, using free or -rl_free when you are done. +

Return a NULL terminated array of known function names. +The array is sorted. +The array itself is allocated, but not the strings inside. +You should free the array, but not the pointers, using free +or rl_free when you are done.

Function: int rl_add_funmap_entry (const char *name, rl_command_func_t *function)

Add name to the list of bindable Readline command names, and make function the function to be called when name is invoked. +This returns the index of the newly-added name in the array of +function names.


@@ -3183,49 +3411,52 @@ Next: , Previous: 2.4.5 Allowing Undoing

Supporting the undo command is a painless thing, and makes your -functions much more useful. It is certainly easy to try -something if you know you can undo it. +functions much more useful. +It is certainly easier to try something if you know you can undo it.

-

If your function simply inserts text once, or deletes text once, and -uses rl_insert_text() or rl_delete_text() to do it, then -undoing is already done for you automatically. +

If your function simply inserts text once, or deletes text once, +and uses rl_insert_text() or rl_delete_text() to do it, +then Readline does the undoing for you automatically.

If you do multiple insertions or multiple deletions, or any combination of these operations, you should group them together into one operation. This is done with rl_begin_undo_group() and rl_end_undo_group().

-

The types of events that can be undone are: +

The types of events Readline can undo are:

enum undo_code { UNDO_DELETE, UNDO_INSERT, UNDO_BEGIN, UNDO_END }; 
 

Notice that UNDO_DELETE means to insert some text, and -UNDO_INSERT means to delete some text. That is, the undo code -tells what to undo, not how to undo it. UNDO_BEGIN and -UNDO_END are tags added by rl_begin_undo_group() and -rl_end_undo_group(). +UNDO_INSERT means to delete some text. +That is, the undo code tells what to undo, not how to undo it. +UNDO_BEGIN and UNDO_END are tags +added by rl_begin_undo_group() and rl_end_undo_group(); +they are how Readline delimits groups of commands that should be +undone together.

Function: int rl_begin_undo_group (void)
-

Begins saving undo information in a group construct. The undo -information usually comes from calls to rl_insert_text() and -rl_delete_text(), but could be the result of calls to +

Begins saving undo information in a group construct. +The undo information usually comes from calls to rl_insert_text() +and rl_delete_text(), but could be the result of calls to rl_add_undo().

Function: int rl_end_undo_group (void)
-

Closes the current undo group started with rl_begin_undo_group -(). There should be one call to rl_end_undo_group() +

Closes the current undo group started with rl_begin_undo_group(). +There should be one call to rl_end_undo_group() for each call to rl_begin_undo_group().

Function: void rl_add_undo (enum undo_code what, int start, int end, char *text)
-

Remember how to undo an event (according to what). The affected -text runs from start to end, and encompasses text. +

Remember how to undo an event (according to what). +The affected text runs from start to end, +and encompasses text.

@@ -3235,20 +3466,22 @@ text runs from start to end, and e
Function: int rl_do_undo (void)
-

Undo the first thing on the undo list. Returns 0 if there was -nothing to undo, non-zero if something was undone. +

Undo the first thing on the undo list. +Returns 0 if there was nothing to undo, +non-zero if something was undone.

Finally, if you neither insert nor delete text, but directly modify the existing text (e.g., change its case), call rl_modifying() -once, just before you modify the text. You must supply the indices of -the text range that you are going to modify. +once, just before you modify the text. +You must supply the indices of the text range that you are going to modify. +Readline will create an undo group for you.

Function: int rl_modifying (int start, int end)

Tell Readline to save the text between start and end as a -single undo unit. It is assumed that you will subsequently modify -that text. +single undo unit. +It is assumed that you will subsequently modify that text.


@@ -3318,17 +3551,18 @@ redisplay.

The arguments are a format string as would be supplied to printf, possibly containing conversion specifications such as ‘%d’, and any additional arguments necessary to satisfy the conversion specifications. -The resulting string is displayed in the echo area. The echo area -is also used to display numeric arguments and search strings. +The resulting string is displayed in the echo area. +The echo area is also used to display numeric arguments and search strings. You should call rl_save_prompt to save the prompt information before calling this function.

Function: int rl_clear_message (void)
-

Clear the message in the echo area. If the prompt was saved with a call to +

Clear the message in the echo area. +If the prompt was saved with a call to rl_save_prompt before the last call to rl_message, -call rl_restore_prompt before calling this function. +you must call rl_restore_prompt before calling this function.

@@ -3341,8 +3575,8 @@ displaying a new message in the message area with rl_message(
Function: void rl_restore_prompt (void)

Restore the local Readline prompt display state saved by the most recent call to rl_save_prompt. -if rl_save_prompt was called to save the prompt before a call -to rl_message, this function should be called before the +if you called rl_save_prompt to save the prompt before a call +to rl_message, you should call this function before the corresponding call to rl_clear_message.

@@ -3350,9 +3584,11 @@ corresponding call to rl_clear_message.
Function: int rl_expand_prompt (char *prompt)

Expand any special character sequences in prompt and set up the local Readline prompt redisplay variables. -This function is called by readline(). It may also be called to -expand the primary prompt if the rl_on_new_line_with_prompt() -function or rl_already_prompted variable is used. +This function is called by readline(). +It may also be called to +expand the primary prompt if the application uses the +rl_on_new_line_with_prompt() function or +rl_already_prompted variable. It returns the number of visible characters on the last line of the (possibly multi-line) prompt. Applications may indicate that the prompt contains characters that take @@ -3361,13 +3597,15 @@ such characters with the special markers RL_PROMPT_START_IGNO and RL_PROMPT_END_IGNORE (declared in readline.h as ‘\001’ and ‘\002’, respectively). This may be used to embed terminal-specific escape sequences in prompts. +If you don’t use these indicators, redisplay will likely produce screen +contents that don’t match the line buffer.

Function: int rl_set_prompt (const char *prompt)
-

Make Readline use prompt for subsequent redisplay. This calls -rl_expand_prompt() to expand the prompt and sets rl_prompt -to the result. +

Make Readline use prompt for subsequent redisplay. +This calls rl_expand_prompt() to expand the prompt +and sets rl_prompt to the result.


@@ -3401,17 +3639,26 @@ the current line.
Function: int rl_kill_text (int start, int end)

Copy the text between start and end in the current line to the kill ring, appending or prepending to the last kill if the -last command was a kill command. The text is deleted. -If start is less than end, -the text is appended, otherwise prepended. If the last command was -not a kill, a new kill ring slot is used. +last command was a kill command. +This deletes the text from the line. +If start is less than end, the text is appended, +otherwise it is prepended. +If the last command was not a kill, this uses a new kill ring slot. +

+ +
+
Function: void rl_replace_line (const char *text, int clear_undo)
+

Replace the contents of rl_line_buffer with text. +This preserves the point and mark, if possible. +If clear_undo is non-zero, this clears the undo list associated +with the current line.

Function: int rl_push_macro_input (char *macro)
-

Cause macro to be inserted into the line, as if it had been invoked -by a key bound to a macro. Not especially useful; use -rl_insert_text() instead. +

Insert macro into the line, as if it had been invoked +by a key bound to a macro. +Not especially useful; use rl_insert_text() instead.


@@ -3441,9 +3688,10 @@ be the keyboard.
Function: int rl_stuff_char (int c)
-

Insert c into the Readline input stream. It will be "read" -before Readline attempts to read characters from the terminal with -rl_read_key(). Up to 512 characters may be pushed back. +

Insert c into the Readline input stream. +It will be "read" before Readline attempts to read characters +from the terminal with rl_read_key(). +Applications can push back up to 512 characters. rl_stuff_char returns 1 if the character was successfully inserted; 0 otherwise.

@@ -3451,21 +3699,24 @@ before Readline attempts to read characters from the terminal with
Function: int rl_execute_next (int c)

Make c be the next command to be executed when rl_read_key() -is called. This sets rl_pending_input. +is called. +This sets rl_pending_input.

Function: int rl_clear_pending_input (void)

Unset rl_pending_input, effectively negating the effect of any -previous call to rl_execute_next(). This works only if the -pending input has not already been read with rl_read_key(). +previous call to rl_execute_next(). +This works only if the pending input has not already been read +with rl_read_key().

Function: int rl_set_keyboard_input_timeout (int u)

While waiting for keyboard input in rl_read_key(), Readline will wait for u microseconds for input before calling any function -assigned to rl_event_hook. u must be greater than or equal +assigned to rl_event_hook. +u must be greater than or equal to zero (a zero-length timeout is equivalent to a poll). The default waiting period is one-tenth of a second. Returns the old timeout value. @@ -3473,10 +3724,11 @@ Returns the old timeout value.

Function: int rl_set_timeout (unsigned int secs, unsigned int usecs)
-

Set a timeout for subsequent calls to readline(). If Readline does -not read a complete line, or the number of characters specified by -rl_num_chars_to_read, before the duration specified by secs -(in seconds) and usecs (microseconds), it returns and sets +

Set a timeout for subsequent calls to readline(). +If Readline does not read a complete line, or the number of characters +specified by rl_num_chars_to_read, +before the duration specified by secs (in seconds) +and usecs (microseconds), it returns and sets RL_STATE_TIMEOUT in rl_readline_state. Passing 0 for secs and usecs cancels any previously set timeout; the convenience macro rl_clear_timeout() is shorthand @@ -3509,7 +3761,8 @@ Next:

Function: void rl_prep_terminal (int meta_flag)

Modify the terminal settings for Readline’s use, so readline() -can read a single character at a time from the keyboard. +can read a single character at a time from the keyboard +and perform redisplay. The meta_flag argument should be non-zero if Readline should read eight-bit input.

@@ -3537,19 +3790,21 @@ The bindings are performed in kmap.
Function: int rl_tty_set_echoing (int value)
-

Set Readline’s idea of whether or not it is echoing output to its output -stream (rl_outstream). If value is 0, Readline does not display -output to rl_outstream; any other value enables output. The initial -value is set when Readline initializes the terminal settings. +

Set Readline’s idea of whether or not it is +echoing output to its output stream (rl_outstream). +If value is 0, +Readline does not display output to rl_outstream; any other +value enables output. +The initial value is set when Readline initializes the terminal settings. This function returns the previous value.

Function: int rl_reset_terminal (const char *terminal_name)

Reinitialize Readline’s idea of the terminal settings using -terminal_name as the terminal type (e.g., vt100). -If terminal_name is NULL, the value of the TERM -environment variable is used. +terminal_name as the terminal type (e.g., xterm). +If terminal_name is NULL, Readline uses the value of the +TERM environment variable.


@@ -3564,45 +3819,37 @@ Next:

Save a snapshot of Readline’s internal state to sp. -The contents of the readline_state structure are documented -in readline.h. +The contents of the readline_state structure are +documented in readline.h. The caller is responsible for allocating the structure.

Function: int rl_restore_state (struct readline_state *sp)
-

Restore Readline’s internal state to that stored in sp, which must -have been saved by a call to rl_save_state. -The contents of the readline_state structure are documented -in readline.h. -The caller is responsible for freeing the structure. +

Restore Readline’s internal state to that stored in sp, +which must have been saved by a call to rl_save_state. +The contents of the readline_state structure are documented in +readline.h. +The caller is responsible for freeing the structure.

Function: void rl_free (void *mem)
-

Deallocate the memory pointed to by mem. mem must have been -allocated by malloc. -

- -
-
Function: void rl_replace_line (const char *text, int clear_undo)
-

Replace the contents of rl_line_buffer with text. -The point and mark are preserved, if possible. -If clear_undo is non-zero, the undo list associated with the -current line is cleared. +

Deallocate the memory pointed to by mem. +mem must have been allocated by malloc.

Function: void rl_extend_line_buffer (int len)

Ensure that rl_line_buffer has enough space to hold len -characters, possibly reallocating it if necessary. +characters, reallocating it if necessary.

Function: int rl_initialize (void)

Initialize or re-initialize Readline’s internal state. -It’s not strictly necessary to call this; readline() calls it before -reading any input. +It’s not strictly necessary to call this; +readline() calls it before reading any input.

@@ -3618,12 +3865,13 @@ reading any input.
Function: void rl_display_match_list (char **matches, int len, int max)

A convenience function for displaying a list of strings in -columnar format on Readline’s output stream. matches is the list -of strings, in argv format, such as a list of completion matches. +columnar format on Readline’s output stream. +matches is the list of strings, in argv format, +such as a list of completion matches. len is the number of strings in matches, and max -is the length of the longest string in matches. This function uses -the setting of print-completions-horizontally to select how the -matches are displayed (see Readline Init File Syntax). +is the length of the longest string in matches. +This function uses the setting of print-completions-horizontally +to select how the matches are displayed (see Readline Init File Syntax). When displaying completions, this function sets the number of columns used for display to the value of completion-display-width, the value of the environment variable COLUMNS, or the screen width, in that order. @@ -3676,9 +3924,9 @@ Next:

Bind the key sequence keyseq to invoke the macro macro. -The binding is performed in map. When keyseq is invoked, the -macro will be inserted into the line. This function is deprecated; -use rl_generic_bind instead. +The binding is performed in map. +When keyseq is invoked, the macro will be inserted into the line. +This function is deprecated; use rl_generic_bind instead.

@@ -3696,7 +3944,8 @@ that it can be made part of an inputrc file and re-rea

Make the Readline variable variable have value. This behaves as if the Readline command ‘set variable value’ had been executed in an inputrc -file (see Readline Init File Syntax). +file (see Readline Init File Syntax) +or by rl_parse_and_bind.

@@ -3724,9 +3973,10 @@ a balancing character when blink-matching-paren has be

Retrieve the string value of the termcap capability cap. Readline fetches the termcap entry for the current terminal name and uses those capabilities to move around the screen line and perform other -terminal-specific operations, like erasing a line. Readline does not -use all of a terminal’s capabilities, and this function will return -values for only those capabilities Readline uses. +terminal-specific operations, like erasing a line. +Readline does not fetch or use all of a terminal’s capabilities, +and this function will return +values for only those capabilities Readline fetches.

@@ -3744,16 +3994,18 @@ Readline saves in the history list.
Function: void rl_activate_mark (void)
-

Enable an active mark. +

Enable an active region. When this is enabled, the text between point and mark (the region) is -displayed in the terminal’s standout mode (a face). +displayed using the color specified by the value of the +active-region-start-color variable (a face). +The default face is the terminal’s standout mode. This is called by various Readline functions that set the mark and insert text, and is available for applications to call.

Function: void rl_deactivate_mark (void)
-

Turn off the active mark. +

Turn off the active region.

@@ -3778,17 +4030,21 @@ Next:

-

An alternate interface is available to plain readline(). Some -applications need to interleave keyboard I/O with file, device, or -window system I/O, typically by using a main loop to select() -on various file descriptors. To accommodate this need, Readline can -also be invoked as a ‘callback’ function from an event loop. There -are functions available to make this easy. +

For applications that need more granular control than +plain readline() provides, there is +an alternate interface. +Some applications need to interleave keyboard I/O with file, device, +or window system I/O, typically by using a main loop to select() +on various file descriptors. +To accommodate this use case, Readline can +also be invoked as a ‘callback’ function from an event loop. +There are functions available to make this easy.

-
Function: void rl_callback_handler_install (const char *prompt, rl_vcpfunc_t *lhandler)
+
Function: void rl_callback_handler_install (const char *prompt, rl_vcpfunc_t *line_handler)

Set up the terminal for Readline I/O and display the initial -expanded value of prompt. Save the value of lhandler to +expanded value of prompt. +Save the value of line_handler to use as a handler function to call when a complete line of input has been entered. The handler function receives the text of the line as an argument. @@ -3802,15 +4058,15 @@ line when it it finished with it. should call rl_callback_read_char(), which will read the next character from the current input source. If that character completes the line, rl_callback_read_char will -invoke the lhandler function installed by +invoke the line_handler function installed by rl_callback_handler_install to process the line. -Before calling the lhandler function, the terminal settings are -reset to the values they had before calling +Before calling the line_handler function, Readline resets +the terminal settings to the values they had before calling rl_callback_handler_install. -If the lhandler function returns, +If the line_handler function returns, and the line handler remains installed, -the terminal settings are modified for Readline’s use again. -EOF is indicated by calling lhandler with a +Readline modifies the terminal settings for its use again. +EOF is indicated by calling line_handler with a NULL line.

@@ -3818,19 +4074,21 @@ the terminal settings are modified for Readline’s use again.
Function: void rl_callback_sigcleanup (void)

Clean up any internal state the callback interface uses to maintain state between calls to rl_callback_read_char (e.g., the state of any active -incremental searches). This is intended to be used by applications that -wish to perform their own signal handling; Readline’s internal signal handler -calls this when appropriate. +incremental searches). +This is intended to be used by applications that +wish to perform their own signal handling; +Readline’s internal signal handler calls this when appropriate.

Function: void rl_callback_handler_remove (void)

Restore the terminal to its initial state and remove the line handler. You may call this function from within a callback as well as independently. -If the lhandler installed by rl_callback_handler_install -does not exit the program, either this function or the function referred -to by the value of rl_deprep_term_function should be called before -the program exits to reset the terminal settings. +If the line_handler installed by rl_callback_handler_install +does not exit the program, your program should call +either this function or the function referred +to by the value of rl_deprep_term_function +before the program exits to reset the terminal settings.


@@ -3843,10 +4101,11 @@ Next:

Here is a function which changes lowercase characters to their uppercase -equivalents, and uppercase characters to lowercase. If -this function was bound to ‘M-c’, then typing ‘M-c’ would -change the case of the character under point. Typing ‘M-1 0 M-c’ -would change the case of the following 10 characters, leaving the cursor on +equivalents, and uppercase characters to lowercase. +If this function was bound to ‘M-c’, then typing ‘M-c’ would +change the case of the character under point. +Typing ‘M-1 0 M-c’ would change the case +of the following 10 characters, leaving the cursor on the last character changed.

@@ -3855,23 +4114,15 @@ int invert_case_line (count, key) int count, key; { - register int start, end, i; + int start, end, i; start = rl_point; if (rl_point >= rl_end) return (0); - if (count < 0) - { - direction = -1; - count = -count; - } - else - direction = 1; - /* Find the end of the range to modify. */ - end = start + (count * direction); + end = start + count; /* Force it to be within range. */ if (end > rl_end) @@ -3882,6 +4133,11 @@ invert_case_line (count, key) if (start == end) return (0); + /* For positive arguments, put point after the last changed character. For + negative arguments, put point before the last changed character. */ + rl_point = end; + + /* Swap start and end if we are moving backwards */ if (start > end) { int temp = start; @@ -3900,8 +4156,7 @@ invert_case_line (count, key) else if (_rl_lowercase_p (rl_line_buffer[i])) rl_line_buffer[i] = _rl_to_upper (rl_line_buffer[i]); } - /* Move point to on top of the last character changed. */ - rl_point = (direction == 1) ? end - 1 : start; + return (0); }
@@ -3925,7 +4180,6 @@ It understands the EOF character or "exit" to exit the program. #include <stdlib.h> #include <string.h> #include <unistd.h> -#include <locale.h> /* Used for select(2) */ #include <sys/types.h> @@ -3933,12 +4187,19 @@ It understands the EOF character or "exit" to exit the program. #include <signal.h> +#include <errno.h> #include <stdio.h> +#include <locale.h> + /* Standard readline include files. */ #include <readline/readline.h> #include <readline/history.h> +#if !defined (errno) +extern int errno; +#endif + static void cb_linehandler (char *); static void sighandler (int); @@ -4006,7 +4267,7 @@ main (int c, char **v) while (running) { FD_ZERO (&fds); - FD_SET (fileno (rl_instream), &fds); + FD_SET (fileno (rl_instream), &fds); r = select (FD_SETSIZE, &fds, NULL, NULL, NULL); if (r < 0 && errno != EINTR) @@ -4043,20 +4304,22 @@ Next: 2.5 Readline Signal Handling

Signals are asynchronous events sent to a process by the Unix kernel, -sometimes on behalf of another process. They are intended to indicate -exceptional events, like a user pressing the terminal’s interrupt key, -or a network connection being broken. There is a class of signals that can -be sent to the process currently reading input from the keyboard. Since -Readline changes the terminal attributes when it is called, it needs to -perform special processing when such a signal is received in order to -restore the terminal to a sane state, or provide application writers with -functions to do so manually. +sometimes on behalf of another process. +They are intended to indicate exceptional events, +like a user pressing the terminal’s interrupt key, +or a network connection being broken. +There is a class of signals that can +be sent to the process currently reading input from the keyboard. +Since Readline changes the terminal attributes when it is called, it needs +to perform special processing when such a signal is received in order to +restore the terminal to a sane state, or provide applications using +Readline with functions to do so manually.

Readline contains an internal signal handler that is installed for a number of signals (SIGINT, SIGQUIT, SIGTERM, SIGHUP, SIGALRM, SIGTSTP, SIGTTIN, and SIGTTOU). -When one of these signals is received, the signal handler +When Readline receives one of these signals, the signal handler will reset the terminal attributes to those that were in effect before readline() was called, reset the signal handling to what it was before readline() was called, and resend the signal to the calling @@ -4069,22 +4332,24 @@ aborted (see the description of rl_free_line_state() b

There is an additional Readline signal handler, for SIGWINCH, which the kernel sends to a process whenever the terminal’s size changes (for -example, if a user resizes an xterm). The Readline SIGWINCH -handler updates Readline’s internal screen size information, and then calls -any SIGWINCH signal handler the calling application has installed. +example, if a user resizes an xterm). +The Readline SIGWINCH handler updates +Readline’s internal screen size information, and then calls any +SIGWINCH signal handler the calling application has installed. Readline calls the application’s SIGWINCH signal handler without -resetting the terminal to its original state. If the application’s signal -handler does more than update its idea of the terminal size and return (for -example, a longjmp back to a main processing loop), it must -call rl_cleanup_after_signal() (described below), to restore the -terminal state. +resetting the terminal to its original state. +If the application’s signal +handler does more than update its idea of the terminal size and return +(for example, a longjmp back to a main processing loop), +it must call rl_cleanup_after_signal() (described below), +to restore the terminal state.

When an application is using the callback interface (see Alternate Interface), Readline installs signal handlers only for -the duration of the call to rl_callback_read_char. Applications -using the callback interface should be prepared to clean up Readline’s -state if they wish to handle the signal before the line handler completes -and restores the terminal state. +the duration of the call to rl_callback_read_char. +Applications using the callback interface should be prepared +to clean up Readline’s state if they wish to handle the signal +before the line handler completes and restores the terminal state.

If an application using the callback interface wishes to have Readline install its signal handlers at the time the application calls @@ -4095,18 +4360,21 @@ This allows an application to defer all of the handling of the signals Readline catches to Readline. Applications should use this variable with care; it can result in Readline catching signals and not acting on them (or allowing the application to react -to them) until the application calls rl_callback_read_char. This -can result in an application becoming less responsive to keyboard signals -like SIGINT. +to them) until the application calls rl_callback_read_char. +This can result in an application becoming less responsive to keyboard +signals like SIGINT. If an application does not want or need to perform any signal handling, or -does not need to do any processing between calls to rl_callback_read_char, -setting this variable may be desirable. +does not need to do any processing +between calls to rl_callback_read_char, +setting this variable may be appropriate.

Readline provides two variables that allow application writers to control whether or not it will catch certain signals and act on them -when they are received. It is important that applications change the -values of these variables only when calling readline(), not in -a signal handler, so Readline’s internal signal state is not corrupted. +when they are received. +It is important that applications change the +values of these variables only when calling readline(), +not in a signal handler, so Readline’s internal signal state +is not corrupted.

Variable: int rl_catch_signals
@@ -4140,7 +4408,7 @@ it should set this variable to a non-zero value.

If this variable is set to a non-zero value, and Readline is handling SIGWINCH, Readline will modify the LINES and COLUMNS environment variables upon receipt of a -SIGWINCH +SIGWINCH.

The default value of rl_change_environment is 1.

@@ -4169,10 +4437,10 @@ all signals, depending on the values of rl_catch_signalsFunction: void rl_free_line_state (void)

This will free any partial state associated with the current input line (undo information, any partial history entry, any partially-entered -keyboard macro, and any partially-entered numeric argument). This -should be called before rl_cleanup_after_signal(). The -Readline signal handler for SIGINT calls this to abort the -current input line. +keyboard macro, and any partially-entered numeric argument). +This should be called before rl_cleanup_after_signal(). +The Readline signal handler for SIGINT calls this to abort +the current input line.

@@ -4185,20 +4453,22 @@ handlers, depending on the values of rl_catch_signals

If an application wants to force Readline to handle any signals that have arrived while it has been executing, rl_check_signals() will call Readline’s internal signal handler if there are any pending -signals. This is primarily intended for those applications that use +signals. +This is primarily intended for those applications that use a custom rl_getc_function (see Readline Variables) and wish to handle signals received while waiting for input.

Function: void rl_check_signals (void)
-

If there are any pending signals, call Readline’s internal signal handling -functions to process them. rl_pending_signal() can be used independently +

If there are any pending signals, call Readline’s internal signal +handling functions to process them. +rl_pending_signal() can be used independently to determine whether or not there are any pending signals.

-

If an application does not wish Readline to catch SIGWINCH, it may -call rl_resize_terminal() or rl_set_screen_size() to force -Readline to update its idea of the terminal size when it receives +

If an application does not wish Readline to catch SIGWINCH, +it may call rl_resize_terminal() or rl_set_screen_size() +to force Readline to update its idea of the terminal size when it receives a SIGWINCH.

@@ -4217,8 +4487,9 @@ function with sig set to SIGINT
Function: void rl_set_screen_size (int rows, int cols)

Set Readline’s idea of the terminal size to rows rows and -cols columns. If either rows or columns is less than -or equal to 0, Readline’s idea of that terminal dimension is unchanged. +cols columns. +If either rows or columns is less than or equal to 0, +Readline doesn’t change that terminal dimension. This is intended to tell Readline the physical dimensions of the terminal, and is used internally to calculate the maximum number of characters that may appear on a single line and on the screen. @@ -4266,7 +4537,8 @@ Previous:

Typically, a program that reads commands from the user has a way of -disambiguating commands and data. If your program is one of these, then +disambiguating commands and data. +If your program is one of these, then it can provide completion for commands, data, or both. The following sections describe how your program and Readline cooperate to provide this service. @@ -4287,20 +4559,24 @@ Next:

In order to complete some text, the full list of possible completions -must be available. That is, it is not possible to accurately +must be available. +That is, it is not possible to accurately expand a partial word without knowing all of the possible words -which make sense in that context. The Readline library provides +which make sense in that context. +The Readline library provides the user interface to completion, and two of the most common -completion functions: filename and username. For completing other types -of text, you must write your own completion function. This section +completion functions: filename and username. +For completing other types +of text, you must write your own completion function. +This section describes exactly what such functions must do, and provides an example.

There are three major functions used to perform completion:

    -
  1. The user-interface function rl_complete(). This function is -called with the same arguments as other bindable Readline functions: -count and invoking_key. +
  2. The user-interface function rl_complete(). +This function is called with the same arguments as other bindable +Readline functions: count and invoking_key. It isolates the word to be completed and calls rl_completion_matches() to generate a list of possible completions. It then either lists the possible completions, inserts the possible @@ -4314,16 +4590,19 @@ The caller should place the address of its generator function in rl_completion_entry_function.
  3. The generator function is called repeatedly from -rl_completion_matches(), returning a string each time. The -arguments to the generator function are text and state. -text is the partial word to be completed. state is zero the -first time the function is called, allowing the generator to perform -any necessary initialization, and a positive non-zero integer for -each subsequent call. The generator function returns +rl_completion_matches(), returning a string each time. +The arguments to the generator function are text and state. +text is the partial word to be completed. +state is zero the first time the function is called, +allowing the generator to perform any necessary initialization, +and a positive integer for each subsequent call. +The generator function returns (char *)NULL to inform rl_completion_matches() that there are -no more possibilities left. Usually the generator function computes the +no more possibilities left. +Usually the generator function computes the list of possible completions when state is zero, and returns them -one at a time on subsequent calls. Each string the generator function +one at a time on subsequent calls. +Each string the generator function returns as a match must be allocated with malloc(); Readline frees the strings when it has finished with them. Such a generator function is referred to as an @@ -4333,9 +4612,10 @@ Such a generator function is referred to as an
    Function: int rl_complete (int ignore, int invoking_key)
    -

    Complete the word at or before point. You have supplied the function -that does the initial simple matching selection algorithm (see -rl_completion_matches()). The default is to do filename completion. +

    Complete the word at or before point. +You have supplied the function that does the initial simple matching +selection algorithm (see rl_completion_matches()). +The default is to do filename completion.

    @@ -4343,11 +4623,11 @@ that does the initial simple matching selection algorithm (see

    This is a pointer to the generator function for rl_completion_matches(). If the value of rl_completion_entry_function is -NULL then the default filename generator -function, rl_filename_completion_function(), is used. +NULL then Readline uses the default filename generator +function, rl_filename_completion_function(). An application-specific completion function is a function whose address is assigned to rl_completion_entry_function and whose -return values are used to generate possible completions. +return values are used to generate possible completions.


    @@ -4364,37 +4644,40 @@ Readline.

    Function: int rl_complete_internal (int what_to_do)
    -

    Complete the word at or before point. what_to_do says what to do -with the completion. A value of ‘?’ means list the possible -completions. ‘TAB’ means do standard completion. ‘*’ means -insert all of the possible completions. ‘!’ means to display -all of the possible completions, if there is more than one, as well as -performing partial completion. ‘@’ is similar to ‘!’, but -possible completions are not listed if the possible completions share -a common prefix. +

    Complete the word at or before point. +what_to_do says what to do with the completion. +A value of ‘?’ means list the possible completions. +‘TAB’ means do standard completion. +‘*’ means insert all of the possible completions. +‘!’ means to display all of the possible completions, +if there is more than one, as well as performing partial completion. +‘@’ is similar to ‘!’, but does not list possible completions +if the possible completions share a common prefix.

    Function: int rl_complete (int ignore, int invoking_key)
    -

    Complete the word at or before point. You have supplied the function -that does the initial simple matching selection algorithm (see -rl_completion_matches() and rl_completion_entry_function). -The default is to do filename -completion. This calls rl_complete_internal() with an +

    Complete the word at or before point. +You have supplied the function that does the initial simple +matching selection algorithm (see rl_completion_matches() and +rl_completion_entry_function). +The default is to do filename completion. +This calls rl_complete_internal() with an argument depending on invoking_key.

    Function: int rl_possible_completions (int count, int invoking_key)
    -

    List the possible completions. See description of rl_complete -(). This calls rl_complete_internal() with an argument of -‘?’. +

    List the possible completions. +See description of rl_complete(). +This calls rl_complete_internal() with an argument of ‘?’.

    Function: int rl_insert_completions (int count, int invoking_key)

    Insert the list of possible completions into the line, deleting the -partially-completed word. See description of rl_complete(). +partially-completed word. +See description of rl_complete(). This calls rl_complete_internal() with an argument of ‘*’.

    @@ -4410,16 +4693,17 @@ the same interface as rl_complete().
    Function: char ** rl_completion_matches (const char *text, rl_compentry_func_t *entry_func)
    -

    Returns an array of strings which is a list of completions for -text. If there are no completions, returns NULL. +

    Returns an array of strings which is a list of completions for text. +If there are no completions, returns NULL. The first entry in the returned array is the substitution for text. -The remaining entries are the possible completions. The array is -terminated with a NULL pointer. -

    -

    entry_func is a function of two args, and returns a -char *. The first argument is text. The second is a -state argument; it is zero on the first call, and non-zero on subsequent -calls. entry_func returns a NULL pointer to the caller +The remaining entries are the possible completions. +The array is terminated with a NULL pointer. +

    +

    entry_func is a function of two args, and returns a char *. +The first argument is text. +The second is a state argument; +it is zero on the first call, and non-zero on subsequent calls. +entry_func returns a NULL pointer to the caller when there are no more matches.

    @@ -4434,10 +4718,11 @@ Readline functions).
    Function: char * rl_username_completion_function (const char *text, int state)
    -

    A completion generator for usernames. text contains a partial -username preceded by a random character (usually ‘~’). As with all -completion generators, state is zero on the first call and non-zero -for subsequent calls. +

    A completion generator for usernames. +text contains a partial username preceded by a +random character (usually ‘~’). +As with all completion generators, +state is zero on the first call and non-zero for subsequent calls.


    @@ -4464,8 +4749,8 @@ The function is called with text, start< the boundaries of text, which is a character string. If this function exists and returns NULL, or if this variable is set to NULL, then rl_complete() will call the value of -rl_completion_entry_function to generate matches, otherwise the -array of strings returned will be used. +rl_completion_entry_function to generate matches, otherwise +completion will use the array of strings this function returns. If this function sets the rl_attempted_completion_over variable to a non-zero value, Readline will not perform its default completion even if this function returns no matches. @@ -4474,59 +4759,70 @@ completion even if this function returns no matches.
    Variable: rl_quote_func_t * rl_filename_quoting_function

    A pointer to a function that will quote a filename in an -application-specific fashion. This is called if filename completion is being -attempted and one of the characters in rl_filename_quote_characters -appears in a completed filename. The function is called with -text, match_type, and quote_pointer. The text -is the filename to be quoted. The match_type is either -SINGLE_MATCH, if there is only one completion match, or -MULT_MATCH. Some functions use this to decide whether or not to -insert a closing quote character. The quote_pointer is a pointer -to any opening quote character the user typed. Some functions choose -to reset this character. +application-specific fashion. +Readline calls this function during filename completion +if one of the characters in rl_filename_quote_characters +appears in a completed filename. +The function is called with +text, match_type, and quote_pointer. +The text is the filename to be quoted. +The match_type is either SINGLE_MATCH, +if there is only one completion match, or MULT_MATCH. +Some functions use this to decide whether or not to +insert a closing quote character. +The quote_pointer is a pointer +to any opening quote character the user typed. +Some functions choose to reset this character if they decide to quote +the filename in a different style. +It’s preferable to preserve the user’s quoting as much as possible – +it’s less disruptive.

    Variable: rl_dequote_func_t * rl_filename_dequoting_function

    A pointer to a function that will remove application-specific quoting -characters from a filename before completion is attempted, so those -characters do not interfere with matching the text against names in -the filesystem. It is called with text, the text of the word +characters from a filename before attempting completion, +so those characters do not interfere with matching the text against +names in the filesystem. +It is called with text, the text of the word to be dequoted, and quote_char, which is the quoting character -that delimits the filename (usually ‘'’ or ‘"’). If -quote_char is zero, the filename was not in an embedded string. +that delimits the filename (usually ‘'’ or ‘"’). +If quote_char is zero, the filename was not in a quoted string.

    Variable: rl_linebuf_func_t * rl_char_is_quoted_p

    A pointer to a function to call that determines whether or not a specific character in the line buffer is quoted, according to whatever quoting -mechanism the program calling Readline uses. The function is called with -two arguments: text, the text of the line, and index, the -index of the character in the line. It is used to decide whether a -character found in rl_completer_word_break_characters should be +mechanism the application uses. +The function is called with two arguments: +text, the text of the line, +and index, the index of the character in the line. +It is used to decide whether a character found in +rl_completer_word_break_characters should be used to break words for the completer.

    Variable: rl_compignore_func_t * rl_ignore_some_completions_function
    -

    This function, if defined, is called by the completer when real filename +

    Readline calls this function, if defined, when filename completion is done, after all the matching names have been generated. It is passed a NULL terminated array of matches. -The first element (matches[0]) is the -maximal substring common to all matches. This function can -re-arrange the list of matches as required, but each element deleted -from the array must be freed. +The first element (matches[0]) is the maximal substring +common to all matches. +This function can re-arrange the list of matches as required, but +must free each element it deletes from the array.

    Variable: rl_icppfunc_t * rl_directory_completion_hook

    This function, if defined, is allowed to modify the directory portion -of filenames Readline completes. +of filenames during completion. It could be used to expand symbolic links or shell variables in pathnames. It is called with the address of a string (the current directory name) as an argument, and may modify that string. -If the string is replaced with a new string, the old value should be freed. +If the function replaces the string with a new string, it +should free the old value. Any modified directory name should have a trailing slash. The modified value will be used as part of the completion, replacing the directory portion of the pathname the user typed. @@ -4542,11 +4838,14 @@ The function should not modify the directory argument if it returns 0.

    Variable: rl_icppfunc_t * rl_directory_rewrite_hook;

    If non-zero, this is the address of a function to call when completing -a directory name. This function takes the address of the directory name -to be modified as an argument. Unlike rl_directory_completion_hook, -it only modifies the directory name used in opendir, not what is -displayed when the possible completions are printed or inserted. It is -called before rl_directory_completion_hook. +a directory name. +This function takes the address of the directory name +to be modified as an argument. +Unlike rl_directory_completion_hook, +it only modifies the directory name used in opendir(), +not what Readline displays when it prints or inserts +the possible completions. +Readline calls this before rl_directory_completion_hook. At the least, even if no other expansion is performed, this function should remove any quote characters from the directory name, because its result will be passed directly to opendir(). @@ -4560,8 +4859,9 @@ The function should not modify the directory argument if it returns 0.

    Variable: rl_icppfunc_t * rl_filename_stat_hook

    If non-zero, this is the address of a function for the completer to call before deciding which character to append to a completed name. -This function modifies its filename name argument, and the modified value -is passed to stat() to determine the file’s type and characteristics. +This function modifies its filename name argument, and Readline passes +the modified value to stat() +to determine the file’s type and characteristics. This function does not need to remove quote characters from the filename.

    The stat hook returns an integer that should be non-zero if @@ -4571,29 +4871,37 @@ The function should not modify the directory argument if it returns 0.

    Variable: rl_dequote_func_t * rl_filename_rewrite_hook
    -

    If non-zero, this is the address of a function called when reading +

    If non-zero, this is the address of a function +for Readline to call when reading directory entries from the filesystem for completion and comparing -them to the filename portion of the partial word to be completed -(after its potential modification by rl_completion_rewrite_hook). -The function should -perform any necessary application or system-specific conversion on -the filename, such as converting between character sets or converting -from a filesystem format to a character input format. -The function takes two arguments: fname, the filename to be converted, +them to the filename portion of the partial word being completed. +It modifies the filesystem entries, +as opposed to rl_completion_rewrite_hook, +which modifies the word being completed. +The function takes two arguments: +fname, the filename to be converted, and fnlen, its length in bytes. It must either return its first argument (if no conversion takes place) -or the converted filename in newly-allocated memory. The converted -form is used to compare against the word to be completed, and, if it -matches, is added to the list of matches. Readline will free the -allocated string. +or the converted filename in newly-allocated memory. +The function should perform any necessary application or system-specific +conversion on the filename, such as converting between character sets +or converting from a filesystem format to a character input format. +Readline compares the converted form against the word to be completed, +and, if it matches, adds it to the list of matches. +Readline will free the allocated string.

    Variable: rl_dequote_func_t * rl_completion_rewrite_hook
    -

    If non-zero, this is the address of a function to call before +

    If non-zero, this is the address of a function +for Readline to call before comparing the filename portion of a word to be completed with directory entries from the filesystem. -The function takes two arguments: fname, the filename to be converted, +It modifies the word being completed, +as opposed to rl_filename_rewrite_hook, +which modifies filesystem entries. +The function takes two arguments: +fname, the word to be converted, after any rl_filename_dequoting_function has been applied, and fnlen, its length in bytes. It must either return its first argument (if no conversion takes place) @@ -4602,8 +4910,8 @@ The function should perform any necessary application or system-specific conversion on the filename, such as converting between character sets or converting from a character input format to some other format. Readline compares the converted form against directory entries, after -their potential modification by rl_filename_rewrite_hook, and adds -any matches to the list of matches. +their potential modification by rl_filename_rewrite_hook, +and adds any matches to the list of matches. Readline will free the allocated string.

    @@ -4611,7 +4919,7 @@ Readline will free the allocated string.
    Variable: rl_compdisp_func_t * rl_completion_display_matches_hook

    If non-zero, then this is the address of a function to call when completing a word would normally display the list of possible matches. -This function is called in lieu of Readline displaying the list. +Readline calls this function instead of displaying the list itself. It takes three arguments: (char **matches, int num_matches, int max_length) where matches is the array of matching strings, @@ -4625,7 +4933,8 @@ You may call that function from this hook.

    Variable: const char * rl_basic_word_break_characters

    The basic list of characters that signal a break between words for the -completer routine. The default value of this variable is the characters +completer routine. +The default value of this variable is the characters which break words for completion in Bash: " \t\n\"\\'`@$><=;|&{(".

    @@ -4633,37 +4942,44 @@ which break words for completion in Bash:
    Variable: const char * rl_basic_quote_characters

    A list of quote characters which can cause a word break. +The default value includes single and double quotes.

    Variable: const char * rl_completer_word_break_characters

    The list of characters that signal a break between words for -rl_complete_internal(). The default list is the value of +rl_complete_internal(). +These characters determine how Readline decides what to complete. +The default list is the value of rl_basic_word_break_characters.

    Variable: rl_cpvfunc_t * rl_completion_word_break_hook

    If non-zero, this is the address of a function to call when Readline is -deciding where to separate words for word completion. It should return -a character string like rl_completer_word_break_characters to be -used to perform the current completion. The function may choose to set -rl_completer_word_break_characters itself. If the function -returns NULL, rl_completer_word_break_characters is used. +deciding where to separate words for word completion. +It should return a character string like +rl_completer_word_break_characters to be +used to perform the current completion. +The function may choose to set +rl_completer_word_break_characters itself. +If the function returns NULL, Readline uses +rl_completer_word_break_characters.

    Variable: const char * rl_completer_quote_characters

    A list of characters which can be used to quote a substring of the line. -Completion occurs on the entire substring, and within the substring +Completion occurs on the entire substring, and within the substring, rl_completer_word_break_characters are treated as any other character, unless they also appear within this list.

    Variable: const char * rl_filename_quote_characters
    -

    A list of characters that cause a filename to be quoted by the completer -when they appear in a completed filename. The default is the null string. +

    A list of characters that cause Readline to quote a filename +when they appear in a completed filename. +The default is the null string.

    @@ -4677,48 +4993,44 @@ shell variables and hostnames.
    Variable: int rl_completion_query_items
    -

    Up to this many items will be displayed in response to a -possible-completions call. After that, Readline asks the user for -confirmation before displaying them. -The default value is 100. A negative value +

    This determines the maximum number of items +that possible-completions will display unconditionally. +If there are more possible completions than this, +Readline asks the user for confirmation before displaying them. +The default value is 100. +A negative value indicates that Readline should never ask for confirmation.

    Variable: int rl_completion_append_character

    When a single completion alternative matches at the end of the command -line, this character is appended to the inserted completion text. The -default is a space character (‘ ’). Setting this to the null +line, Readline appends this character to the inserted completion text. +The default is a space character (‘ ’). +Setting this to the null character (‘\0’) prevents anything being appended automatically. This can be changed in application-specific completion functions to provide the “most sensible word separator character” according to an application-specific command line syntax specification. -It is set to the default before any application-specific completion function -is called, and may only be changed within such a function. +It is set to the default before calling any application-specific completion +function, and may only be changed within such a function.

    Variable: int rl_completion_suppress_append
    -

    If non-zero, rl_completion_append_character is not appended to +

    If non-zero, Readline will not append the +rl_completion_append_character to matches at the end of the command line, as described above. -It is set to 0 before any application-specific completion function -is called, and may only be changed within such a function. -

    - -
    -
    Variable: int rl_completion_quote_character
    -

    When Readline is completing quoted text, as delimited by one of the -characters in rl_completer_quote_characters, it sets this variable -to the quoting character found. -This is set before any application-specific completion function is called. +It is set to 0 before calling any application-specific completion function, +and may only be changed within such a function.

    Variable: int rl_completion_suppress_quote

    If non-zero, Readline does not append a matching quote character when performing completion on a quoted string. -It is set to 0 before any application-specific completion function -is called, and may only be changed within such a function. +It is set to 0 before calling any application-specific completion function, +and may only be changed within such a function.

    @@ -4726,61 +5038,76 @@ is called, and may only be changed within such a function.

    When Readline is completing quoted text, it sets this variable to a non-zero value if the word being completed contains or is delimited by any quoting characters, including backslashes. -This is set before any application-specific completion function is called. +This is set before calling any application-specific completion function. +

    + +
    +
    Variable: int rl_completion_quote_character
    +

    When Readline is completing quoted text, as delimited by one of the +characters in rl_completer_quote_characters, it sets this variable +to the quoting character it found. +This is set before calling any application-specific completion function.

    -

    If non-zero, a slash will be appended to completed filenames that are +

    If non-zero, Readline appends a slash to completed filenames that are symbolic links to directory names, subject to the value of the user-settable mark-directories variable. This variable exists so that application-specific completion functions can override the user’s global preference (set via the mark-symlinked-directories Readline variable) if appropriate. -This variable is set to the user’s preference before any -application-specific completion function is called, so unless that -function modifies the value, the user’s preferences are honored. +This variable is set to the user’s preference before calling any +application-specific completion function, +so unless that function modifies the value, +Readline will honor the user’s preferences.

    Variable: int rl_ignore_completion_duplicates
    -

    If non-zero, then duplicates in the matches are removed. +

    If non-zero, then Readline removes duplicates in the set of possible +completions. The default is 1.

    Variable: int rl_filename_completion_desired
    -

    Non-zero means that the results of the matches are to be treated as -filenames. This is always zero when completion is attempted, +

    A non-zero value means that Readline should treat the results of the +matches as filenames. +This is always zero when completion is attempted, and can only be changed -within an application-specific completion function. If it is set to a -non-zero value by such a function, directory names have a slash appended -and Readline attempts to quote completed filenames if they contain any +within an application-specific completion function. +If it is set to a +non-zero value by such a function, Readline +appends a slash to directory names +and attempts to quote completed filenames if they contain any characters in rl_filename_quote_characters and rl_filename_quoting_desired is set to a non-zero value.

    Variable: int rl_filename_quoting_desired
    -

    Non-zero means that the results of the matches are to be quoted using -double quotes (or an application-specific quoting mechanism) if the -completed filename contains any characters in -rl_filename_quote_chars. This is always non-zero -when completion is attempted, and can only be changed within an +

    A non-zero value means that Readline should quote the results of the +matches using double quotes (or an application-specific quoting mechanism) +if the completed filename contains any characters in +rl_filename_quote_chars. +This is always non-zero when completion is attempted, +and can only be changed within an application-specific completion function. -The quoting is effected via a call to the function pointed to +The quoting is performed via a call to the function pointed to by rl_filename_quoting_function.

    Variable: int rl_full_quoting_desired
    -

    Non-zero means that Readline should apply filename-style quoting, +

    A non-zero value means that Readline should apply filename-style quoting, including any application-specified quoting mechanism, -to all completion matches even if we are not otherwise treating the +to all completion matches even if it is not otherwise treating the matches as filenames. -This is always zero when completion is attempted, and can only -be changed within an application-specific completion function. -The quoting is effected via a call to the function pointed to +This is always zero when completion is attempted, +and can only be changed within an +application-specific completion function. +The quoting is performed via a call to the function pointed to by rl_filename_quoting_function.

    @@ -4797,10 +5124,11 @@ It should be set only by an application’s completion function.
    Variable: int rl_sort_completion_matches

    If an application sets this variable to 0, Readline will not sort the list of completions (which implies that it cannot remove any duplicate -completions). The default value is 1, which means that Readline will +completions). +The default value is 1, which means that Readline will sort the completions and, depending on the value of -rl_ignore_completion_duplicates, will attempt to remove duplicate -matches. +rl_ignore_completion_duplicates, will attempt to remove +duplicate matches.

    @@ -4808,23 +5136,26 @@ matches.

    Set to a character describing the type of completion Readline is currently attempting; see the description of rl_complete_internal() (see Completion Functions) for the list of characters. -This is set to the appropriate value before any application-specific -completion function is called, allowing such functions to present +This is set to the appropriate value before calling +any application-specific completion function, +so these functions can present the same interface as rl_complete().

    Variable: int rl_completion_invoking_key

    Set to the final character in the key sequence that invoked one of the -completion functions that call rl_complete_internal(). This is -set to the appropriate value before any application-specific completion -function is called. +completion functions that call rl_complete_internal(). +This is set to the appropriate value before calling +any application-specific completion function.

    Variable: int rl_inhibit_completion
    -

    If this variable is non-zero, completion is inhibited. The completion -character will be inserted as any other bound to self-insert. +

    If this variable is non-zero, Readline does not perform completion, +even if a key binding indicates it should. +The completion character +is inserted as if it were bound to self-insert.


    @@ -4837,10 +5168,12 @@ Previous:

    Here is a small application demonstrating the use of the GNU Readline -library. It is called fileman, and the source code resides in -examples/fileman.c. This sample application provides -completion of command names, line editing features, and access to the -history list. +library. +It is called fileman, and the source code resides in +examples/fileman.c. +This sample application provides +command name completion, line editing features, +and access to the history list.

    /* fileman.c -- A tiny application which demonstrates how to use the
    @@ -5984,9 +6317,10 @@ Previous: , U
     editing-modeReadline Init File Syntax
     emacs-editing-mode (C-e)Miscellaneous Commands
     emacs-mode-stringReadline Init File Syntax
    -enable-active-regionReadline Init File Syntax
    +enable-active-region TheReadline Init File Syntax
     enable-bracketed-pasteReadline Init File Syntax
     enable-keypadReadline Init File Syntax
    +enable-meta-keyReadline Init File Syntax
     end-kbd-macro (C-x ))Keyboard Macros
     end-of-file (usually C-d)Commands For Text
     end-of-history (M->)Commands For History
    @@ -5994,9 +6328,11 @@ Previous: , U
     exchange-point-and-mark (C-x C-x)Miscellaneous Commands
     execute-named-command (M-x)Miscellaneous Commands
     expand-tildeReadline Init File Syntax
    +export-completions ()Commands For Completion
     
    F fetch-history ()Commands For History +force-meta-prefixReadline Init File Syntax forward-backward-delete-char ()Commands For Text forward-char (C-f)Commands For Moving forward-search-history (C-s)Commands For History @@ -6230,7 +6566,7 @@ Previous: , U rl_redisplayRedisplay rl_redisplay_functionReadline Variables rl_reparse_colorsMiscellaneous Functions -rl_replace_lineUtility Functions +rl_replace_lineModifying Text rl_reset_after_signalReadline Signal Handling rl_reset_line_stateRedisplay rl_reset_screen_sizeReadline Signal Handling diff --git a/doc/readline.info b/doc/readline.info index 64e7d6c..3ad1ccb 100644 --- a/doc/readline.info +++ b/doc/readline.info @@ -1,10 +1,10 @@ This is readline.info, produced by makeinfo version 7.1 from rlman.texi. -This manual describes the GNU Readline Library (version 8.3, 19 January +This manual describes the GNU Readline Library (version 8.3, 29 November 2024), a library which aids in the consistency of user interface across discrete programs which provide a command line interface. - Copyright © 1988-2022 Free Software Foundation, Inc. + Copyright © 1988-2024 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, @@ -63,33 +63,46 @@ File: readline.info, Node: Introduction and Notation, Next: Readline Interacti 1.1 Introduction to Line Editing ================================ -The following paragraphs describe the notation used to represent -keystrokes. +The following paragraphs use Emacs style to describe the notation used +to represent keystrokes. The text ‘C-k’ is read as 'Control-K' and describes the character produced when the key is pressed while the Control key is depressed. The text ‘M-k’ is read as 'Meta-K' and describes the character produced when the Meta key (if you have one) is depressed, and the -key is pressed. The Meta key is labeled on many keyboards. On -keyboards with two keys labeled (usually to either side of the -space bar), the on the left side is generally set to work as a -Meta key. The key on the right may also be configured to work as -a Meta key or may be configured as some other modifier, such as a +key is pressed (a “meta character”), then both are released. The Meta +key is labeled or

    -

    The following paragraphs describe the notation used to represent -keystrokes. +

    The following paragraphs use Emacs style to +describe the notation used to represent keystrokes.

    The text C-k is read as ‘Control-K’ and describes the character produced when the k key is pressed while the Control key @@ -149,29 +150,45 @@ is depressed.

    The text M-k is read as ‘Meta-K’ and describes the character produced when the Meta key (if you have one) is depressed, and the k -key is pressed. -The Meta key is labeled ALT on many keyboards. +key is pressed (a meta character), then both are released. +The Meta key is labeled ALT or Option on many keyboards. On keyboards with two keys labeled ALT (usually to either side of the space bar), the ALT on the left side is generally set to work as a Meta key. -The ALT key on the right may also be configured to work as a -Meta key or may be configured as some other modifier, such as a +One of the ALT keys may also be configured +as some other modifier, such as a Compose key for typing accented characters.

    +

    On some keyboards, the Meta key modifier produces characters with +the eighth bit (0200) set. +You can use the enable-meta-key variable +to control whether or not it does this, if the keyboard allows it. +On many others, the terminal or terminal emulator converts the metafied +key to a key sequence beginning with ESC as described in the +next paragraph. +

    If you do not have a Meta or ALT key, or another key working as -a Meta key, the identical keystroke can be generated by typing ESC +a Meta key, you can generally achieve the latter effect by typing ESC first, and then typing k. -Either process is known as metafying the k key. +The ESC character is known as the meta prefix). +

    +

    Either process is known as metafying the k key. +

    +

    If your Meta key produces a key sequence with the ESC meta prefix, +you can make M-key key bindings you specify +(see Key Bindings in Readline Init File Syntax) +do the same thing by setting the force-meta-prefix variable.

    The text M-C-k is read as ‘Meta-Control-k’ and describes the -character produced by metafying C-k. +character produced by metafying C-k.

    -

    In addition, several keys have their own names. Specifically, +

    In addition, several keys have their own names. +Specifically, DEL, ESC, LFD, SPC, RET, and TAB all stand for themselves when seen in this text, or in an init file (see Readline Init File). If your keyboard lacks a LFD key, typing C-j will -produce the desired character. +output the appropriate character. The RET key may be labeled Return or Enter on some keyboards.

    @@ -186,13 +203,15 @@ Next:

    Often during an interactive session you type in a long line of text, -only to notice that the first word on the line is misspelled. The -Readline library gives you a set of commands for manipulating the text +only to notice that the first word on the line is misspelled. +The Readline library gives you a set of commands for manipulating the text as you type it in, allowing you to just fix your typo, and not forcing -you to retype the majority of the line. Using these editing commands, +you to retype the majority of the line. +Using these editing commands, you move the cursor to the place that needs correction, and delete or -insert the text of the corrections. Then, when you are satisfied with -the line, you simply press RET. You do not have to be at the +insert the text of the corrections. +Then, when you are satisfied with the line, you simply press RET. +You do not have to be at the end of the line to press RET; the entire line is accepted regardless of the location of the cursor within the line.

    @@ -215,23 +234,27 @@ Next: -

    In order to enter characters into the line, simply type them. The typed +

    In order to enter characters into the line, simply type them. +The typed character appears where the cursor was, and then the cursor moves one -space to the right. If you mistype a character, you can use your +space to the right. +If you mistype a character, you can use your erase character to back up and delete the mistyped character.

    Sometimes you may mistype a character, and -not notice the error until you have typed several other characters. In -that case, you can type C-b to move the cursor to the left, and then -correct your mistake. Afterwards, you can move the cursor to the right -with C-f. +not notice the error until you have typed several other characters. +In that case, you can type C-b to move the cursor to the left, +and then correct your mistake. +Afterwards, you can move the cursor to the right with C-f.

    When you add text in the middle of a line, you will notice that characters to the right of the cursor are ‘pushed over’ to make room for the text -that you have inserted. Likewise, when you delete text behind the cursor, +that you have inserted. +Likewise, when you delete text behind the cursor, characters to the right of the cursor are ‘pulled back’ to fill in the -blank space created by the removal of the text. A list of the bare -essentials for editing the text of an input line follows. +blank space created by the removal of the text. +These are the bare +essentials for editing the text of an input line:

    C-b
    @@ -250,15 +273,15 @@ essentials for editing the text of an input line follows.

    Insert the character into the line at the cursor.

    C-_ or C-x C-u
    -

    Undo the last editing command. You can undo all the way back to an -empty line. +

    Undo the last editing command. +You can undo all the way back to an empty line.

    -

    (Depending on your configuration, the Backspace key might be set to +

    Depending on your configuration, the Backspace key might be set to delete the character to the left of the cursor and the DEL key set to delete the character underneath the cursor, like C-d, rather -than the character to the left of the cursor.) +than the character to the left of the cursor.


    @@ -269,12 +292,11 @@ Next:

    -

    The above table describes the most basic keystrokes that you need -in order to do editing of the input line. For your convenience, many -other commands have been added in addition to C-b, C-f, -C-d, and DEL. Here are some commands for moving more rapidly -about the line. +in order to do editing of the input line. +For your convenience, many other commands are available in +addition to C-b, C-f, C-d, and DEL. +Here are some commands for moving more rapidly within the line.

    C-a
    @@ -295,7 +317,8 @@ about the line.

    Notice how C-f moves forward a character, while M-f moves -forward a word. It is a loose convention that control keystrokes +forward a word. +It is a loose convention that control keystrokes operate on characters while meta keystrokes operate on words.


    @@ -321,8 +344,8 @@ place later.

    When you use a kill command, the text is saved in a kill-ring. Any number of consecutive kills save all of the killed text together, so -that when you yank it back, you get it all. The kill -ring is not line specific; the text that you killed on a previously +that when you yank it back, you get it all. +The kill ring is not line specific; the text that you killed on a previously typed line is available to be yanked back later, when you are typing another line. @@ -347,14 +370,16 @@ Word boundaries are the same as those used by M-b.

    C-w
    -

    Kill from the cursor to the previous whitespace. This is different than +

    Kill from the cursor to the previous whitespace. +This is different than M-DEL because the word boundaries differ.

    Here is how to yank the text back into the line. Yanking -means to copy the most-recently-killed text from the kill buffer. +means to copy the most-recently-killed text from the kill buffer +into the line at the current cursor position.

    C-y
    @@ -362,8 +387,8 @@ means to copy the most-recently-killed text from the kill buffer.

    M-y
    -

    Rotate the kill-ring, and yank the new top. You can only do this if -the prior command is C-y or M-y. +

    Rotate the kill-ring, and yank the new top. +You can only do this if the prior command is C-y or M-y.

    @@ -376,18 +401,23 @@ Next:

    -

    You can pass numeric arguments to Readline commands. Sometimes the +

    You can pass numeric arguments to Readline commands. +Sometimes the argument acts as a repeat count, other times it is the sign of the -argument that is significant. If you pass a negative argument to a +argument that is significant. +If you pass a negative argument to a command which normally acts in a forward direction, that command will -act in a backward direction. For example, to kill text back to the +act in a backward direction. +For example, to kill text back to the start of the line, you might type ‘M-- C-k’.

    The general way to pass numeric arguments to a command is to type meta -digits before the command. If the first ‘digit’ typed is a minus -sign (‘-’), then the sign of the argument will be negative. Once -you have typed one meta digit to get the argument started, you can type -the remainder of the digits, and then the command. For example, to give +digits before the command. +If the first ‘digit’ typed is a minus +sign (‘-’), then the sign of the argument will be negative. +Once you have typed one meta digit to get the argument started, you can +type the remainder of the digits, and then the command. +For example, to give the C-d command an argument of 10, you could type ‘M-1 0 C-d’, which will delete the next ten characters on the input line.

    @@ -410,23 +440,24 @@ As each character of the search string is typed, Readline displays the next entry from the history matching the string typed so far. An incremental search requires only as many characters as needed to find the desired history entry. -To search backward in the history for a particular string, type -C-r. Typing C-s searches forward through the history. +When using emacs editing mode, type C-r +to search backward in the history for a particular string. +Typing C-s searches forward through the history. The characters present in the value of the isearch-terminators variable are used to terminate an incremental search. If that variable has not been assigned a value, the ESC and -C-J characters will terminate an incremental search. -C-g will abort an incremental search and restore the original line. +C-j characters terminate an incremental search. +C-g aborts an incremental search and restores the original line. When the search is terminated, the history entry containing the search string becomes the current line.

    To find other matching entries in the history list, type C-r or C-s as appropriate. -This will search backward or forward in the history for the next +This searches backward or forward in the history for the next entry matching the search string typed so far. -Any other key sequence bound to a Readline command will terminate -the search and execute that command. -For instance, a RET will terminate the search and accept +Any other key sequence bound to a Readline command terminates +the search and executes that command. +For instance, a RET terminates the search and accepts the line, thereby executing the command from the history list. A movement command will terminate the search, make the last line found the current line, and begin editing. @@ -436,7 +467,7 @@ If two C-rs are typed without any intervening characters a new search string, Readline uses any remembered search string.

    Non-incremental searches read the entire search string before starting -to search for matching history lines. +to search for matching history entries. The search string may be typed by the user or be part of the contents of the current line.

    @@ -455,16 +486,15 @@ Next:

    There are only a few basic constructs allowed in the -Readline init file. Blank lines are ignored. +Readline init file. +Blank lines are ignored. Lines beginning with a ‘#’ are comments. Lines beginning with a ‘$’ indicate conditional -constructs (see Conditional Init Constructs). Other lines -denote variable settings and key bindings. +constructs (see Conditional Init Constructs). +Other lines denote variable settings and key bindings.

    Variable Settings
    @@ -509,8 +540,8 @@ change from the default Emacs-like key binding to use
    set editing-mode vi
     
    -

    Variable names and values, where appropriate, are recognized without regard -to case. +

    Variable names and values, where appropriate, are recognized without +regard to case. Unrecognized variable names are ignored.

    Boolean variables (those that can be set to on or off) are set to on if @@ -551,8 +582,8 @@ A sample value might be ‘\e[0m’.

bell-style

Controls what happens when Readline wants to ring the terminal bell. -If set to ‘none’, Readline never rings the bell. If set to -‘visible’, Readline uses a visible bell if one is available. +If set to ‘none’, Readline never rings the bell. +If set to ‘visible’, Readline uses a visible bell if one is available. If set to ‘audible’ (the default), Readline attempts to ring the terminal’s bell.

@@ -569,8 +600,8 @@ including the special control characters (usually cchars
blink-matching-paren

If set to ‘on’, Readline attempts to briefly move the cursor to an -opening parenthesis when a closing parenthesis is inserted. The default -is ‘off’. +opening parenthesis when a closing parenthesis is inserted. +The default is ‘off’.

colored-completion-prefix
@@ -593,9 +624,9 @@ The default is ‘off’.

comment-begin
-

The string to insert at the beginning of the line when the -insert-comment command is executed. The default value -is "#". +

The string to insert at the beginning of the line by the +insert-comment command. +The default value is "#".

completion-display-width
@@ -603,7 +634,7 @@ is "#". when performing completion. The value is ignored if it is less than 0 or greater than the terminal screen width. -A value of 0 will cause matches to be displayed one per line. +A value of 0 causes matches to be displayed one per line. The default value is -1.

@@ -621,79 +652,90 @@ The default value is ‘off’.

completion-prefix-display-length
-

The length in characters of the common prefix of a list of possible -completions that is displayed without modification. When set to a -value greater than zero, common prefixes longer than this value are -replaced with an ellipsis when displaying possible completions. +

The maximum +length in characters of the common prefix of a list of possible +completions that is displayed without modification. +When set to a value greater than zero, Readline +replaces common prefixes longer than this value +with an ellipsis when displaying possible completions. +If a completion begins with a period, +and Readline is completing filenames, +it uses three underscores instead of an ellipsis.

completion-query-items
-

The number of possible completions that determines when the user is -asked whether the list of possibilities should be displayed. -If the number of possible completions is greater than or equal to this value, -Readline will ask whether or not the user wishes to view them; -otherwise, they are simply listed. +

The number of possible completions that determines when the user is asked +whether the list of possibilities should be displayed. +If the number of possible completions is greater than +or equal to this value, +Readline asks whether or not the user wishes to view them; +otherwise, Readline simply lists the completions. This variable must be set to an integer value greater than or equal to zero. -A zero value means Readline should never ask; negative values are -treated as zero. +A zero value means Readline should never ask; negative +values are treated as zero. The default limit is 100.

convert-meta
-

If set to ‘on’, Readline will convert characters with the -eighth bit set to an ASCII key sequence by stripping the eighth -bit and prefixing an ESC character, converting them to a -meta-prefixed key sequence. -The default value is ‘on’, but -will be set to ‘off’ if the locale is one that contains -eight-bit characters. +

If set to ‘on’, Readline converts characters it reads +that have the eighth bit set to an ASCII key sequence by +clearing the eighth bit and prefixing an ESC character, +converting them to a meta-prefixed key sequence. +The default value is ‘on’, but Readline sets it to ‘off’ +if the locale contains +characters whose encodings may include bytes with the eighth bit set. This variable is dependent on the LC_CTYPE locale category, and -may change if the locale is changed. +may change if the locale changes. +This variable also affects key bindings; +see the description of force-meta-prefix below.

disable-completion
-

If set to ‘On’, Readline will inhibit word completion. -Completion characters will be inserted into the line as if they had -been mapped to self-insert. The default is ‘off’. +

If set to ‘On’, Readline inhibits word completion. +Completion characters are inserted into the line as if they +had been mapped to self-insert. +The default is ‘off’.

echo-control-characters

When set to ‘on’, on operating systems that indicate they support it, Readline echoes a character corresponding to a signal generated from the -keyboard. The default is ‘on’. +keyboard. +The default is ‘on’.

editing-mode
-

The editing-mode variable controls which default set of -key bindings is used. By default, Readline starts up in Emacs editing -mode, where the keystrokes are most similar to Emacs. This variable can be -set to either ‘emacs’ or ‘vi’. +

The editing-mode variable controls the default set of +key bindings. +By default, Readline starts up in emacs editing mode, where +the keystrokes are most similar to Emacs. +This variable can be set to either ‘emacs’ or ‘vi’.

emacs-mode-string

If the show-mode-in-prompt variable is enabled, this string is displayed immediately before the last line of the primary -prompt when emacs editing mode is active. The value is expanded like a -key binding, so the standard set of meta- and control prefixes and +prompt when emacs editing mode is active. +The value is expanded like a +key binding, so the standard set of meta- and control- prefixes and backslash escape sequences is available. -Use the ‘\1’ and ‘\2’ escapes to begin and end sequences of +The ‘\1’ and ‘\2’ escapes begin and end sequences of non-printing characters, which can be used to embed a terminal control sequence into the mode string. The default is ‘@’.

-
enable-active-region
-

The point is the current cursor position, and mark refers -to a saved cursor position (see Commands For Moving). +

enable-active-region
+

point is the current cursor position, and mark refers to a +saved cursor position (see Commands For Moving). The text between the point and mark is referred to as the region. When this variable is set to ‘On’, Readline allows certain commands to designate the region as active. When the region is active, Readline highlights the text in the region using the value of the active-region-start-color, which defaults to the -string that enables -the terminal’s standout mode. +string that enables the terminal’s standout mode. The active region shows the text inserted by bracketed-paste and any -matching text found by incremental and non-incremental history searches. +matching text found by incremental and non-incremental history searches. The default is ‘On’.

@@ -702,34 +744,58 @@ The default is ‘On’. 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 bracketed paste mode; -it prevents Readline from executing any editing commands bound to key -sequences appearing in the pasted text. -The default is ‘On’. +it prevents Readline from executing any editing commands bound +to key sequences appearing in the pasted text. +The default is ‘On’.

enable-keypad
-

When set to ‘on’, Readline will try to enable the application -keypad when it is called. Some systems need this to enable the -arrow keys. The default is ‘off’. +

When set to ‘on’, Readline tries to enable the application +keypad when it is called. +Some systems need this to enable the arrow keys. +The default is ‘off’.

-
enable-meta-key
-

When set to ‘on’, Readline will try to enable any meta modifier -key the terminal claims to support when it is called. On many terminals, -the meta key is used to send eight-bit characters. +

enable-meta-key
+

When set to ‘on’, Readline tries to enable any meta +modifier key the terminal claims to support when it is called. +On many terminals, the Meta key is used to send eight-bit characters; +this variable checks for the terminal capability that indicates the +terminal can enable and disable a mode that sets the eighth bit of a +character (0200) if the Meta key is held down when the character is +typed (a meta character). The default is ‘on’.

expand-tilde
-

If set to ‘on’, tilde expansion is performed when Readline -attempts word completion. The default is ‘off’. +

If set to ‘on’, Readline attempts tilde expansion when it +attempts word completion. +The default is ‘off’. +

+
+
force-meta-prefix
+

If set to ‘on’, Readline modifies its behavior when binding key +sequences containing \M- or Meta- +(see Key Bindings in Readline Init File Syntax) +by converting a key sequence of the form +\M-C or Meta-C to the two-character sequence +ESC C (adding the meta prefix). +If force-meta-prefix is set to ‘off’ (the default), +Readline uses the value of the convert-meta variable to determine +whether to perform this conversion: +if convert-meta is ‘on’, +Readline performs the conversion described above; +if it is ‘off’, Readline converts C to a meta character by +setting the eighth bit (0200). +The default is ‘off’.

history-preserve-point

If set to ‘on’, the history code attempts to place the point (the current cursor position) at the same location on each history line retrieved with previous-history -or next-history. The default is ‘off’. +or next-history. +The default is ‘off’.

history-size
@@ -739,36 +805,37 @@ are saved. If set to a value less than zero, the number of history entries is not limited. By default, the number of history entries is not limited. -If an attempt is made to set history-size to a non-numeric value, +If you try to set history-size to a non-numeric value, the maximum number of history entries will be set to 500.

horizontal-scroll-mode
-

This variable can be set to either ‘on’ or ‘off’. Setting it -to ‘on’ means that the text of the lines being edited will scroll -horizontally on a single screen line when they are longer than the width -of the screen, instead of wrapping onto a new screen line. +

Setting this variable to ‘on’ means that the text of the lines +being edited will scroll horizontally on a single screen line when +the lines are longer than the width of the screen, instead of wrapping +onto a new screen line. This variable is automatically set to ‘on’ for terminals of height 1. By default, this variable is set to ‘off’.

input-meta
-

If set to ‘on’, Readline will enable eight-bit input (it -will not clear the eighth bit in the characters it reads), -regardless of what the terminal claims it can support. The -default value is ‘off’, but Readline will set it to ‘on’ if the -locale contains eight-bit characters. -The name meta-flag is a synonym for this variable. +

If set to ‘on’, Readline enables eight-bit input (that is, it +does not clear the eighth bit in the characters it reads), +regardless of what the terminal claims it can support. +The default value is ‘off’, but Readline sets it to ‘on’ +if the locale contains characters whose encodings may include bytes +with the eighth bit set. This variable is dependent on the LC_CTYPE locale category, and -may change if the locale is changed. +its value may change if the locale changes. +The name meta-flag is a synonym for input-meta.

isearch-terminators

The string of characters that should terminate an incremental search without subsequently executing the character as a command (see Searching for Commands in the History). If this variable has not been given a value, the characters ESC and -C-J will terminate an incremental search. +C-j terminate an incremental search.

keymap
@@ -785,43 +852,42 @@ Built-in keymap names are vi is equivalent to vi-command (vi-move is also a synonym); emacs is equivalent to emacs-standard. Applications may add additional names. -The default value is emacs. -The value of the editing-mode variable also affects the +The default value is emacs; +the value of the editing-mode variable also affects the default keymap.

keyseq-timeout
-

Specifies the duration Readline will wait for a character when reading an -ambiguous key sequence (one that can form a complete key sequence using -the input read so far, or can take additional input to complete a longer -key sequence). -If no input is received within the timeout, Readline will use the shorter -but complete key sequence. +

Specifies the duration Readline will wait for a character when +reading an ambiguous key sequence +(one that can form a complete key sequence using the input read so far, +or can take additional input to complete a longer key sequence). +If Readline doesn’t receive any input within the timeout, it uses the +shorter but complete key sequence. Readline uses this value to determine whether or not input is available on the current input source (rl_instream by default). The value is specified in milliseconds, so a value of 1000 means that Readline will wait one second for additional input. If this variable is set to a value less than or equal to zero, or to a -non-numeric value, Readline will wait until another key is pressed to +non-numeric value, Readline waits until another key is pressed to decide which key sequence to complete. The default value is 500.

mark-directories
-

If set to ‘on’, completed directory names have a slash -appended. The default is ‘on’. +

If set to ‘on’, completed directory names have a slash appended. +The default is ‘on’.

mark-modified-lines
-

This variable, when set to ‘on’, causes Readline to display an +

When this variable is set to ‘on’, Readline displays an asterisk (‘*’) at the start of history lines which have been modified. This variable is ‘off’ by default.

mark-symlinked-directories
-

If set to ‘on’, completed names which are symbolic links -to directories have a slash appended (subject to the value of -mark-directories). +

If set to ‘on’, completed names which are symbolic links to directories +have a slash appended, subject to the value of mark-directories. The default is ‘off’.

@@ -837,36 +903,45 @@ This variable is ‘on’ by default.
menu-complete-display-prefix

If set to ‘on’, menu completion displays the common prefix of the list of possible completions (which may be empty) before cycling through -the list. The default is ‘off’. +the list. +The default is ‘off’.

output-meta
-

If set to ‘on’, Readline will display characters with the +

If set to ‘on’, Readline displays characters with the eighth bit set directly rather than as a meta-prefixed escape sequence. -The default is ‘off’, but Readline will set it to ‘on’ if the -locale contains eight-bit characters. +The default is ‘off’, but Readline sets it to ‘on’ +if the locale contains characters whose encodings may include +bytes with the eighth bit set. This variable is dependent on the LC_CTYPE locale category, and -may change if the locale is changed. +its value may change if the locale changes.

page-completions
-

If set to ‘on’, Readline uses an internal more-like pager +

If set to ‘on’, Readline uses an internal pager resembling +more(1) to display a screenful of possible completions at a time. This variable is ‘on’ by default.

+
prefer-visible-bell
+

See bell-style. +

+
print-completions-horizontally
-

If set to ‘on’, Readline will display completions with matches +

If set to ‘on’, Readline displays completions with matches sorted horizontally in alphabetical order, rather than down the screen. The default is ‘off’.

revert-all-at-newline

If set to ‘on’, Readline will undo all changes to history lines -before returning when accept-line is executed. By default, +before returning when executing accept-line. +By default, history lines may be modified and retain individual undo lists across -calls to readline(). The default is ‘off’. +calls to readline(). +The default is ‘off’.

search-ignore-case
@@ -876,8 +951,8 @@ The default value is ‘off’.

show-all-if-ambiguous
-

This alters the default behavior of the completion functions. If -set to ‘on’, +

This alters the default behavior of the completion functions. +If set to ‘on’, words which have more than one possible completion cause the matches to be listed immediately instead of ringing the bell. The default value is ‘off’. @@ -903,15 +978,15 @@ The default value is ‘off’.

skip-completed-text

If set to ‘on’, this alters the default completion behavior when -inserting a single match into the line. It’s only active when -performing completion in the middle of a word. If enabled, Readline -does not insert characters from the completion that match characters -after point in the word being completed, so portions of the word -following the cursor are not duplicated. +inserting a single match into the line. +It’s only active when performing completion in the middle of a word. +If enabled, Readline does not insert characters from the completion +that match characters after point in the word being completed, +so portions of the word following the cursor are not duplicated. For instance, if this is enabled, attempting completion when the cursor -is after the ‘e’ in ‘Makefile’ will result in ‘Makefile’ -rather than ‘Makefilefile’, assuming there is a single possible -completion. +is after the first ‘e’ in ‘Makefile’ will result in +‘Makefile’ rather than ‘Makefilefile’, +assuming there is a single possible completion. The default value is ‘off’.

@@ -919,10 +994,9 @@ The default value is ‘off’.

If the show-mode-in-prompt variable is enabled, this string is displayed immediately before the last line of the primary prompt when vi editing mode is active and in command mode. -The value is expanded like a -key binding, so the standard set of meta- and control prefixes and -backslash escape sequences is available. -Use the ‘\1’ and ‘\2’ escapes to begin and end sequences of +The value is expanded like a key binding, so the standard set of +meta- and control- prefixes and backslash escape sequences is available. +The ‘\1’ and ‘\2’ escapes begin and end sequences of non-printing characters, which can be used to embed a terminal control sequence into the mode string. The default is ‘(cmd)’. @@ -932,10 +1006,9 @@ The default is ‘(cmd)’.

If the show-mode-in-prompt variable is enabled, this string is displayed immediately before the last line of the primary prompt when vi editing mode is active and in insertion mode. -The value is expanded like a -key binding, so the standard set of meta- and control prefixes and -backslash escape sequences is available. -Use the ‘\1’ and ‘\2’ escapes to begin and end sequences of +The value is expanded like a key binding, so the standard set of +meta- and control- prefixes and backslash escape sequences is available. +The ‘\1’ and ‘\2’ escapes begin and end sequences of non-printing characters, which can be used to embed a terminal control sequence into the mode string. The default is ‘(ins)’. @@ -944,16 +1017,18 @@ The default is ‘(ins)’.

visible-stats

If set to ‘on’, a character denoting a file’s type is appended to the filename when listing possible -completions. The default is ‘off’. +completions. +The default is ‘off’.

Key Bindings
-

The syntax for controlling key bindings in the init file is -simple. First you need to find the name of the command that you -want to change. The following sections contain tables of the command +

The syntax for controlling key bindings in the init file is simple. +First you need to find the name of the command that you +want to change. +The following sections contain tables of the command name, the default keybinding, if any, and a short description of what the command does.

@@ -968,11 +1043,14 @@ what you find most comfortable.

In addition to command names, Readline allows keys to be bound to a string that is inserted when the key is pressed (a macro). +The difference between a macro and a command is that a macro is +enclosed in single or double quotes.

keynamefunction-name or macro
-

keyname is the name of a key spelled out in English. For example: +

keyname is the name of a key spelled out in English. +For example:

Control-u: universal-argument
 Meta-Rubout: backward-kill-word
@@ -986,8 +1064,7 @@ Control-o: "> output"
 expressed on the right hand side (that is, to insert the text
 ‘> output’ into the line).
 

-

A number of symbolic character names are recognized while -processing this key binding syntax: +

This key binding syntax recognizes a number of symbolic character names: DEL, ESC, ESCAPE, @@ -995,7 +1072,8 @@ processing this key binding syntax: NEWLINE, RET, RETURN, -RUBOUT, +RUBOUT +(a destructive backspace), SPACE, SPC, and @@ -1005,9 +1083,10 @@ and

"keyseq": function-name or macro

keyseq differs from keyname above in that strings denoting an entire key sequence can be specified, by placing -the key sequence in double quotes. Some GNU Emacs style key -escapes can be used, as in the following example, but the -special character names are not recognized. +the key sequence in double quotes. +Some GNU Emacs style key escapes can be used, +as in the following example, but none of the +special character names are recognized.

"\C-u": universal-argument
@@ -1029,22 +1108,24 @@ specifying key sequences:
 

\C-
-

control prefix +

A control prefix.

\M-
-

meta prefix +

Adding the meta prefix or converting the following character to a meta +character, as described above under force-meta-prefix +(see Variable Settings in Readline Init File Syntax).

\e
-

an escape character +

An escape character.

\\
-

backslash +

Backslash.

\"
-

", a double quotation mark +

", a double quotation mark.

\'
-

', a single quote or apostrophe +

', a single quote or apostrophe.

@@ -1077,19 +1158,20 @@ set of backslash escapes is available:

vertical tab

\nnn
-

the eight-bit character whose value is the octal value nnn -(one to three digits) +

The eight-bit character whose value is the octal value nnn +(one to three digits).

\xHH
-

the eight-bit character whose value is the hexadecimal value HH -(one or two hex digits) +

The eight-bit character whose value is the hexadecimal value HH +(one or two hex digits).

When entering the text of a macro, single or double quotes must be used to indicate a macro definition. Unquoted text is assumed to be a function name. -In the macro body, the backslash escapes described above are expanded. +Tthe backslash escapes described above are expanded +in the macro body. Backslash will quote any other character in the macro text, including ‘"’ and ‘'’. For example, the following binding will make ‘C-x \’ @@ -1113,13 +1195,15 @@ Next: ,

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 -of tests. There are four parser directives used. +of tests. +There are four parser directives available.

$if

The $if construct allows bindings to be made based on the editing mode, the terminal being used, or the application using -Readline. The text of the test, after any comparison operator, +Readline. +The text of the test, after any comparison operator, extends to the end of the line; unless otherwise noted, no characters are required to isolate it.

@@ -1136,11 +1220,13 @@ Readline is starting out in emacs mode.
term

The term= form may be used to include terminal-specific key bindings, perhaps to bind the key sequences output by the -terminal’s function keys. The word on the right side of the -‘=’ is tested against both the full name of the terminal and -the portion of the terminal name before the first ‘-’. This -allows sun to match both sun and sun-cmd, -for instance. +terminal’s function keys. +The word on the right side of the +‘=’ +is tested against both the full name of the terminal and the portion +of the terminal name before the first ‘-’. +This allows xterm to match both xterm and +xterm-256color, for instance.

version
@@ -1152,8 +1238,9 @@ The set of comparison operators includes and ‘>’. The version number supplied on the right side of the operator consists of a major version number, an optional decimal point, and an optional -minor version (e.g., ‘7.1’). If the minor version is omitted, it -is assumed to be ‘0’. +minor version (e.g., ‘7.1’). +If the minor version is omitted, it +defaults to ‘0’. The operator may be separated from the string version and from the version number argument by whitespace. The following example sets a variable if the Readline version being used @@ -1167,11 +1254,13 @@ $endif
application

The application construct is used to include -application-specific settings. Each program using the Readline +application-specific settings. +Each program using the Readline library sets the application name, and you can test for a particular value. This could be used to bind key sequences to functions useful for -a specific program. For instance, the following command adds a +a specific program. +For instance, the following command adds a key sequence that quotes the current or previous word in Bash:

$if Bash
@@ -1188,7 +1277,8 @@ The permitted comparison operators are ‘=’
 The variable name must be separated from the comparison operator by
 whitespace; the operator may be separated from the value on the right hand
 side by whitespace.
-Both string and boolean variables may be tested. Boolean variables must be
+String and boolean variables may be tested.
+Boolean variables must be
 tested against the values on and off.
 The following example is equivalent to the mode=emacs test described
 above:
@@ -1200,20 +1290,20 @@ $endif
 
- -
$endif
-

This command, as seen in the previous example, terminates an -$if command. -

$else

Commands in this branch of the $if directive are executed if the test fails.

+
$endif
+

This command, as seen in the previous example, terminates an +$if command. +

+
$include

This directive takes a single filename as an argument and reads commands -and bindings from that file. +and key bindings from that file. For example, the following directive reads from /etc/inputrc:

$include /etc/inputrc
@@ -1354,6 +1444,12 @@ Command names without an accompanying key sequence are unbound by default.
 position, and mark refers to a cursor position saved by the
 set-mark command.
 The text between the point and mark is referred to as the region.
+Readline has the concept of an active region:
+when the region is active,
+Readline redisplay highlights the region using the
+value of the active-region-start-color variable.
+The enable-active-region variable turns this on and off.
+Several commands set the region to active; those are noted below.
 

  • Commands For Moving
  • @@ -1375,18 +1471,22 @@ Next:
    beginning-of-line (C-a)

    Move to the start of the current line. +This may also be bound to the Home key on some keyboards.

    end-of-line (C-e)

    Move to the end of the line. +This may also be bound to the End key on some keyboards.

    forward-char (C-f)

    Move forward a character. +This may also be bound to the right arrow key on some keyboards.

    backward-char (C-b)

    Move back a character. +This may also be bound to the left arrow key on some keyboards.

    forward-word (M-f)
    @@ -1402,14 +1502,16 @@ Words are composed of letters and digits.
previous-screen-line ()

Attempt to move point to the same physical screen column on the previous -physical screen line. This will not have the desired effect if the current +physical screen line. +This will not have the desired effect if the current Readline line does not take up more than one physical line or if point is not greater than the length of the prompt plus the screen width.

next-screen-line ()

Attempt to move point to the same physical screen column on the next -physical screen line. This will not have the desired effect if the current +physical screen line. +This will not have the desired effect if the current 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. @@ -1445,19 +1547,20 @@ Next:

accept-line (Newline or Return)

Accept the line regardless of where the cursor is. -If this line is -non-empty, it may be added to the history list for future recall with +If this line is non-empty, you can add it to the history list using add_history(). -If this line is a modified history line, the history line is restored +If this line is a modified history line, then restore the history line to its original state.

previous-history (C-p)

Move ‘back’ through the history list, fetching the previous command. +This may also be bound to the up arrow key on some keyboards.

next-history (C-n)

Move ‘forward’ through the history list, fetching the next command. +This may also be bound to the down arrow key on some keyboards.

beginning-of-history (M-<)
@@ -1471,14 +1574,16 @@ being entered.
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. +the history as necessary. +This is an incremental search. +This command sets the region to the matched text and activates the region.

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. +the history as necessary. +This is an incremental search. +This command sets the region to the matched text and activates the region.

non-incremental-reverse-search-history (M-p)
@@ -1495,32 +1600,34 @@ for a string supplied by the user. The search string may match anywhere in a history line.

-
history-search-forward ()
-

Search forward through the history for the string of characters +

history-search-backward ()
+

Search backward through the history for the string of characters between the start of the current line and the point. The search string must match at the beginning of a history line. This is a non-incremental search. -By default, this command is unbound. +By default, this command is unbound, but may be bound to the Page Down +key on some keyboards.

-
history-search-backward ()
-

Search backward through the history for the string of characters +

history-search-forward ()
+

Search forward through the history for the string of characters between the start of the current line and the point. The search string must match at the beginning of a history line. This is a non-incremental search. -By default, this command is unbound. +By default, this command is unbound, but may be bound to the Page Up +key on some keyboards.

-
history-substring-search-forward ()
-

Search forward through the history for the string of characters +

history-substring-search-backward ()
+

Search backward through the history for the string of characters between the start of the current line and the point. The search string may match anywhere in a history line. This is a non-incremental search. By default, this command is unbound.

-
history-substring-search-backward ()
-

Search backward through the history for the string of characters +

history-substring-search-forward ()
+

Search forward through the history for the string of characters between the start of the current line and the point. The search string may match anywhere in a history line. This is a non-incremental search. @@ -1532,10 +1639,13 @@ By default, this command is unbound. the second word on the previous line) at point. With an argument n, insert the nth word from the previous command (the words -in the previous command begin with word 0). A negative argument -inserts the nth word from the end of the previous command. -Once the argument n is computed, the argument is extracted -as if the ‘!n’ history expansion had been specified. +in the previous command begin with word 0). +A negative argument inserts the nth word from the end of +the previous command. +Once the argument n is computed, +this uses the history expansion facilities to extract the +nth word, as if the +‘!n’ history expansion had been specified.

yank-last-arg (M-. or M-_)
@@ -1546,10 +1656,12 @@ Successive calls to yank-last-arg move back through th list, inserting the last word (or the word specified by the argument to the first call) of each line in turn. Any numeric argument supplied to these successive calls determines -the direction to move through the history. A negative argument switches -the direction through the history (back or forward). -The history expansion facilities are used to extract the last argument, -as if the ‘!$’ history expansion had been specified. +the direction to move through the history. +A negative argument switches the direction through the history +(back or forward). +This uses the history expansion facilities to extract the +last word, as if the +‘!$’ history expansion had been specified.

operate-and-get-next (C-o)
@@ -1557,8 +1669,8 @@ as if the ‘!$’ history expansion had been newline had been entered, and fetch the next line relative to the current line from the history for editing. -A numeric argument, if supplied, specifies the history entry to use instead -of the current line. +A numeric argument, if supplied, specifies the history entry +to use instead of the current line.

fetch-history ()
@@ -1581,31 +1693,37 @@ Next:
end-of-file (usually C-d)

The character indicating end-of-file as set, for example, by -stty. If this character is read when there are no characters +stty. +If this character is read when there are no characters on the line, and point is at the beginning of the line, Readline interprets it as the end of input and returns EOF.

delete-char (C-d)
-

Delete the character at point. If this function is bound to the +

Delete the character at point. +If this function is bound to the same character as the tty EOF character, as C-d commonly is, see above for the effects. +This may also be bound to the Delete key on some keyboards.

backward-delete-char (Rubout)
-

Delete the character behind the cursor. A numeric argument means -to kill the characters instead of deleting them. +

Delete the character behind the cursor. +A numeric argument means +to kill the characters, saving them on the kill ring, +instead of deleting them.

forward-backward-delete-char ()

Delete the character under the cursor, unless the cursor is at the end of the line, in which case the character behind the cursor is -deleted. By default, this is not bound to a key. +deleted. +By default, this is not bound to a key.

quoted-insert (C-q or C-v)
-

Add the next character typed to the line verbatim. This is -how to insert key sequences like C-q, for example. +

Add the next character typed to the line verbatim. +This is how to insert key sequences like C-q, for example.

tab-insert (M-TAB)
@@ -1613,27 +1731,28 @@ how to insert key sequences like C-q, for example.

self-insert (a, b, A, 1, !, …)
-

Insert yourself. +

Insert the character typed.

bracketed-paste-begin ()

This function is intended to be bound to the "bracketed paste" escape sequence sent by some terminals, and such a binding is assigned by default. It allows Readline to insert the pasted text as a single unit without treating -each character as if it had been read from the keyboard. The characters +each character as if it had been read from the keyboard. +The characters are inserted as if each one was bound to 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 active mark: when the -mark is active, Readline redisplay uses the terminal’s standout mode to -denote the region. +to the inserted text. +It sets the active region.

transpose-chars (C-t)

Drag the character before the cursor forward over the character at the cursor, moving the -cursor forward as well. If the insertion point +cursor forward as well. +If the insertion point is at the end of the line, then this transposes the last two characters of the line. Negative arguments have no effect. @@ -1648,25 +1767,29 @@ the last two words on the line.

upcase-word (M-u)
-

Uppercase the current (or following) word. With a negative argument, +

Uppercase the current (or following) word. +With a negative argument, uppercase the previous word, but do not move the cursor.

downcase-word (M-l)
-

Lowercase the current (or following) word. With a negative argument, +

Lowercase the current (or following) word. +With a negative argument, lowercase the previous word, but do not move the cursor.

capitalize-word (M-c)
-

Capitalize the current (or following) word. With a negative argument, +

Capitalize the current (or following) word. +With a negative argument, capitalize the previous word, but do not move the cursor.

overwrite-mode ()
-

Toggle overwrite mode. With an explicit positive numeric argument, -switches to overwrite mode. With an explicit non-positive numeric -argument, switches to insert mode. This command affects only -emacs mode; vi mode does overwrite differently. +

Toggle overwrite mode. +With an explicit positive numeric argument, switches to overwrite mode. +With an explicit non-positive numeric argument, switches to insert mode. +This command affects only emacs mode; +vi mode does overwrite differently. Each call to readline() starts in insert mode.

In overwrite mode, characters bound to self-insert replace @@ -1674,7 +1797,8 @@ the text at point rather than pushing the text to the right. Characters bound to backward-delete-char replace the character before point with a space.

-

By default, this command is unbound. +

By default, this command is unbound, but may be bound to the Insert +key on some keyboards.

@@ -1690,15 +1814,15 @@ Next:
kill-line (C-k)
-

Kill the text from point to the end of the line. +

Kill the text from point to the end of the current line. With a negative numeric argument, kill backward from the cursor to the -beginning of the current line. +beginning of the line.

backward-kill-line (C-x Rubout)

Kill backward from the cursor to the beginning of the current line. With a negative numeric argument, kill forward from the cursor to the -end of the current line. +end of the line.

unix-line-discard (C-u)
@@ -1723,18 +1847,19 @@ Word boundaries are the same as backward-word.
unix-word-rubout (C-w)
-

Kill the word behind point, using white space as a word boundary. -The killed text is saved on the kill-ring. +

Kill the word behind point, using white space as a word boundary, +saving the killed text on the kill-ring.

unix-filename-rubout ()

Kill the word behind point, using white space and the slash character -as the word boundaries. -The killed text is saved on the kill-ring. +as the word boundaries, +saving the killed text on the kill-ring.

delete-horizontal-space ()
-

Delete all spaces and tabs around point. By default, this is unbound. +

Delete all spaces and tabs around point. +By default, this is unbound.

kill-region ()
@@ -1744,7 +1869,8 @@ By default, this command is unbound.
copy-region-as-kill ()

Copy the text in the region to the kill buffer, so it can be yanked -right away. By default, this command is unbound. +right away. +By default, this command is unbound.

copy-backward-word ()
@@ -1764,7 +1890,8 @@ By default, this command is unbound.

yank-pop (M-y)
-

Rotate the kill-ring, and yank the new top. You can only do this if +

Rotate the kill-ring, and yank the new top. +You can only do this if the prior command is yank or yank-pop.

@@ -1780,7 +1907,8 @@ Next:
digit-argument (M-0, M-1, … M--)

Add this digit to the argument already accumulating, or start a new -argument. M-- starts a negative argument. +argument. +M-- starts a negative argument.

universal-argument ()
@@ -1824,20 +1952,21 @@ the environment variable COLUMNS, or the screen width,
insert-completions (M-*)

Insert all completions of the text before point that would have -been generated by possible-completions. +been generated by possible-completions, +separated by a space.

menu-complete ()

Similar to complete, but replaces the word to be completed with a single match from the list of possible completions. -Repeated execution of menu-complete steps through the list +Repeatedly executing menu-complete steps through the list of possible completions, inserting each match in turn. -At the end of the list of completions, the bell is rung +At the end of the list of completions, +menu-complete rings the bell (subject to the setting of bell-style) -and the original text is restored. +and restores the original text. An argument of n moves n positions forward in the list -of matches; a negative argument may be used to move backward -through the list. +of matches; a negative argument moves backward through the list. This command is intended to be bound to TAB, but is unbound by default.

@@ -1846,13 +1975,42 @@ by default.

Identical to menu-complete, but moves backward through the list of possible completions, as if menu-complete had been given a negative argument. +This command is unbound by default. +

+
+
export-completions ()
+

Perform completion on the word before point as described above +and write the list of possible completions to Readline’s output stream +using the following format, writing information on separate lines: +

+
    +
  • the number of matches N; +
  • the word being completed; +
  • S:E, +where S and E are the start and end offsets of the word +in the Readline line buffer; then +
  • each match, one per line +
+ +

If there are no matches, the first line will be “0”, +and this command does not print any output after the S:E. +If there is only a single match, this prints a single line containing it. +If there is more than one match, this prints the common prefix of the +matches, which may be empty, on the first line after the S:E, +then the matches on subsequent lines. +In this case, N will include the first line with the common prefix. +

+

The user or application +should be able to accommodate the possibility of a blank line. +The intent is that the user or application reads N lines after +the line containing S:E to obtain the match list. +This command is unbound by default.

delete-char-or-list ()

Deletes the character under the cursor if not at the beginning or end of the line (like delete-char). -If at the end of the line, behaves identically to -possible-completions. +At the end of the line, it behaves identically to possible-completions. This command is unbound by default.

@@ -1915,9 +2073,8 @@ The behavior is undefined if x is already lower case.

prefix-meta (ESC)
-

Metafy the next character typed. This is for keyboards -without a meta key. Typing ‘ESC f’ is equivalent to typing -M-f. +

Metafy the next character typed. +Typing ‘ESC f’ is equivalent to typing M-f.

undo (C-_ or C-x C-u)
@@ -1925,8 +2082,9 @@ without a meta key. Typing ‘ESC

revert-line (M-r)
-

Undo all changes made to this line. This is like executing the undo -command enough times to get back to the beginning. +

Undo all changes made to this line. +This is like executing the undo +command enough times to get back to the initial state.

tilde-expand (M-~)
@@ -1934,66 +2092,83 @@ command enough times to get back to the beginning.

set-mark (C-@)
-

Set the mark to the point. If a -numeric argument is supplied, the mark is set to that position. +

Set the mark to the point. +If a numeric argument is supplied, set the mark to that position.

exchange-point-and-mark (C-x C-x)
-

Swap the point with the mark. The current cursor position is set to -the saved position, and the old cursor position is saved as the mark. +

Swap the point with the mark. +Set the current cursor position to the saved position, +then set the mark to the old cursor position.

character-search (C-])
-

A character is read and point is moved to the next occurrence of that -character. A negative argument searches for previous occurrences. +

Read a character and move point to the next occurrence of that character. +A negative argument searches for previous occurrences.

character-search-backward (M-C-])
-

A character is read and point is moved to the previous occurrence -of that character. A negative argument searches for subsequent -occurrences. +

Read a character and move point to the previous occurrence of that character. +A negative argument searches for subsequent occurrences.

skip-csi-sequence ()

Read enough characters to consume a multi-key sequence such as those -defined for keys like Home and End. Such sequences begin with a -Control Sequence Indicator (CSI), usually ESC-[. If this sequence is -bound to "\e[", keys producing such sequences will have no effect -unless explicitly bound to a Readline command, instead of inserting -stray characters into the editing buffer. This is unbound by default, -but usually bound to ESC-[. +defined for keys like Home and End. +CSI sequences begin with a Control Sequence Indicator (CSI), usually +ESC [. +If this sequence is bound to "\e[", +keys producing CSI sequences have no effect +unless explicitly bound to a Readline command, +instead of inserting stray characters into the editing buffer. +This is unbound by default, but usually bound to +ESC [.

insert-comment (M-#)
-

Without a numeric argument, the value of the comment-begin -variable is inserted at the beginning of the current line. +

Without a numeric argument, insert the value of the comment-begin +variable at the beginning of the current line. If a numeric argument is supplied, this command acts as a toggle: if the characters at the beginning of the line do not match the value -of comment-begin, the value is inserted, otherwise -the characters in comment-begin are deleted from the beginning of -the line. +of comment-begin, insert the value; otherwise delete +the characters in comment-begin from the beginning of the line. In either case, the line is accepted as if a newline had been typed.

dump-functions ()
-

Print all of the functions and their key bindings to the -Readline output stream. If a numeric argument is supplied, +

Print all of the functions and their key bindings +to the Readline output stream. +If a numeric argument is supplied, the output is formatted in such a way that it can be made part -of an inputrc file. This command is unbound by default. +of an inputrc file. +This command is unbound by default.

dump-variables ()
-

Print all of the settable variables and their values to the -Readline output stream. If a numeric argument is supplied, +

Print all of the settable variables and their values +to the Readline output stream. +If a numeric argument is supplied, the output is formatted in such a way that it can be made part -of an inputrc file. This command is unbound by default. +of an inputrc file. +This command is unbound by default.

dump-macros ()

Print all of the Readline key sequences bound to macros and the -strings they output. If a numeric argument is supplied, +strings they output +to the Readline output stream. +If a numeric argument is supplied, the output is formatted in such a way that it can be made part -of an inputrc file. This command is unbound by default. +of an inputrc file. +This command is unbound by default. +

+
+
execute-named-command (M-x)
+

Read a bindable Readline command name from the input and execute the +function to which it’s bound, as if the key sequence to which it was +bound appeared in the input. +If this function is supplied with a numeric argument, it passes that +argument to the function it executes.

@@ -2007,14 +2182,6 @@ editing mode. editing mode.

- -
execute-named-command (M-x)
-

Read a bindable readline command name from the input and execute the -function to which it’s bound, as if the key sequence to which it was -bound appeared in the input. -If this function is supplied with a numeric argument, it passes that -argument to the function it executes. -

@@ -2030,8 +2197,9 @@ Previous: