Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-7]: src/lib/libedit Sync lib/libedit with head, requested by chri...



details:   https://anonhg.NetBSD.org/src/rev/274b63b6d2a4
branches:  netbsd-7
changeset: 799309:274b63b6d2a4
user:      martin <martin%NetBSD.org@localhost>
date:      Wed May 13 13:33:55 2015 +0000

description:
Sync lib/libedit with head, requested by christos in #753:

        lib/libedit/Makefile 1.53
        lib/libedit/chartype.h 1.13
        lib/libedit/editline.3 1.83-1.84
        lib/libedit/editrc.5 1.28-1.29
        lib/libedit/eln.c 1.18
        lib/libedit/filecomplete.c 1.33-1.34
        lib/libedit/readline.c 1.112-1.115

Man page improvements, fix overlapping strcpy, improve readline
compatibility, clang build fix.

diffstat:

 lib/libedit/Makefile       |   3 +-
 lib/libedit/chartype.h     |   4 +-
 lib/libedit/editline.3     |  19 +++++++++----
 lib/libedit/editrc.5       |  66 ++++++++++++++++++++++++++++++++-------------
 lib/libedit/eln.c          |  10 ++++--
 lib/libedit/filecomplete.c |   8 ++--
 lib/libedit/readline.c     |  44 ++++++++++++++++++++++++++----
 7 files changed, 111 insertions(+), 43 deletions(-)

diffs (truncated from 434 to 300 lines):

diff -r 1041e45739ab -r 274b63b6d2a4 lib/libedit/Makefile
--- a/lib/libedit/Makefile      Tue May 12 16:09:57 2015 +0000
+++ b/lib/libedit/Makefile      Wed May 13 13:33:55 2015 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.52 2014/06/14 20:49:37 mrg Exp $
+#      $NetBSD: Makefile,v 1.52.2.1 2015/05/13 13:33:55 martin Exp $
 #      @(#)Makefile    8.1 (Berkeley) 6/4/93
 
 USE_SHLIBDIR=  yes
@@ -13,6 +13,7 @@
 
 COPTS+=        -Wunused-parameter
 CWARNFLAGS.gcc+=       -Wconversion
+CWARNFLAGS.clang+=     -Wno-cast-qual
 
 OSRCS= chared.c common.c el.c emacs.c fcns.c filecomplete.c help.c \
        hist.c keymacro.c map.c chartype.c \
diff -r 1041e45739ab -r 274b63b6d2a4 lib/libedit/chartype.h
--- a/lib/libedit/chartype.h    Tue May 12 16:09:57 2015 +0000
+++ b/lib/libedit/chartype.h    Wed May 13 13:33:55 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: chartype.h,v 1.10.18.1 2015/04/14 05:30:24 snj Exp $   */
+/*     $NetBSD: chartype.h,v 1.10.18.2 2015/05/13 13:33:55 martin Exp $        */
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -44,7 +44,7 @@
  * supports non-BMP code points without requiring UTF-16, but nothing
  * seems to actually advertise this properly, despite Unicode 3.1 having
  * been around since 2001... */
-#if !defined(__NetBSD__) && !defined(__sun) && !(defined(__APPLE__) && defined(__MACH__))
+#if !defined(__NetBSD__) && !defined(__sun) && !(defined(__APPLE__) && defined(__MACH__)) && !defined(__OpenBSD__)
 #ifndef __STDC_ISO_10646__
 /* In many places it is assumed that the first 127 code points are ASCII
  * compatible, so ensure wchar_t indeed does ISO 10646 and not some other
diff -r 1041e45739ab -r 274b63b6d2a4 lib/libedit/editline.3
--- a/lib/libedit/editline.3    Tue May 12 16:09:57 2015 +0000
+++ b/lib/libedit/editline.3    Wed May 13 13:33:55 2015 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: editline.3,v 1.82 2014/05/11 09:01:42 wiz Exp $
+.\"    $NetBSD: editline.3,v 1.82.2.1 2015/05/13 13:33:55 martin Exp $
 .\"
 .\" Copyright (c) 1997-2014 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -26,7 +26,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd May 10, 2014
+.Dd December 25, 2014
 .Dt EDITLINE 3
 .Os
 .Sh NAME
@@ -190,7 +190,9 @@
 .Bl -tag -width 4n
 .It Fn el_init
 Initialise the line editor, and return a data structure
-to be used by all other line editing functions.
+to be used by all other line editing functions, or
+.Dv NULL
+on failure.
 .Fa prog
 is the name of the invoking program, used when reading the
 .Xr editrc 5
@@ -290,6 +292,7 @@
 .Fa op
 determines which parameter to set, and each operation has its
 own parameter list.
+Returns 0 on success, \-1 on failure.
 .Pp
 The following values for
 .Fa op
@@ -605,6 +608,8 @@
 .Xr editrc 5
 for details on the format of
 .Fa file .
+.Fn el_source
+returns 0 on success and \-1 on error.
 .It Fn el_resize
 Must be called if the terminal size changes.
 If
@@ -665,7 +670,9 @@
 .Bl -tag -width 4n
 .It Fn history_init
 Initialise the history list, and return a data structure
-to be used by all other history list functions.
+to be used by all other history list functions, or
+.Dv NULL
+on failure.
 .It Fn history_end
 Clean up and finish with
 .Fa h ,
@@ -734,12 +741,12 @@
 removing the oldest entry to keep the list to the created size.
 If
 .Dv H_SETUNIQUE
-was has been called with a non-zero arguments, the element
+has been called with a non-zero argument, the element
 will not be entered into the history if its contents match
 the ones of the current history element.
 If the element is entered
 .Fn history
-returns 1, if it is ignored as a duplicate returns 0.
+returns 1; if it is ignored as a duplicate returns 0.
 Finally
 .Fn history
 returns \-1 if an error occurred.
diff -r 1041e45739ab -r 274b63b6d2a4 lib/libedit/editrc.5
--- a/lib/libedit/editrc.5      Tue May 12 16:09:57 2015 +0000
+++ b/lib/libedit/editrc.5      Wed May 13 13:33:55 2015 +0000
@@ -1,4 +1,4 @@
-.\"    $NetBSD: editrc.5,v 1.27 2013/01/10 16:03:42 wiz Exp $
+.\"    $NetBSD: editrc.5,v 1.27.8.1 2015/05/13 13:33:55 martin Exp $
 .\"
 .\" Copyright (c) 1997-2000 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -26,7 +26,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd January 10, 2013
+.Dd December 25, 2014
 .Dt EDITRC 5
 .Os
 .Sh NAME
@@ -42,7 +42,8 @@
 library.
 .Pp
 The format of each line is:
-.Dl [prog:]command [arg [...]]
+.Pp
+.Dl [prog:]command [arg ...]
 .Pp
 .Ar command
 is one of the
@@ -103,16 +104,12 @@
 .Ar key .
 Options include:
 .Bl -tag -width 4n
-.It Fl e
-Bind all keys to the standard GNU Emacs-like bindings.
-.It Fl v
-Bind all keys to the standard
-.Xr vi 1 Ns -like
-bindings.
 .It Fl a
 List or change key bindings in the
 .Xr vi 1
 mode alternate (command mode) key map.
+.It Fl e
+Bind all keys to the standard GNU Emacs-like bindings.
 .It Fl k
 .Ar key
 is interpreted as a symbolic arrow key name, which may be one of
@@ -134,6 +131,10 @@
 .Ar command
 are themselves reinterpreted, and this continues for ten levels of
 interpretation.
+.It Fl v
+Bind all keys to the standard
+.Xr vi 1 Ns -like
+bindings.
 .El
 .Pp
 .Ar command
@@ -149,7 +150,7 @@
 .Sq No ^ Ar character
 .Sm on
 .Po
-e.g.
+e.g.\&
 .Sq ^A
 .Pc ,
 and the following backslashed escape sequences:
@@ -186,7 +187,7 @@
 .Sq ^ .
 .It Ic echotc Oo Fl sv Oc Ar arg Ar ...
 Exercise terminal capabilities given in
-.Ar arg Ar ... .
+.Ar arg ... .
 If
 .Ar arg
 is
@@ -230,9 +231,6 @@
 If
 .Dv n
 is zero, then keep all entries (the default).
-.It Ic telltc
-List the values of all the terminal capabilities (see
-.Xr termcap 5 ) .
 .It Ic settc Ar cap Ar val
 Set the terminal capability
 .Ar cap
@@ -291,6 +289,9 @@
 is empty
 then the character is set to
 .Dv _POSIX_VDISABLE .
+.It Ic telltc
+List the values of all the terminal capabilities (see
+.Xr termcap 5 ) .
 .El
 .Sh EDITOR COMMANDS
 The following editor commands are available for use in key bindings:
@@ -300,11 +301,11 @@
 Vi paste previous deletion to the right of the cursor.
 .It Ic vi-paste-prev
 Vi paste previous deletion to the left of the cursor.
-.It Ic vi-prev-space-word
+.It Ic vi-prev-big-word
 Vi move to the previous space delimited word.
 .It Ic vi-prev-word
 Vi move to the previous word.
-.It Ic vi-next-space-word
+.It Ic vi-next-big-word
 Vi move to the next space delimited word.
 .It Ic vi-next-word
 Vi move to the next word.
@@ -332,9 +333,9 @@
 Vi enter insert mode at end of line.
 .It Ic vi-delete-meta
 Vi delete prefix command.
-.It Ic vi-end-word
+.It Ic vi-end-big-word
 Vi move to the end of the current space delimited word.
-.It Ic vi-to-end-word
+.It Ic vi-end-word
 Vi move to the end of the current word.
 .It Ic vi-undo
 Vi undo last change.
@@ -368,6 +369,28 @@
 Vi repeat current character search in the same search direction.
 .It Ic vi-repeat-prev-char
 Vi repeat current character search in the opposite search direction.
+.It Ic vi-match
+Vi go to matching () {} or [].
+.It Ic vi-undo-line
+Vi undo all changes to line.
+.It Ic vi-to-column
+Vi go to specified column.
+.It Ic vi-yank-end
+Vi yank to end of line.
+.It Ic vi-yank
+Vi yank.
+.It Ic vi-comment-out
+Vi comment out current command.
+.It Ic vi-alias
+Vi include shell alias.
+.It Ic vi-to-history-line
+Vi go to specified history file line..
+.It Ic vi-histedit
+Vi edit history line with vi.
+.It Ic vi-history-word
+Vi append word from previous input line.
+.It Ic vi-redo
+Vi redo last non-motion command.
 .It Ic em-delete-or-list
 Delete character under cursor or list completions if at end of line.
 .It Ic em-delete-next-word
@@ -490,9 +513,12 @@
 .Xr regex 3 ,
 .Xr termcap 5
 .Sh AUTHORS
+.An -nosplit
 The
 .Nm editline
-library was written by Christos Zoulas,
-and this manual was written by Luke Mewburn,
+library was written by
+.An Christos Zoulas ,
+and this manual was written by
+.An Luke Mewburn ,
 with some sections inspired by
 .Xr tcsh 1 .
diff -r 1041e45739ab -r 274b63b6d2a4 lib/libedit/eln.c
--- a/lib/libedit/eln.c Tue May 12 16:09:57 2015 +0000
+++ b/lib/libedit/eln.c Wed May 13 13:33:55 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: eln.c,v 1.17 2014/06/18 18:12:28 christos Exp $        */
+/*     $NetBSD: eln.c,v 1.17.2.1 2015/05/13 13:33:55 martin Exp $      */
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: eln.c,v 1.17 2014/06/18 18:12:28 christos Exp $");
+__RCSID("$NetBSD: eln.c,v 1.17.2.1 2015/05/13 13:33:55 martin Exp $");
 #endif /* not lint && not SCCSID */
 
 #include "histedit.h"
@@ -76,9 +76,11 @@
 {
        const wchar_t *tmp;
 
-       el->el_flags |= IGNORE_EXTCHARS;
+       if (!(el->el_flags & CHARSET_IS_UTF8))
+               el->el_flags |= IGNORE_EXTCHARS;
        tmp = el_wgets(el, nread);
-       el->el_flags &= ~IGNORE_EXTCHARS;



Home | Main Index | Thread Index | Old Index