zsh-workers
 help / color / mirror / code / Atom feed
* 3.1.5++ completion listing problem
@ 1998-12-12 14:38 Peter Stephenson
  1998-12-12 15:55 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Peter Stephenson @ 1998-12-12 14:38 UTC (permalink / raw)
  To: Zsh hackers list

I don't know when this started...

% zsh -f
% mkdir foo
% touch foo/bar1
% ls foo/^D
<nothing printed>
% ls foo/^D^D^D^D^D^D
<still nothing. give up.>
% touch foo/bar2
% ls foo/^D
bar1 bar2

^D won't list if there is a unique match any more.  Hope it wasn't
something I did.

-- 
Peter Stephenson <pws@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


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

* Re: 3.1.5++ completion listing problem
  1998-12-12 14:38 3.1.5++ completion listing problem Peter Stephenson
@ 1998-12-12 15:55 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 1998-12-12 15:55 UTC (permalink / raw)
  To: Peter Stephenson, Zsh hackers list

On Dec 12,  3:38pm, Peter Stephenson wrote:
} Subject: 3.1.5++ completion listing problem
}
} % zsh -f
} % mkdir foo
} % touch foo/bar1
} % ls foo/^D
} <nothing printed>
} 
} ^D won't list if there is a unique match any more.

This appears to have come from Sven in zsh-workers/4510.  Relevant hunk
of zle_tricky.c diff, uudecoded from Sven't blob for your pleasure:

Index: DO NOT APPLY THIS PATCH, it's a fragment
***************
*** 3568,3587 ****
      return l + (cc / columns);
  }
  
  /* List the matches.  Note that the list entries are metafied. */
  
  /**/
  void
  listmatches(void)
  {
!     int longest = 1, fct, fw, colsz, t0, t1, ct, up, cl, xup = 0;
!     int off = 0, boff = 0, nboff = 0;
!     int of = (!aylist && isset(LISTTYPES) && !(haswhat & HAS_MISC));
!     char **arr, **ap, sav;
!     int nfpl, nfsl, nlpl, nlsl;
!     int listmax = getiparam("LISTMAX"), litnl = 0;
!     size_t (*strlenfn) _((char const *));
  
  #ifdef DEBUG
      /* Sanity check */
      if(!validlist) {
--- 4150,4183 ----
      return l + (cc / columns);
  }
  
+ /* This skips over matches that are not to be listed. */
+ 
+ static Cmatch *
+ skipnolist(Cmatch *p)
+ {
+     while (*p && ((*p)->flags & CMF_NOLIST))
+ 	p++;
+ 
+     return p;
+ }
+ 
  /* List the matches.  Note that the list entries are metafied. */
  
  /**/
  void
  listmatches(void)
  {
!     Cmgroup g;
!     Cmatch *p, m;
!     Cexpl *e;
!     int nlines = 0, ncols, colsz, ngr = 0, nlist = 0, longest = 1, pnl = 0;
!     int of = isset(LISTTYPES), opl = 0;
!     int listmax = getiparam("LISTMAX");
  
+     if (smatches < 2) {
+ 	showinglist = 0;
+ 	return;
+     }
  #ifdef DEBUG
      /* Sanity check */
      if(!validlist) {


I'd suggest simply deleting the "if (smatches < 2)" block, but perhaps
Sven can tell us what side-effect that may have elsewhere?

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


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

end of thread, other threads:[~1998-12-12 15:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-12-12 14:38 3.1.5++ completion listing problem Peter Stephenson
1998-12-12 15:55 ` Bart Schaefer

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).