NetBSD Problem Report #14578

Received: (qmail 20280 invoked from network); 13 Nov 2001 19:57:54 -0000
Message-Id: <11806-1005681460@rainier.reedmedia.net>
Date: Tue, 13 Nov 2001 11:57:41 z
From: reed@reedmedia.net
To: gnats-bugs@gnats.netbsd.org
Subject: sh(1) doesn't indicate what emacs keys to use
X-Send-Pr-Version: 3.95

>Number:         14578
>Category:       bin
>Synopsis:       sh(1) doesn't explain emacs editing mode
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    reed
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov 13 19:58:01 +0000 2001
>Closed-Date:    
>Last-Modified:  Sat Mar 08 07:52:49 +0000 2008
>Originator:     Jeremy C. Reed
>Release:        -current
>Organization:
http://bsd.reedmedia.net/
>Environment:

System: NetBSD rainier.reedmedia.net 1.5.1_BETA NetBSD 1.5.1_BETA (JCR-1.5-20010407) #0: Sat Apr 7 01:44:35 PDT 2001 reed@rainier:/usr/src/sys/arch/i386/compile/JCR-1.5-20010407 i386


>Description:
sh.1 manual mentions emacs editing mode but doesn't explain what keys.
In addition, sh(1) doesn't indicate use of libedit/editline library.

It also references non-existant emacs(1) manual page. Should base
manual pages reference manual pages from software installed via package
collection?

The sh.1 "Command Line Editing" section is too short and doesn't
mention emacs. In addition, it mentions that some commands are "described
below" -- they aren't.

By the way, I see pr 10097 "key bindings and editrc for /bin/sh".
What is the plan with it?

Should the sh(1) manual page indicate ~/.editrc?
(Even editrc(5) doesn't mention location of file.)

Should sh(1) explain what keystrokes to use for emacs mode or
reference a different document?

Do the keystrokes change from architecture to architecture -- and
is this why it isn't explained?

I see the auto-generated lib/libedit/emacs.h file -- what file shows the
defaults? Is this defined via termcap?
>How-To-Repeat:
man sh # and try to figure out what keys do what

>Fix:

A patch for sh.1 is below. It still needs to reference editrc if applicable.
And sh still needs some documentation telling which key does what (.i.e.
CTRL-A goes to beginning of line).

--- sh.1.orig	Tue Nov 13 11:06:00 2001
+++ sh.1	Tue Nov 13 11:54:42 2001
@@ -239,12 +239,17 @@
 command line editor (disables
 .Fl E
 if it has been set).
+(See the
+.Sx Command Line Editing
+section below.)
 .It Fl E Em emacs
-Enable the built-in
-.Xr emacs 1
+Enable the built-in emacs style
 command line editor (disables
 .Fl V
 if it has been set).
+(See the
+.Sx Command Line Editing
+section below.)
 .It Fl b Em notify
 Enable asynchronous notification of background job completion.
 (UNIMPLEMENTED for 4.4alpha)
@@ -1481,18 +1486,32 @@
 .Ic fc
 in
 .Sx Builtins )
-can be edited using vi-mode command-line editing. This mode uses commands,
-described below, similar to a subset of those described in the vi man
-page. The command
+can be edited using emacs-mode or vi-mode command-line editing.
+The command
+.Ql set -o emacs
+enables emacs-mode editing.
+The command
 .Ql set -o vi
-enables vi-mode editing and place sh into vi insert mode. With vi-mode
-enabled, sh can be switched between insert mode and command mode. The
-editor is not described in full here, but will be in a later document.
+enables vi-mode editing and places sh into vi insert mode.
+(See the
+.Sx Argument List Processing
+section above.) 
+.Pp
+The vi mode uses commands similar to a subset of those described in the
+.Xr vi 1
+man page.  With vi-mode
+enabled, sh can be switched between insert mode and command mode.
 It's similar to vi: typing
 .Aq ESC
 will throw you into command VI command mode. Hitting
 .Aq return
 while in command mode will pass the line to the shell.
+.Pp
+.Nm
+uses the
+.Xr editline 3
+library.
+The editor is not described in full here, but will be in a later document.
 .Sh ENVIRONMENT
 .Bl -tag -width MAILCHECK
 .It Ev HOME

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: gmcgarry 
State-Changed-When: Fri May 2 09:00:41 UTC 2003 
State-Changed-Why:  
I've added the changes to the manpage.  There is more than a single PR 
located in here.  I think the only outstanding issue is finding a place 
to document the default emacs bindings.  Do you agree? 

From: Gregory McGarry <gmcgarry@netbsd.org>
To: gnats-bugs@gnats.netbsd.org
Cc:  
Subject: pr/14578 CVS commit: src/bin/sh
Date: Fri,  2 May 2003 09:00:15 +0000 (UTC)

 Module Name:	src
 Committed By:	gmcgarry
 Date:		Fri May  2 09:00:14 UTC 2003

 Modified Files:
 	src/bin/sh: sh.1

 Log Message:
 Expand documentation of emacs and vi modes.  From
 Jeremy C. Reed in PR#14578.


 To generate a diff of this commit:
 cvs rdiff -r1.63 -r1.64 src/bin/sh/sh.1

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.


From: "Jeremy C. Reed" <reed@reedmedia.net>
To: gmcgarry@netbsd.org
Cc: gnats-admin@netbsd.org, <gnats-bugs@netbsd.org>
Subject: Re: bin/14578
Date: Wed, 7 May 2003 13:13:09 -0700 (PDT)

 On 2 May 2003 gmcgarry@netbsd.org wrote:

 > I've added the changes to the manpage.  There is more than a single PR
 > located in here.  I think the only outstanding issue is finding a place
 > to document the default emacs bindings.  Do you agree?

 Thank you.

 I agree further documentation is needed. If we decide on which man page to
 document these default emacs bindings, I'll write it.

    Jeremy C. Reed
    http://bsd.reedmedia.net/


From: Gregory McGarry <g.mcgarry@ieee.org>
To: "Jeremy C. Reed" <reed@reedmedia.net>
Cc: gnats-bugs@netbsd.org
Subject: Re: bin/14578
Date: Thu, 8 May 2003 10:44:24 +1200

 Jeremy C. Reed wrote:

 > On 2 May 2003 gmcgarry@netbsd.org wrote:
 > 
 > > I've added the changes to the manpage.  There is more than a single PR
 > > located in here.  I think the only outstanding issue is finding a place
 > > to document the default emacs bindings.  Do you agree?
 > 
 > Thank you.
 > 
 > I agree further documentation is needed. If we decide on which man page to
 > document these default emacs bindings, I'll write it.

 I did a google search and found some useful pages.  I think adding
 them to editrc(5) would be most useful.

 	-- Gregory McGarry <g.mcgarry@ieee.org>

From: "Erik E. Fair" <fair@NetBSD.org>
To: NetBSD GNATS Bug Tracking System <gnats-bugs@NetBSD.org>
Cc:  
Subject: Re: bin/14578
Date: Mon, 29 Mar 2004 13:12:03 -0800

 So, where are we with this PR?

 	Erik <fair@netbsd.org>
From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: bin/14578: sh(1) doesn't explain emacs editing mode
Date: Sat, 8 Mar 2008 07:47:01 +0000

  > So, where are we with this PR?

 Nowhere apparently - editrc(5) still doesn't document the default
 bindings.

 -- 
 David A. Holland
 dholland@netbsd.org

Responsible-Changed-From-To: bin-bug-people->reed
Responsible-Changed-By: dholland@NetBSD.org
Responsible-Changed-When: Sat, 08 Mar 2008 07:52:49 +0000
Responsible-Changed-Why:
Volunteered. (Admittedly, in 2003.)


State-Changed-From-To: feedback->open
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sat, 08 Mar 2008 07:52:49 +0000
State-Changed-Why:
One issue is still open.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.