OpenSolaris

Discussions Communities Projects Download Source Browser

Home » OpenSolaris Forums » ksh93-integration » discuss

Thread: Re: TAB-TAB completion patch #003 (which makes "gmacs" the default editor mode) / was: Re: [ast-users] RFE: Make TAB completion in ksh93 work like ESC-'='...

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 8 - Last Post: May 21, 2006 8:11 PM by: gisburn
April Chin
April.Chin@eng.sun.com
Re: TAB-TAB completion patch #003 (which makes "gmacs" the default editor mode) / was: Re: [ast-users] RFE: Make TAB completion in ksh93 work like ESC-'='...
Posted: May 12, 2006 5:46 PM

  Click to reply to this thread Reply


> Date: Wed, 10 May 2006 02:04:43 +0200
> From: Roland Mainz <roland dot mainz at nrubsig dot org>
> X-Accept-Language: en
> MIME-Version: 1.0
> To: ast-users <ast-users at research dot att dot com>, ksh93-integration-discuss
<ksh93-integration-discuss at opensolaris dot org>
> CC: April Chin <April dot Chin at eng dot sun dot com>
> Subject: TAB-TAB completion patch #003 (which makes "gmacs" the default editor
mode) / was: Re: [ast-users] RFE: Make TAB completion in ksh93 work like
ESC-'='...
> X-ID: bdlyZiZVgeQfjihegvdcB-pJpVfmTpdkH6+Yts17ykwPkDhPYb6toN@t-dialin.net
> X-TOI-MSGID: 051d1a0f-4cc6-46b2-9ecf-b91e8d0a7e4c
>
> Roland Mainz wrote:
> > Roland Mainz wrote:
> > > Attached is a small patch ("ksh93_tab_completion_choice.diff.txt" ;
> > > relative to the current Solaris OS/Net tree, but it should apply to
> > > ksh93r cleanly, too) which may be usefull for integration into ksh93r+.
> > >
> > > The patch changes the behaviour of the TAB completion in emacs mode to
> > > preview a list of choices (e.g. equilavent to ESC-'=') instead of doing
> > > the completion itself which may be much more usefull when many file name
> > > are matching the given pattern (it also contains a comment how to make
> > > it slightly "better", however I am not sure (yet) how this can be done
> > > easily).
> > >
> > > Little bit testing with our students showed that they like it more than
> > > the current TAB completion... :-)
> > >
> > > Basically the patch is equivalent to
> > > -- snip --
> > > function emacs_completion
> > > {
> > > if [[ ${.sh.edchar} == "$(printf "\t")" ]] then
> > > .sh.edchar="$(printf "\E=")"
> > > true
> > > fi
> > > }
> > >
> > > trap emacs_completion KEYBD
> > > -- snip --
> >
> > Actually it could be done better... attached is a 2nd patch
> > ("ksh93_tab_tab_gmacs_completion_try2.diff.txt") which also implements
> > TAB-TAB completion like in bash3.
> > Single TAB now completes the filename either completely - or if that
> > isn't possible it's completed to the point where the filenames start to
> > differ. TAB-TAB then displays a list of choices. Additionally in "gmacs"
> > mode typing TAB on an empty string will try to do the filename
> > completion for the whole directory (and TAB-TAB displays all choices
> > then). "emacs" mode still behaves as usual, incl. the ability to enter
> > the TAB character.
> > (note: the previous patch was tested for ~~one week, the current one is
> > more or less untested) ...
>
> Attached is now the 3rd version... the only difference to the previous
> patch is that I added a way to provide a default editor mode (set to
> "gmacs" for the initial ksh93-integration (and to aid the migration of
> bash2/3 users to ksh93)). Basically it is an equivalent to the following
> ksh93 shell code:
> -- snip --
> emacs_completion_tab_count=0
>
> function emacs_completion
> {
> if [[ ${.sh.edchar} == "$(printf "\t")" ]] then
> emacs_completion_tab_count=$((emacs_completion_tab_count + 1))
>
> if [ $emacs_completion_tab_count -eq 1 ] ; then
> .sh.edchar="$(printf "\E\E")"
> elif [ $emacs_completion_tab_count -ge 2 ] ; then
> .sh.edchar="$(printf "\E=")"
> fi
> else
> emacs_completion_tab_count=0
> fi
> }
>
> trap emacs_completion KEYBD
> set -o gmacs
> -- snip --
>
> David/April: Are there any objections of making the "gmacs" editor mode
> the "default" for both Solaris (for both "ksh93r+" and
> ksh93-integration) and Linux ?

Solaris ksh also does not have a default editor mode if
VISUAL and EDITOR are not set. A default seems like a good idea.
Is there any reason for gmacs over emacs or vi mode?

April
>
> ----
>
> Bye
> Roland
>
> --
> __ . . __
> (o.\ \/ /.o) roland dot mainz at nrubsig dot org
> \__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
> /O /==\ O\ TEL +49 641 7950090
> (;O/ \/ \O;)

_______________________________________________
ksh93-integration-discuss mailing list
ksh93-integration-discuss at opensolaris dot org
http://mail.opensolaris.org/mailman/listinfo/ksh93-integration-discuss



I. Szczesniak
iszczesniak@gmail.com
Re: Re: TAB-TAB completion patch #003 (which makes "gmacs" the default editor mode) / was: Re: [ast-users] RFE: Make TAB completion in ksh93 work like ESC-'='...
Posted: May 15, 2006 7:37 AM   in response to: April Chin

  Click to reply to this thread Reply

On 5/13/06, April Chin <April dot Chin at eng dot sun dot com> wrote:
>
> > Date: Wed, 10 May 2006 02:04:43 +0200
> > From: Roland Mainz <roland dot mainz at nrubsig dot org>
> > X-Accept-Language: en
> > MIME-Version: 1.0
> > To: ast-users <ast-users at research dot att dot com>, ksh93-integration-discuss
> <ksh93-integration-discuss at opensolaris dot org>
> > CC: April Chin <April dot Chin at eng dot sun dot com>
> > Subject: TAB-TAB completion patch #003 (which makes "gmacs" the default editor
> mode) / was: Re: [ast-users] RFE: Make TAB completion in ksh93 work like
> ESC-'='...
> > X-ID: bdlyZiZVgeQfjihegvdcB-pJpVfmTpdkH6+Yts17ykwPkDhPYb6toN@t-dialin.net
> > X-TOI-MSGID: 051d1a0f-4cc6-46b2-9ecf-b91e8d0a7e4c
> >
> > Roland Mainz wrote:
> > > Roland Mainz wrote:
> > > > Attached is a small patch ("ksh93_tab_completion_choice.diff.txt" ;
> > > > relative to the current Solaris OS/Net tree, but it should apply to
> > > > ksh93r cleanly, too) which may be usefull for integration into ksh93r+.
> > > >
> > > > The patch changes the behaviour of the TAB completion in emacs mode to
> > > > preview a list of choices (e.g. equilavent to ESC-'=') instead of doing
> > > > the completion itself which may be much more usefull when many file name
> > > > are matching the given pattern (it also contains a comment how to make
> > > > it slightly "better", however I am not sure (yet) how this can be done
> > > > easily).
> > > >
> > > > Little bit testing with our students showed that they like it more than
> > > > the current TAB completion... :-)
> > > >
> > > > Basically the patch is equivalent to
> > > > -- snip --
> > > > function emacs_completion
> > > > {
> > > > if [[ ${.sh.edchar} == "$(printf "\t")" ]] then
> > > > .sh.edchar="$(printf "\E=")"
> > > > true
> > > > fi
> > > > }
> > > >
> > > > trap emacs_completion KEYBD
> > > > -- snip --
> > >
> > > Actually it could be done better... attached is a 2nd patch
> > > ("ksh93_tab_tab_gmacs_completion_try2.diff.txt") which also implements
> > > TAB-TAB completion like in bash3.
> > > Single TAB now completes the filename either completely - or if that
> > > isn't possible it's completed to the point where the filenames start to
> > > differ. TAB-TAB then displays a list of choices. Additionally in "gmacs"
> > > mode typing TAB on an empty string will try to do the filename
> > > completion for the whole directory (and TAB-TAB displays all choices
> > > then). "emacs" mode still behaves as usual, incl. the ability to enter
> > > the TAB character.
> > > (note: the previous patch was tested for ~~one week, the current one is
> > > more or less untested) ...
> >
> > Attached is now the 3rd version... the only difference to the previous
> > patch is that I added a way to provide a default editor mode (set to
> > "gmacs" for the initial ksh93-integration (and to aid the migration of
> > bash2/3 users to ksh93)). Basically it is an equivalent to the following
> > ksh93 shell code:
> > -- snip --
> > emacs_completion_tab_count=0
> >
> > function emacs_completion
> > {
> > if [[ ${.sh.edchar} == "$(printf "\t")" ]] then
> > emacs_completion_tab_count=$((emacs_completion_tab_count + 1))
> >
> > if [ $emacs_completion_tab_count -eq 1 ] ; then
> > .sh.edchar="$(printf "\E\E")"
> > elif [ $emacs_completion_tab_count -ge 2 ] ; then
> > .sh.edchar="$(printf "\E=")"
> > fi
> > else
> > emacs_completion_tab_count=0
> > fi
> > }
> >
> > trap emacs_completion KEYBD
> > set -o gmacs
> > -- snip --
> >
> > David/April: Are there any objections of making the "gmacs" editor mode
> > the "default" for both Solaris (for both "ksh93r+" and
> > ksh93-integration) and Linux ?
>
> Solaris ksh also does not have a default editor mode if
> VISUAL and EDITOR are not set. A default seems like a good idea.
> Is there any reason for gmacs over emacs or vi mode?

emacs is *MUCH* easier to learn than vi. I never really used gnacs mode...

Irek
_______________________________________________
ksh93-integration-discuss mailing list
ksh93-integration-discuss at opensolaris dot org
http://mail.opensolaris.org/mailman/listinfo/ksh93-integration-discuss



casper

Posts: 3,398
From:

Registered: 3/9/05
Re: Re: TAB-TAB completion patch #003 (which makes "gmacs" the default editor mode) / was: Re: [ast-users] RFE: Make TAB completion in ksh93 work like ESC-'='...
Posted: May 15, 2006 7:39 AM   in response to: I. Szczesniak

  Click to reply to this thread Reply



>> Solaris ksh also does not have a default editor mode if
>> VISUAL and EDITOR are not set. A default seems like a good idea.
>> Is there any reason for gmacs over emacs or vi mode?
>
>emacs is *MUCH* easier to learn than vi. I never really used gnacs mode...


While I prefer vi for editing, I *much* prefer emacs style editing
for the command line, possibly because switching modes is such a pain
for small edits.

Casper

_______________________________________________
ksh93-integration-discuss mailing list
ksh93-integration-discuss at opensolaris dot org
http://mail.opensolaris.org/mailman/listinfo/ksh93-integration-discuss



Glenn Fowler
gsf@research.att.com
Re: Re: TAB-TAB completion patch #003 (which makes "gmacs" the default editor mode) / was: Re: [ast-users] RFE: Make TAB completion in ksh93 work like ESC-'='...
Posted: May 15, 2006 7:57 AM   in response to: I. Szczesniak

  Click to reply to this thread Reply


> > Solaris ksh also does not have a default editor mode if
> > VISUAL and EDITOR are not set. A default seems like a good idea.
> > Is there any reason for gmacs over emacs or vi mode?

> emacs is *MUCH* easier to learn than vi. I never really used gnacs mode...

I'd like to nip subsequent opinions on editor preferenece right here
the list would crumble under the traffic

I think posix/xopen would have something to say about ESC or ^P
typed in at a sh prompt doing anything but entering ESC or ^P
into the input buffer (modulo stty special char settings)

i.e., I believe the default editor must be NONE
with ksh93 the user can always do the appropriate .profile / ENV file
magic for editor preference

-- Glenn Fowler -- AT&T Research, Florham Park NJ --

_______________________________________________
ksh93-integration-discuss mailing list
ksh93-integration-discuss at opensolaris dot org
http://mail.opensolaris.org/mailman/listinfo/ksh93-integration-discuss



I. Szczesniak
iszczesniak@gmail.com
Re: Re: TAB-TAB completion patch #003 (which makes "gmacs" the default editor mode) / was: Re: [ast-users] RFE: Make TAB completion in ksh93 work like ESC-'='...
Posted: May 15, 2006 8:21 AM   in response to: Glenn Fowler

  Click to reply to this thread Reply

On 5/15/06, Glenn Fowler <gsf at research dot att dot com> wrote:
>
> > > Solaris ksh also does not have a default editor mode if
> > > VISUAL and EDITOR are not set. A default seems like a good idea.
> > > Is there any reason for gmacs over emacs or vi mode?
>
> > emacs is *MUCH* easier to learn than vi. I never really used gnacs mode...
>
> I'd like to nip subsequent opinions on editor preferenece right here
> the list would crumble under the traffic
>
> I think posix/xopen would have something to say about ESC or ^P
> typed in at a sh prompt doing anything but entering ESC or ^P
> into the input buffer (modulo stty special char settings)
>
> i.e., I believe the default editor must be NONE
> with ksh93 the user can always do the appropriate .profile / ENV file
> magic for editor preference

Why does bash then claim full POSIX conformance and default to emacs editing?

Irek
_______________________________________________
ksh93-integration-discuss mailing list
ksh93-integration-discuss at opensolaris dot org
http://mail.opensolaris.org/mailman/listinfo/ksh93-integration-discuss



Glenn Fowler
gsf@research.att.com
Re: Re: TAB-TAB completion patch #003 (which makes "gmacs" the default editor mode) / was: Re: [ast-users] RFE: Make TAB completion in ksh93 work like ESC-'='...
Posted: May 15, 2006 9:12 AM   in response to: I. Szczesniak

  Click to reply to this thread Reply


On Mon, 15 May 2006 17:21:49 +0200 I. Szczesniak wrote:
> On 5/15/06, Glenn Fowler <gsf at research dot att dot com> wrote:
> > i.e., I believe the default editor must be NONE
> > with ksh93 the user can always do the appropriate .profile / ENV file
> > magic for editor preference

> Why does bash then claim full POSIX conformance and default to emacs editing?

bash overclaimed
the posix text for the "set" special builtin utility
for the "User Portability Utilities option"
states that the default values for set -o options are off
an sh that starts with any of these on by default is not conforming

also note that only "set -o vi" mode is defined in the standard (see the rationale)
implementations are allowed to provide other command line editing modes
but those modes would be subject the the same "default value off" text

_______________________________________________
ksh93-integration-discuss mailing list
ksh93-integration-discuss at opensolaris dot org
http://mail.opensolaris.org/mailman/listinfo/ksh93-integration-discuss



gisburn

Posts: 3,657
From: DE

Registered: 6/16/05
TAB-TAB completion patch #005 / was: Re: TAB-TAB completion patch #003 (which makes "gmacs" the default editor mode) / was: Re: [ast-users] RFE: Make TAB completion in ksh93 work like ESC-'='...
Posted: May 15, 2006 1:04 PM   in response to: April Chin

  Click to reply to this thread Reply

April Chin wrote:
> > Roland Mainz wrote:
> > > Roland Mainz wrote:
> > > > Attached is a small patch ("ksh93_tab_completion_choice.diff.txt" ;
> > > > relative to the current Solaris OS/Net tree, but it should apply to
> > > > ksh93r cleanly, too) which may be usefull for integration into ksh93r+.
> > > >
> > > > The patch changes the behaviour of the TAB completion in emacs mode to
> > > > preview a list of choices (e.g. equilavent to ESC-'=') instead of doing
> > > > the completion itself which may be much more usefull when many file name
> > > > are matching the given pattern (it also contains a comment how to make
> > > > it slightly "better", however I am not sure (yet) how this can be done
> > > > easily).
> > > >
> > > > Little bit testing with our students showed that they like it more than
> > > > the current TAB completion... :-)
> > > >
> > > > Basically the patch is equivalent to
> > > > -- snip --
> > > > function emacs_completion
> > > > {
> > > > if [[ ${.sh.edchar} == "$(printf "\t")" ]] then
> > > > .sh.edchar="$(printf "\E=")"
> > > > true
> > > > fi
> > > > }
> > > >
> > > > trap emacs_completion KEYBD
> > > > -- snip --
> > >
> > > Actually it could be done better... attached is a 2nd patch
> > > ("ksh93_tab_tab_gmacs_completion_try2.diff.txt") which also implements
> > > TAB-TAB completion like in bash3.
> > > Single TAB now completes the filename either completely - or if that
> > > isn't possible it's completed to the point where the filenames start to
> > > differ. TAB-TAB then displays a list of choices. Additionally in "gmacs"
> > > mode typing TAB on an empty string will try to do the filename
> > > completion for the whole directory (and TAB-TAB displays all choices
> > > then). "emacs" mode still behaves as usual, incl. the ability to enter
> > > the TAB character.
> > > (note: the previous patch was tested for ~~one week, the current one is
> > > more or less untested) ...
> >
> > Attached is now the 3rd version... the only difference to the previous
> > patch is that I added a way to provide a default editor mode (set to
> > "gmacs" for the initial ksh93-integration (and to aid the migration of
> > bash2/3 users to ksh93)). Basically it is an equivalent to the following
> > ksh93 shell code:
> > -- snip --
> > emacs_completion_tab_count=0
> >
> > function emacs_completion
> > {
> > if [[ ${.sh.edchar} == "$(printf "\t")" ]] then
> > emacs_completion_tab_count=$((emacs_completion_tab_count + 1))
> >
> > if [ $emacs_completion_tab_count -eq 1 ] ; then
> > .sh.edchar="$(printf "\E\E")"
> > elif [ $emacs_completion_tab_count -ge 2 ] ; then
> > .sh.edchar="$(printf "\E=")"
> > fi
> > else
> > emacs_completion_tab_count=0
> > fi
> > }
> >
> > trap emacs_completion KEYBD
> > set -o gmacs
> > -- snip --
> >
> > David/April: Are there any objections of making the "gmacs" editor mode
> > the "default" for both Solaris (for both "ksh93r+" and
> > ksh93-integration) and Linux ?
>
> Solaris ksh also does not have a default editor mode if
> VISUAL and EDITOR are not set. A default seems like a good idea.
> Is there any reason for gmacs over emacs or vi mode?

Well, the idea behind making "gmacs" or "emacs" the default edit mode is
that almost all X11 GUI toolkits, including Qt/KDE/Motif/libXUL/Xaw/GTK+
use some kind of "emacs" editing mode in their text input fields. I
picked "gmacs" as choice since "emacs" should continue to behave like
the current "emacs" mode in ksh93 (e.g. for "power users"), including
the ability to insert TAB characters on demand while "gmacs" should
evolve to be more beginner/non-programmer friendly.
I hate to admit it - but bash3 is good at at least one point: Giving
people an easy-to-use shell interface with powerfull completion
features. I'd love to see that the "gmacs" editing more becomes similar
easy-to-use since it would mean we could simply drop the bash nightmare
(which is both a memory hog and i18n nightmare) for our accounts and
have one shell (=ksh93) which serves all people equally (both
beginners/non-programmers and the "power users").

BTW: Attached is the new patch
("ksh93_solaris_default_editor_mode_gmacs_clear005.diff.txt") for the
making "gmacs" the default editing mode. The patch now only makes
"gmacs" the default edit mode if neither ${EDITOR} nor ${VISUAL} nor
anyother edit mode are set (David/Glenn: the thing with making CTRL-L
calling "/usr/bin/clear" wasn't detected yet... or was it ? :-) ).

----

Bye,
Roland

--
__ . . __
(o.\ \/ /.o) roland dot mainz at nrubsig dot org
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 7950090
(;O/ \/ \O;)
Index: src/cmd/ksh/Makefile.com
===================================================================
--- src/cmd/ksh/Makefile.com (revision 225)
+++ src/cmd/ksh/Makefile.com (working copy)
@@ -56,6 +56,7 @@
-DSHOPT_RAWONLY \
-DSHOPT_SUID_EXEC \
-DSHOPT_VSH \
+ -DSHOPT_DEFAULTEDITMODE=SH_GMACS \
-D_BLD_shell \
-D_PACKAGE_ast \
'-DUSAGE_LICENSE="[-author?David Korn <dgk at research dot att dot com>][-copyright?Copyright (c) 1982-2006 AT&T Knowledge Ventures][-license?http://www.opensource.org/licenses/cpl1.0.txt][--catalog?libshell]"'
Index: src/lib/libshell/common/edit/emacs.c
===================================================================
--- src/lib/libshell/common/edit/emacs.c (revision 222)
+++ src/lib/libshell/common/edit/emacs.c (working copy)
@@ -179,6 +179,7 @@

int ed_emacsread(void *context, int fd,char *buff,int scend, int reedit)
{
+ static unsigned int tab_count = 0;
Edit_t *ed = (Edit_t*)context;
register int c;
register int i;
@@ -306,6 +307,13 @@
count = 1;
adjust = -1;
i = cur;
+
+ /* Count tabs for TAB completion (single TAB or TAB-TAB) */
+ if(c == '\t')
+ tab_count++;
+ else
+ tab_count = 0;
+
switch(c)
{
case cntl('V'):
@@ -327,11 +335,14 @@
continue;
#endif /* u370 */
case '\t':
- if(cur>0 && cur>=eol && out[cur-1]!='\t' && out[cur-1]!=' ' && ep->ed->sh->nextprompt)
+ if((cur>0 && cur>=eol && out[cur-1]!='\t' && out[cur-1]!=' ' && ep->ed->sh->nextprompt) ||
+ sh_isoption(SH_GMACS))
{
- ed_ungetchar(ep->ed,ESC);
- ed_ungetchar(ep->ed,ESC);
- continue;
+ if (tab_count == 1)
+ ed_ungetchar(ep->ed,cntl('[')); /* like ESC-ESC */
+ else if (tab_count >= 2)
+ ed_ungetchar(ep->ed,'='); /* like ESC-'=' */
+ goto esc_;
}
default:
if ((eol+1) >= (scend)) /* will not fit on line */
@@ -574,10 +585,23 @@
}
continue;
case cntl('L'):
- ed_crlf(ep->ed);
+ if (sh_isoption(SH_GMACS))
+ {
+ /* FixMe: a better way is needed here than
+ * calling |system()| - unfortunately I do
+ * not know a "portable" way (except
+ * linking to curses/ncurses) */
+ /* clear the screen (like bash/readline does) */
+ system("clear");
+ }
+ else
+ {
+ ed_crlf(ep->ed);
+ }
draw(ep,REFRESH);
continue;
case cntl('[') :
+esc_:
adjust = escape(ep,out,oadjust);
continue;
case cntl('R') :
Index: src/lib/libshell/common/sh/init.c
===================================================================
--- src/lib/libshell/common/sh/init.c (revision 222)
+++ src/lib/libshell/common/sh/init.c (working copy)
@@ -937,6 +937,17 @@
#if SHOPT_TIMEOUT
sh.st.tmout = SHOPT_TIMEOUT;
#endif /* SHOPT_TIMEOUT */
+#ifdef SHOPT_DEFAULTEDITMODE
+ /* set platform-specific default modes (if EDITOR/VISUAL env vars
+ * are not defined and no edit mode was set yet) */
+ if((sh_isoption(SH_VI) || sh_isoption(SH_VIRAW) ||
+ sh_isoption(SH_EMACS) || sh_isoption(SH_GMACS) ||
+ nv_getval(nv_scoped(VISINOD)) ||
+ nv_getval(nv_scoped(EDITNOD)) ) == 0)
+ {
+ sh_onoption(SHOPT_DEFAULTEDITMODE);
+ }
+#endif /* SHOPT_DEFAULTEDITMODE */
/* initialize jobs table */
job_clear();
if(argc>0)
Index: src/lib/libshell/Makefile.com
===================================================================
--- src/lib/libshell/Makefile.com (revision 222)
+++ src/lib/libshell/Makefile.com (working copy)
@@ -127,6 +127,7 @@
-DSHOPT_RAWONLY \
-DSHOPT_SUID_EXEC \
-DSHOPT_VSH \
+ -DSHOPT_DEFAULTEDITMODE=SH_GMACS \
-D_BLD_shell \
-D_PACKAGE_ast \
'-DUSAGE_LICENSE="[-author?David Korn <dgk at research dot att dot com>][-copyright?Copyright (c) 1982-2006 AT&T Knowledge Ventures][-license?http://www.opensource.org/licenses/cpl1.0.txt][--catalog?libshell]"'
_______________________________________________
ksh93-integration-discuss mailing list
ksh93-integration-discuss at opensolaris dot org
http://mail.opensolaris.org/mailman/listinfo/ksh93-integration-discuss


April Chin
April.Chin@eng.sun.com
Re: Re: TAB-TAB completion patch #003 (which makes "gmacs" the default editor mode) / was: Re: [ast-users] RFE: Make TAB completion in ksh93 work like ESC-'='...
Posted: May 18, 2006 12:27 PM   in response to: April Chin

  Click to reply to this thread Reply

I originally thought setting a default editor mode would be a good idea,
but after Glenn's comments, I discussed this with our standards expert.
He agrees that we should *not* set a default command-line editing
mode if EDITOR and VISUAL are not set and set -o vi|emacs|gmacs are not set.

So, no, we should not be setting a default command-line editor in ksh93.
It would be violating POSIX standards.

April

> X-Unix-From: gsf at research dot att dot com Mon May 15 09:12:15 2006
> X-Original-To: ksh93-integration-discuss at opensolaris dot org
> Delivered-To: ksh93-integration-discuss at opensolaris dot org
> Date: Mon, 15 May 2006 12:12:09 -0400 (EDT)
> From: Glenn Fowler <gsf at research dot att dot com>
> Mime-Version: 1.0
> Content-Transfer-Encoding: 7bit
> To: ksh93-integration-discuss at opensolaris dot org
> Subject: Re: [ksh93-integration-discuss] Re: TAB-TAB completion patch #003
(which makes "gmacs" the default editor mode) / was: Re: [ast-users] RFE: Make
TAB completion in ksh93 work like ESC-'='...
> Cc: ast-users at research dot att dot com
> X-BeenThere: ksh93-integration-discuss at opensolaris dot org
> X-Mailman-Version: 2.1.4
> List-Id: Korn Shell 93 integration/migration project discussion
<ksh93-integration-discuss.opensolaris.org>
> List-Unsubscribe:
<http://,
<mailto:ksh93-integration-discuss-request at opensolaris dot org?subject=unsubscribe>
> List-Archive:
<http://
> List-Post: <mailto:ksh93-integration-discuss at opensolaris dot org>
> List-Help:
<mailto:ksh93-integration-discuss-request at opensolaris dot org?subject=help>
> List-Subscribe:
<http://,
<mailto:ksh93-integration-discuss-request at opensolaris dot org?subject=subscribe>
>
>
> On Mon, 15 May 2006 17:21:49 +0200 I. Szczesniak wrote:
> > On 5/15/06, Glenn Fowler <gsf at research dot att dot com> wrote:
> > > i.e., I believe the default editor must be NONE
> > > with ksh93 the user can always do the appropriate .profile / ENV file
> > > magic for editor preference
>
> > Why does bash then claim full POSIX conformance and default to emacs
editing?
>
> bash overclaimed
> the posix text for the "set" special builtin utility
> for the "User Portability Utilities option"
> states that the default values for set -o options are off
> an sh that starts with any of these on by default is not conforming
>
> also note that only "set -o vi" mode is defined in the standard (see the
rationale)
> implementations are allowed to provide other command line editing modes
> but those modes would be subject the the same "default value off" text
>
> _______________________________________________
> ksh93-integration-discuss mailing list
> ksh93-integration-discuss at opensolaris dot org
> http://mail.opensolaris.org/mailman/listinfo/ksh93-integration-discuss

_______________________________________________
ksh93-integration-discuss mailing list
ksh93-integration-discuss at opensolaris dot org
http://mail.opensolaris.org/mailman/listinfo/ksh93-integration-discuss



gisburn

Posts: 3,657
From: DE

Registered: 6/16/05
How to get a "default editor" mode in Solaris ksh93 ? / was: Re: Re: TAB-TAB completion patch #003(which makes "gmacs" the default editor mode) / was: Re:[ast-users] RFE: Make TAB completion in ksh93 work like ESC-'='...
Posted: May 21, 2006 8:11 PM   in response to: April Chin

  Click to reply to this thread Reply

April Chin wrote:
> > On Mon, 15 May 2006 17:21:49 +0200 I. Szczesniak wrote:
> > > On 5/15/06, Glenn Fowler <gsf at research dot att dot com> wrote:
> > > > i.e., I believe the default editor must be NONE
> > > > with ksh93 the user can always do the appropriate .profile / ENV file
> > > > magic for editor preference
> >
> > > Why does bash then claim full POSIX conformance and default to emacs
> editing?
> >
> > bash overclaimed
> > the posix text for the "set" special builtin utility
> > for the "User Portability Utilities option"
> > states that the default values for set -o options are off
> > an sh that starts with any of these on by default is not conforming
> >
> > also note that only "set -o vi" mode is defined in the standard (see the
> rationale)
> > implementations are allowed to provide other command line editing modes
> > but those modes would be subject the the same "default value off" text
>
> I originally thought setting a default editor mode would be a good idea,
> but after Glenn's comments, I discussed this with our standards expert.
> He agrees that we should *not* set a default command-line editing
> mode if EDITOR and VISUAL are not set and set -o vi|emacs|gmacs are not set.
>
> So, no, we should not be setting a default command-line editor in ksh93.
> It would be violating POSIX standards.

Ok... I make a new version of the patch with that "default editor" stuff
removed then...

... do you have an idea how we still get a default editor mode set in
Solaris without violating the POSIX standard ? Editing /etc/profile as
part of the Solaris upgrade/patch process may not be polite and crawling
after each user's ~/.profile is even less polite than that... do you
have any other ideas how this could be done ?

----

Bye,
Roland

--
__ . . __
(o.\ \/ /.o) roland dot mainz at nrubsig dot org
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 7950090
(;O/ \/ \O;)
_______________________________________________
ksh93-integration-discuss mailing list
ksh93-integration-discuss at opensolaris dot org
http://mail.opensolaris.org/mailman/listinfo/ksh93-integration-discuss






Terms of Use | Privacy | Trademarks | Copyright Policy | Site Guidelines
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Use.
Copyright © 1995-2005 Sun Microsystems, Inc.