zsh-workers
 help / color / mirror / code / Atom feed
* Re: Directory completion
@ 1997-09-15 16:39 Peter Stephenson
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Stephenson @ 1997-09-15 16:39 UTC (permalink / raw)
  To: Zsh hackers list

sorrysorry, second minor addition (for printing out compctl).

*** Src/Zle/compctl.c.dir3	Mon Sep 15 16:36:35 1997
--- Src/Zle/compctl.c	Mon Sep 15 18:30:40 1997
***************
*** 790,796 ****
  printcompctl(char *s, Compctl cc, int printflags)
  {
      Compctl cc2;
!     char *css = "fcqovbAIFpEjrzBRGudeNOZUnQmw";
      char *mss = " pcCwWsSnNmrR";
      unsigned long t = 0x7fffffff;
      unsigned long flags = cc->mask;
--- 790,796 ----
  printcompctl(char *s, Compctl cc, int printflags)
  {
      Compctl cc2;
!     char *css = "fcqovbAIFpEjrzBRGudeNOZUnQmw/";
      char *mss = " pcCwWsSnNmrR";
      unsigned long t = 0x7fffffff;
      unsigned long flags = cc->mask;


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Directory completion
  1997-09-15 15:41 ` Directory completion Peter Stephenson
  1997-09-15 16:11   ` Peter Stephenson
  1997-09-15 16:31   ` Bruce Stephens
@ 1997-09-15 16:35   ` Peter Stephenson
  2 siblings, 0 replies; 5+ messages in thread
From: Peter Stephenson @ 1997-09-15 16:35 UTC (permalink / raw)
  To: Peter Stephenson

sorrysorry, second minor addition (for printing out compctl).

*** Src/Zle/compctl.c.dir3	Mon Sep 15 16:36:35 1997
--- Src/Zle/compctl.c	Mon Sep 15 18:30:40 1997
***************
*** 790,796 ****
  printcompctl(char *s, Compctl cc, int printflags)
  {
      Compctl cc2;
!     char *css = "fcqovbAIFpEjrzBRGudeNOZUnQmw";
      char *mss = " pcCwWsSnNmrR";
      unsigned long t = 0x7fffffff;
      unsigned long flags = cc->mask;
--- 790,796 ----
  printcompctl(char *s, Compctl cc, int printflags)
  {
      Compctl cc2;
!     char *css = "fcqovbAIFpEjrzBRGudeNOZUnQmw/";
      char *mss = " pcCwWsSnNmrR";
      unsigned long t = 0x7fffffff;
      unsigned long flags = cc->mask;


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Directory completion
  1997-09-15 15:41 ` Directory completion Peter Stephenson
  1997-09-15 16:11   ` Peter Stephenson
@ 1997-09-15 16:31   ` Bruce Stephens
  1997-09-15 16:35   ` Peter Stephenson
  2 siblings, 0 replies; 5+ messages in thread
From: Bruce Stephens @ 1997-09-15 16:31 UTC (permalink / raw)
  To: Zsh hackers list

pws@ifh.de said:
> Any comments (such as `why didn't we do this ages ago'?) 

Yeah.  Why didn't we do this ages ago?

Also, in compctl.yo:

  Filenames and filesystem paths.
+ )
+ item(tt(-/)){
+ Just filesystem paths.
  )


Should be

  Filenames and filesystem paths.
+ )
+ item(tt(-/))(
+ Just filesystem paths.
  )



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Directory completion
  1997-09-15 15:41 ` Directory completion Peter Stephenson
@ 1997-09-15 16:11   ` Peter Stephenson
  1997-09-15 16:31   ` Bruce Stephens
  1997-09-15 16:35   ` Peter Stephenson
  2 siblings, 0 replies; 5+ messages in thread
From: Peter Stephenson @ 1997-09-15 16:11 UTC (permalink / raw)
  To: Zsh hackers list

sorry, minor addition.

*** Doc/Zsh/compctl.yo.dir2	Mon Sep 15 17:05:00 1997
--- Doc/Zsh/compctl.yo	Mon Sep 15 18:09:28 1997
***************
*** 124,130 ****
  item(tt(-f))(
  Filenames and filesystem paths.
  )
! item(tt(-/)){
  Just filesystem paths.
  )
  item(tt(-c))(
--- 124,130 ----
  item(tt(-f))(
  Filenames and filesystem paths.
  )
! item(tt(-/))(
  Just filesystem paths.
  )
  item(tt(-c))(


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Directory completion
  1997-09-15  8:05 Is anybody maintaining c2z and lete2ctl? Peter Stephenson
@ 1997-09-15 15:41 ` Peter Stephenson
  1997-09-15 16:11   ` Peter Stephenson
                     ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Peter Stephenson @ 1997-09-15 15:41 UTC (permalink / raw)
  To: Zsh hackers list

I wrote about lete2ctl:
> It might work a little better if we had special directory completion, like
> tcsh, instead of relying on ordinary globbing.  Maybe it's time we bit
> the bullet and did this:  I can't believe the code would be large or
> difficult.

As I thought, it's completely trivial: it just hijacks the usual code
for completing paths.  Here's a patch for 3.1.  Now you can write

compctl -/g '*.ps'

instead of some circumlocution like:

compctl -g '*.ps' + -g '*(-/)' gv

which doesn't allow you to look for subdirectories of directories with
ps files in.  Writing things like '-/g ...' should be an easy and
sensible habit to get into.  Since it uses the usual path code,
symbolic links are traced properly without you having to think about
them.  In technical terms, `it's not flakey any more'.

Any comments (such as `why didn't we do this ages ago'?)

*** Doc/Zsh/compctl.yo.dir	Tue Aug  5 09:49:45 1997
--- Doc/Zsh/compctl.yo	Mon Sep 15 17:05:00 1997
***************
*** 98,104 ****
  texinode(Option Flags)(Alternative Completion)(Command Flags)(Programmable Completion)
  sect(Option Flags)
  startlist()
! list([ tt(-fcFBdeaRGovNAIOPZEnbjrzu) ])
  list([ tt(-k) var(array) ] [ tt(-g) var(globstring) ] \
    [ tt(-s) var(subststring) ])
  list([ tt(-K) var(function) ] [ tt(-H) var(num pattern) ])
--- 98,104 ----
  texinode(Option Flags)(Alternative Completion)(Command Flags)(Programmable Completion)
  sect(Option Flags)
  startlist()
! list([ tt(-fcFBdeaRGovNAIOPZEnbjrzu/) ])
  list([ tt(-k) var(array) ] [ tt(-g) var(globstring) ] \
    [ tt(-s) var(subststring) ])
  list([ tt(-K) var(function) ] [ tt(-H) var(num pattern) ])
***************
*** 123,128 ****
--- 123,131 ----
  startitem()
  item(tt(-f))(
  Filenames and filesystem paths.
+ )
+ item(tt(-/)){
+ Just filesystem paths.
  )
  item(tt(-c))(
  Command names, including aliases, shell functions, builtins
*** Src/Zle/comp.h.dir	Mon Sep 15 16:35:31 1997
--- Src/Zle/comp.h	Mon Sep 15 16:35:45 1997
***************
*** 140,145 ****
--- 140,146 ----
  #define CC_QUOTEFLAG	(1<<25)
  #define CC_EXTCMDS	(1<<26)
  #define CC_RESWDS	(1<<27)
+ #define CC_DIRS		(1<<28)
  
  #define CC_RESERVED	(1<<31)
  
*** Src/Zle/compctl.c.dir	Mon Sep 15 16:36:33 1997
--- Src/Zle/compctl.c	Mon Sep 15 16:36:35 1997
***************
*** 176,181 ****
--- 176,184 ----
  	    case 'Q':
  		cct.mask |= CC_QUOTEFLAG;
  		break;
+ 	    case '/':
+ 		cct.mask |= CC_DIRS;
+ 		break;
  	    case 'k':
  		if ((*argv)[1]) {
  		    cct.keyvar = (*argv) + 1;
*** Src/Zle/zle_tricky.c.dir	Mon Sep 15 16:57:36 1997
--- Src/Zle/zle_tricky.c	Mon Sep 15 17:27:39 1997
***************
*** 2519,2525 ****
  
      /* Handle completion of files specially (of course). */
  
!     if ((cc->mask & (CC_FILES | CC_COMMPATH)) || cc->glob) {
  	/* s1 and s2 point to the last/first slash in the prefix/suffix. */
  	if (!s1)
  	    s1 = rpre;
--- 2519,2525 ----
  
      /* Handle completion of files specially (of course). */
  
!     if ((cc->mask & (CC_FILES | CC_DIRS | CC_COMMPATH)) || cc->glob) {
  	/* s1 and s2 point to the last/first slash in the prefix/suffix. */
  	if (!s1)
  	    s1 = rpre;
***************
*** 2635,2641 ****
  				prpre = pp;
  			    }
  			}
! 		    }
  		    /* The compctl has a glob pattern (compctl -g). */
  		    if (cc->glob) {
  			int ns, pl = strlen(prpre), o;
--- 2635,2642 ----
  				prpre = pp;
  			    }
  			}
! 		    } else if (cc->mask && CC_DIRS)
! 			gen_matches_files(1, 0, 0);
  		    /* The compctl has a glob pattern (compctl -g). */
  		    if (cc->glob) {
  			int ns, pl = strlen(prpre), o;

-- 
Peter Stephenson <pws@ifh.de>       Tel: +49 33762 77366
WWW:  http://www.ifh.de/~pws/       Fax: +49 33762 77413
Deutsches Elektronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, Platanenallee 6, 15738 Zeuthen, Germany.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1997-09-15 16:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-09-15 16:39 Directory completion Peter Stephenson
  -- strict thread matches above, loose matches on Subject: below --
1997-09-15  8:05 Is anybody maintaining c2z and lete2ctl? Peter Stephenson
1997-09-15 15:41 ` Directory completion Peter Stephenson
1997-09-15 16:11   ` Peter Stephenson
1997-09-15 16:31   ` Bruce Stephens
1997-09-15 16:35   ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).