On 6 Apr 2010, at 17:04, David Frascone wrote:

>
> Am I the only one who likes filename globbing, ONLY when it works?   
> One of my biggest annoyances with zsh was the default mode of  
> globbing everything.  And, zsh almost has me trained to glob  
> properly with fish . . . almost.
>
> But, in zsh, there IS a way to turn it off -- is there in fish?


I think that fish should know what to expand, and what not. Just like  
it should know what to complete and what not. Then, 'scp host:file* .'  
will not expand, and maybe even
grep *file file.c
I don't think the right way to decide is whether or not it matches a  
file.

Anyway, it is easy to add something like zsh's behaviour to fish. In  
parser.c, just put the following:

case EXPAND_WILDCARD_NO_MATCH:
{
   if( getenv("FISH_NOGLOB")) {
     al_push( args, wcsdup(tok_last( tok ))) ;
     /* should this be al_push( args, tok_last( tok ) ) ? */
   } else {
     unmatched_wildcard = 1;
     if( !unmatched )
     {
       unmatched = halloc_wcsdup( j, tok_last( tok ));
       unmatched_pos = tok_get_pos( tok );
     }
   }
   break;
}

which checks the environment variable FISH_NOGLOB (needs to be set  
before fish starts).
I started to figure out how to properly check a fish variable, when I  
saw the

"Configurability is the root of all evil"

entry in fish's documentation. To which I kind of agree. So, I don't  
think there is a right way to configure it. fish should just behave in  
this way, or not...

Michael

--
1434,1442c1434,1438
<                                                        
if( getenv("FISH_NOGLOB")) {
<                                                                
al_push( args, wcsdup(tok_last( tok ))) ;
<                                                       } else {
<                                                                
unmatched_wildcard = 1;
<                                                               if( ! 
unmatched )
<                                                               {
< 
                                                                        
unmatched 
  = halloc_wcsdup( j, tok_last( tok ));
< 
                                                                        
unmatched_pos 
  = tok_get_pos( tok );
<                                                               }
---
 >                                                        
unmatched_wildcard = 1;
 >                                                       if( ! 
unmatched )
 >                                                       {
 >                                                                
unmatched = halloc_wcsdup( j, tok_last( tok ));
 >                                                                
unmatched_pos = tok_get_pos( tok );
1443a1440
 >
--

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to