Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libedit From Ingo Schwarze, based on changes from Kaspar...
details: https://anonhg.NetBSD.org/src/rev/d7e5c42cdf57
branches: trunk
changeset: 335094:d7e5c42cdf57
user: wiz <wiz%NetBSD.org@localhost>
date: Thu Dec 25 13:39:05 2014 +0000
description:
>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.
diffstat:
lib/libedit/editline.3 | 17 +++++++++---
lib/libedit/editrc.5 | 64 +++++++++++++++++++++++++++++++++++--------------
2 files changed, 57 insertions(+), 24 deletions(-)
diffs (220 lines):
diff -r cf71ac8c14d2 -r d7e5c42cdf57 lib/libedit/editline.3
--- a/lib/libedit/editline.3 Thu Dec 25 09:10:01 2014 +0000
+++ b/lib/libedit/editline.3 Thu Dec 25 13:39:05 2014 +0000
@@ -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 @@
.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 cf71ac8c14d2 -r d7e5c42cdf57 lib/libedit/editrc.5
--- a/lib/libedit/editrc.5 Thu Dec 25 09:10:01 2014 +0000
+++ b/lib/libedit/editrc.5 Thu Dec 25 13:39:05 2014 +0000
@@ -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 @@
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 .
Home |
Main Index |
Thread Index |
Old Index