zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH]always show complete list
@ 2002-05-02 18:42 joel w. reed
  2002-05-02 21:48 ` Hans Dieter Pearcey
  0 siblings, 1 reply; 6+ messages in thread
From: joel w. reed @ 2002-05-02 18:42 UTC (permalink / raw)
  To: zsh-workers


[-- Attachment #1.1: Type: text/plain, Size: 655 bytes --]

this patch adds a config option LISTALWAYS that if set, makes 
zsh-4.0.4 always show the complete list if the completion 
resulted in only a partial completion (to help the user decide
what to type next w/o the need for another TAB).

lets say i have a directory with 2 entries:

  opal-3.0.4
  opal-4.0 

my patched zsh will show the following after i type 'cd oTAB'

(%:~/src) cd opal-    
opal-3.0.4/  opal-4.0/

zsh is great. thanks.

jr

-- 
------------------------------------------------------------
Joel W. Reed                                    412-257-3881
--------All the simple programs have been written.----------


[-- Attachment #1.2: LISTALWAYS.patch --]
[-- Type: text/plain, Size: 1396 bytes --]

--- Src/options.c.orig	Mon Jun 25 12:31:19 2001
+++ Src/options.c	Tue Apr 30 15:16:15 2002
@@ -146,6 +146,7 @@ static struct optname optns[] = {
 {NULL, "kshglob",             OPT_EMULATE|OPT_KSH,       KSHGLOB},
 {NULL, "kshoptionprint",      OPT_EMULATE|OPT_KSH,	 KSHOPTIONPRINT},
 {NULL, "kshtypeset",          OPT_EMULATE|OPT_KSH,	 KSHTYPESET},
+{NULL, "listalways",	      OPT_ALL,			 LISTALWAYS},
 {NULL, "listambiguous",	      OPT_ALL,			 LISTAMBIGUOUS},
 {NULL, "listbeep",	      OPT_ALL,			 LISTBEEP},
 {NULL, "listpacked",	      0,			 LISTPACKED},
--- Src/Zle/compresult.c.orig	Mon May 28 07:42:00 2001
+++ Src/Zle/compresult.c	Tue Apr 30 15:17:48 2002
@@ -806,9 +806,9 @@ do_ambiguous(void)
 	 * prefix was inserted, return now, bypassing the list-displaying  *
 	 * code.  On the way, invalidate the list and note that we don't   *
 	 * want to enter an AUTO_MENU imediately.                          */
-	if ((uselist == 3 ||
+	if (!isset(LISTALWAYS) && ((uselist == 3 ||
 	     (!uselist && isset(BASHAUTOLIST) && isset(LISTAMBIGUOUS))) &&
-	    la) {
+	    la)) {
 	    int fc = fromcomp;
 
 	    invalidatelist();
--- Src/zsh.h.orig	Tue Apr 30 15:34:12 2002
+++ Src/zsh.h	Tue Apr 30 15:15:29 2002
@@ -1384,6 +1384,7 @@ enum {
     KSHGLOB,
     KSHOPTIONPRINT,
     KSHTYPESET,
+    LISTALWAYS,
     LISTAMBIGUOUS,
     LISTBEEP,
     LISTPACKED,

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

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

* Re: [PATCH]always show complete list
  2002-05-02 18:42 [PATCH]always show complete list joel w. reed
@ 2002-05-02 21:48 ` Hans Dieter Pearcey
  2002-05-02 23:20   ` Bart Schaefer
  2002-05-03  0:52   ` joel w. reed
  0 siblings, 2 replies; 6+ messages in thread
From: Hans Dieter Pearcey @ 2002-05-02 21:48 UTC (permalink / raw)
  To: joel w. reed; +Cc: zsh-workers

On Thu, May 02, 2002 at 02:42:57PM -0400, joel w. reed wrote:
> this patch adds a config option LISTALWAYS that if set, makes 
> zsh-4.0.4 always show the complete list if the completion 
> resulted in only a partial completion (to help the user decide
> what to type next w/o the need for another TAB).
> 
> lets say i have a directory with 2 entries:
> 
>   opal-3.0.4
>   opal-4.0 
> 
> my patched zsh will show the following after i type 'cd oTAB'
> 
> (%:~/src) cd opal-    
> opal-3.0.4/  opal-4.0/

zsh already does this.

see AUTO_LIST (which is on by default) and LIST_AMBIGUOUS in zshoptions.

Specifically, if you setopt NO_LIST_AMBIGUOUS, the above behavior is
observed.

hdp.


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

* Re: [PATCH]always show complete list
  2002-05-02 21:48 ` Hans Dieter Pearcey
@ 2002-05-02 23:20   ` Bart Schaefer
  2002-05-03  3:08     ` Hans Dieter Pearcey
  2002-05-03  0:52   ` joel w. reed
  1 sibling, 1 reply; 6+ messages in thread
From: Bart Schaefer @ 2002-05-02 23:20 UTC (permalink / raw)
  To: Hans Dieter Pearcey; +Cc: joel w. reed, zsh-workers

On Thu, 2 May 2002, Hans Dieter Pearcey wrote:

> On Thu, May 02, 2002 at 02:42:57PM -0400, joel w. reed wrote:
> > this patch adds a config option LISTALWAYS that if set, makes
> > zsh-4.0.4 always show the complete list if the completion
> > resulted in only a partial completion
> >
>
> zsh already does this.
>
> see AUTO_LIST (which is on by default) and LIST_AMBIGUOUS in zshoptions.

No, you misunderstand.  With autolist+listambiguous, zsh will first
complete as far as it can, and then stop -- you have to press TAB again
to see the list of possible completions.

This patch is intended to cause zsh to immediately display the list any
time it can't complete to a unique match, even if it can complete part of
the way.

However, this can be done in the new completion system without having to
change the C code by assigning compstate[list]=list at some appropriate
place.  I don't have time to figure out exactly where, at the moment ...


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

* Re: [PATCH]always show complete list
  2002-05-02 21:48 ` Hans Dieter Pearcey
  2002-05-02 23:20   ` Bart Schaefer
@ 2002-05-03  0:52   ` joel w. reed
  1 sibling, 0 replies; 6+ messages in thread
From: joel w. reed @ 2002-05-03  0:52 UTC (permalink / raw)
  To: Hans Dieter Pearcey; +Cc: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 1209 bytes --]

On May 02, hdp@pobox.com contorted a few electrons to say...
Hans> On Thu, May 02, 2002 at 02:42:57PM -0400, joel w. reed wrote:
Hans> > this patch adds a config option LISTALWAYS that if set, makes 
Hans> > zsh-4.0.4 always show the complete list if the completion 
Hans> > resulted in only a partial completion (to help the user decide
Hans> > what to type next w/o the need for another TAB).
Hans> > 
Hans> > lets say i have a directory with 2 entries:
Hans> > 
Hans> >   opal-3.0.4
Hans> >   opal-4.0 
Hans> > 
Hans> > my patched zsh will show the following after i type 'cd oTAB'
Hans> > 
Hans> > (%:~/src) cd opal-    
Hans> > opal-3.0.4/  opal-4.0/
Hans> 
Hans> zsh already does this.
Hans> 
Hans> see AUTO_LIST (which is on by default) and LIST_AMBIGUOUS in zshoptions.
Hans> 
Hans> Specifically, if you setopt NO_LIST_AMBIGUOUS, the above behavior is
Hans> observed.

awesome! well it was nice poking around in the code for the first
time anyway...

jr


Hans> 
Hans> hdp.

-- 
------------------------------------------------------------
Joel W. Reed                                    412-257-3881
--------All the simple programs have been written.----------


[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

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

* Re: [PATCH]always show complete list
  2002-05-02 23:20   ` Bart Schaefer
@ 2002-05-03  3:08     ` Hans Dieter Pearcey
  2002-05-03  4:07       ` Bart Schaefer
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Dieter Pearcey @ 2002-05-03  3:08 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-workers

On Thu, May 02, 2002 at 04:20:10PM -0700, Bart Schaefer wrote:
> On Thu, 2 May 2002, Hans Dieter Pearcey wrote:
> 
> > On Thu, May 02, 2002 at 02:42:57PM -0400, joel w. reed wrote:
> > > this patch adds a config option LISTALWAYS that if set, makes
> > > zsh-4.0.4 always show the complete list if the completion
> > > resulted in only a partial completion
> > >
> >
> > zsh already does this.
> >
> > see AUTO_LIST (which is on by default) and LIST_AMBIGUOUS in zshoptions.
> 
> No, you misunderstand.  With autolist+listambiguous, zsh will first
> complete as far as it can, and then stop -- you have to press TAB again
> to see the list of possible completions.

Sorry, I think you misunderstand. :)

My original post went on to say "specifically, setopt
NO_LIST_AMBIGUOUS".

autolist+nolistambiguous will, AFAIK, do what the original poster
wanted.

hdp.


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

* Re: [PATCH]always show complete list
  2002-05-03  3:08     ` Hans Dieter Pearcey
@ 2002-05-03  4:07       ` Bart Schaefer
  0 siblings, 0 replies; 6+ messages in thread
From: Bart Schaefer @ 2002-05-03  4:07 UTC (permalink / raw)
  To: Hans Dieter Pearcey; +Cc: zsh-workers

On Thu, 2 May 2002, Hans Dieter Pearcey wrote:

> Sorry, I think you misunderstand. :)
>
> My original post went on to say "specifically, setopt
> NO_LIST_AMBIGUOUS".

Oy.  Well, that's what I get for trying to answer zsh mail when I'm in a
hurry ...


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

end of thread, other threads:[~2002-05-03  4:08 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-05-02 18:42 [PATCH]always show complete list joel w. reed
2002-05-02 21:48 ` Hans Dieter Pearcey
2002-05-02 23:20   ` Bart Schaefer
2002-05-03  3:08     ` Hans Dieter Pearcey
2002-05-03  4:07       ` Bart Schaefer
2002-05-03  0:52   ` joel w. reed

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