Re: Thoughts on zsh? (was Re: vim like completion in bash?)

2007-03-07 Thread Steve Lamb
Chris Bannister wrote:
> I *too* would like to know how bash can do that. Is zsh worth changing
> to just for that? Yeah, I know "apt-get install zsh-doc" :-)

Just for that?  Who knows.  I however switched to zsh quite a while ago
because bash just befuddled me.  It seemed like simple things that I learned
from my first shell account on Netcom were just not present.  Furthermore I am
a staunch believer that shell scripting is largely marginalized with the
advent of highly successful general purpose scripting languages like Perl,
Python and Ruby.  So any keen things bash can do in scripts don't interest me.

zsh just worked out of the box for me.  My .zshrc file is extremely bare
with over half of it dedicated to single-line aliases.  So for me it was worth
it to switch since for me to learn bash or make bash conform to what I had
learned years prior was just too high by comparison.  Someone who thinks and
work as bash does might find that to not be the case.

-- 
 Steve C. Lamb | But who decides what they dream?
   PGP Key: 8B6E99C5   |   And dream I do...
---+-



signature.asc
Description: OpenPGP digital signature


Re: Thoughts on zsh? (was Re: vim like completion in bash?)

2007-03-06 Thread Franck Joncourt
On Tue, Mar 06, 2007 at 10:47:40AM -0500, cga2000 wrote:
> > I was also surprised that bash can do this. I played around with it a
> > bit and found that my bash can do the "*xx*" completion only if I
> > do not source /etc/bash_completion. I have to choose between having the
> > "*xx*" completion behavior and having the handy features offered by
> > /etc/bash_completion. I use bash 3.1dfsg-8 on a Sid system. 
> > 
> > Can anybody confirm this? Is this a bug or a consequence of the way
> > /etc/bash_completion works? (I would expect that bash_completion is
> > supposed to add features without removing existing ones.)
>

I wrote in an other email :
> > I may have missed something ; I am running Sid.
> > Enabling bash completion, it does not work. However, without bash
> > completion it does work ! Where is the trick ?

Well, so I am not crazy. That is good :p! I had the same behaviour on
Sid (bash : 3.1dfsg-8) and Etch (bash 3.1dfsg-8).

> Maybe the "problem" is caused by the use of  for two different
> mechanisms:
> 
> 1. "completion" .. you type the first 0-n characters of an entity, hit
> and bash will complete what you typed if only one match is
>found and beep otherwise.  In the latter case you can issue a second
> and bash will display the list of matches.  This feature is
>programmable - ie. you can define completion rules to filter
>out entities that do not make sense in a given context.
> 
> 2. "pathname expansion": you use special characters and .. optionally
>literals to build a pattern, hit  and bash expands your pattern
>into a list of matching entities.  
> 
> Since pathname expansion returns a list of fully-named entities it seems
> that a different filtering mechanism than programmable completion would
> be needed: something that lets you filter out fully-named entities that
> do not make sense in a given context -- rather than what programmable
> completion offers: conditionally completing your input according to the
> rules specified in /etc/bash_completion.
> 
> Kinda hard to explain but it doesn't strike me as a bug -- functional
> or otherwise.

-- 
Franck Joncourt
http://www.debian.org
http://smhteam.info/wiki/
GPG server : pgpkeys.mit.edu
Fingerprint : C10E D1D0 EF70 0A2A CACF  9A3C C490 534E 75C0 89FE


signature.asc
Description: Digital signature


Re: Thoughts on zsh? (was Re: vim like completion in bash?)

2007-03-06 Thread cga2000
On Tue, Mar 06, 2007 at 07:29:12AM EST, Florian Kulzer wrote:
> On Tue, Mar 06, 2007 at 23:58:42 +1300, Chris Bannister wrote:
> > On Sun, Mar 04, 2007 at 11:20:54PM -0800, Steve Lamb wrote:
> > > cga2000 wrote:
> > > > .. and as everybody will no doubt have noticed, ss/tt is one keystroke
> > > > less than ss/*t* (not to mention the fact that the '*' is shifted and a
> > > > little harder to reach).
> > > 
> > > Ok, and now to point out the other glaringly obvious part of this 
> > > thread.
> > >  Care to share how you got bash to do that, in detail, since obviously 
> > > the OP
> > > is missing some piece of information you've got?
> > 
> > I *too* would like to know how bash can do that. Is zsh worth changing
> > to just for that? Yeah, I know "apt-get install zsh-doc" :-)
> 
> I was also surprised that bash can do this. I played around with it a
> bit and found that my bash can do the "*xx*" completion only if I
> do not source /etc/bash_completion. I have to choose between having the
> "*xx*" completion behavior and having the handy features offered by
> /etc/bash_completion. I use bash 3.1dfsg-8 on a Sid system. 
> 
> Can anybody confirm this? Is this a bug or a consequence of the way
> /etc/bash_completion works? (I would expect that bash_completion is
> supposed to add features without removing existing ones.)

Maybe the "problem" is caused by the use of  for two different
mechanisms:

1. "completion" .. you type the first 0-n characters of an entity, hit
and bash will complete what you typed if only one match is
   found and beep otherwise.  In the latter case you can issue a second
and bash will display the list of matches.  This feature is
   programmable - ie. you can define completion rules to filter
   out entities that do not make sense in a given context.

2. "pathname expansion": you use special characters and .. optionally
   literals to build a pattern, hit  and bash expands your pattern
   into a list of matching entities.  

Since pathname expansion returns a list of fully-named entities it seems
that a different filtering mechanism than programmable completion would
be needed: something that lets you filter out fully-named entities that
do not make sense in a given context -- rather than what programmable
completion offers: conditionally completing your input according to the
rules specified in /etc/bash_completion.

Kinda hard to explain but it doesn't strike me as a bug -- functional
or otherwise.

Thanks,
cga


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Thoughts on zsh? (was Re: vim like completion in bash?)

2007-03-06 Thread Florian Kulzer
On Tue, Mar 06, 2007 at 23:58:42 +1300, Chris Bannister wrote:
> On Sun, Mar 04, 2007 at 11:20:54PM -0800, Steve Lamb wrote:
> > cga2000 wrote:
> > > .. and as everybody will no doubt have noticed, ss/tt is one keystroke
> > > less than ss/*t* (not to mention the fact that the '*' is shifted and a
> > > little harder to reach).
> > 
> > Ok, and now to point out the other glaringly obvious part of this 
> > thread.
> >  Care to share how you got bash to do that, in detail, since obviously the 
> > OP
> > is missing some piece of information you've got?
> 
> I *too* would like to know how bash can do that. Is zsh worth changing
> to just for that? Yeah, I know "apt-get install zsh-doc" :-)

I was also surprised that bash can do this. I played around with it a
bit and found that my bash can do the "*xx*" completion only if I
do not source /etc/bash_completion. I have to choose between having the
"*xx*" completion behavior and having the handy features offered by
/etc/bash_completion. I use bash 3.1dfsg-8 on a Sid system. 

Can anybody confirm this? Is this a bug or a consequence of the way
/etc/bash_completion works? (I would expect that bash_completion is
supposed to add features without removing existing ones.)

-- 
Regards,
  Florian


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Thoughts on zsh? (was Re: vim like completion in bash?)

2007-03-06 Thread Chris Bannister
On Sun, Mar 04, 2007 at 11:20:54PM -0800, Steve Lamb wrote:
> cga2000 wrote:
> > .. and as everybody will no doubt have noticed, ss/tt is one keystroke
> > less than ss/*t* (not to mention the fact that the '*' is shifted and a
> > little harder to reach).
> 
> Ok, and now to point out the other glaringly obvious part of this thread.
>  Care to share how you got bash to do that, in detail, since obviously the OP
> is missing some piece of information you've got?

I *too* would like to know how bash can do that. Is zsh worth changing
to just for that? Yeah, I know "apt-get install zsh-doc" :-)


-- 
Chris.
==
Don't forget to check that your /etc/apt/sources.lst entries point to 
etch and not testing, otherwise you may end up with a broken system once
etch goes stable.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]