Module Name: src Committed By: wiz Date: Thu Dec 25 13:39:05 UTC 2014
Modified Files: src/lib/libedit: editline.3 editrc.5 Log Message: >From Ingo Schwarze, based on changes from Kaspars Bankovskis: * Document error handling of el_init(), el_set(), el_source(), and history_init(). * Fix a typo an improve punctuation below H_SETUNIQUE. * The ellipsis already implies "optional", no need for []. * Sort options in editrc(5). * Prevent e.g. rom being misconstrued as the end of a sentence. * Drop a useless duplicate .Ar macro. * Put telltc in its proper place in the alphabetical order. * A few typos in vi editor command names. * Some missing vi editor command names. * Some missing author macros. To generate a diff of this commit: cvs rdiff -u -r1.82 -r1.83 src/lib/libedit/editline.3 cvs rdiff -u -r1.27 -r1.28 src/lib/libedit/editrc.5 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libedit/editline.3 diff -u src/lib/libedit/editline.3:1.82 src/lib/libedit/editline.3:1.83 --- src/lib/libedit/editline.3:1.82 Sun May 11 09:01:42 2014 +++ src/lib/libedit/editline.3 Thu Dec 25 13:39:05 2014 @@ -1,4 +1,4 @@ -.\" $NetBSD: editline.3,v 1.82 2014/05/11 09:01:42 wiz Exp $ +.\" $NetBSD: editline.3,v 1.83 2014/12/25 13:39:05 wiz Exp $ .\" .\" Copyright (c) 1997-2014 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -190,7 +190,9 @@ The following functions are available: .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 @@ parameters. .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 @@ Refer to .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 @@ The following functions are available: .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 @@ as a new element to the history, and, if 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. Index: src/lib/libedit/editrc.5 diff -u src/lib/libedit/editrc.5:1.27 src/lib/libedit/editrc.5:1.28 --- src/lib/libedit/editrc.5:1.27 Thu Jan 10 16:03:42 2013 +++ src/lib/libedit/editrc.5 Thu Dec 25 13:39:05 2014 @@ -1,4 +1,4 @@ -.\" $NetBSD: editrc.5,v 1.27 2013/01/10 16:03:42 wiz Exp $ +.\" $NetBSD: editrc.5,v 1.28 2014/12/25 13:39:05 wiz Exp $ .\" .\" Copyright (c) 1997-2000 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -42,7 +42,8 @@ file defines various settings to be used 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 @@ to .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 @@ Bound keys in .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 @@ can contain control characters of the fo .Sq No ^ Ar character .Sm on .Po -e.g. +e.g.\& .Sq ^A .Pc , and the following backslashed escape sequences: @@ -186,7 +187,7 @@ and .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 @@ is non zero, only keep unique history en 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 @@ If 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 @@ The following editor commands are availa 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 after the cursor. 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 move up to the character specified pr 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 @@ library. .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 .