zsh-workers
 help / color / mirror / code / Atom feed
From: Rasmus Tengblad <marvin@lysator.liu.se>
To: zsh-workers@math.gatech.edu
Subject: feature-request of double-tab-list
Date: Sat, 19 Sep 1998 17:36:02 +0200 (MET DST)	[thread overview]
Message-ID: <Pine.GSO.4.02.9809191718590.10063-200000@sally.lysator.liu.se> (raw)

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1239 bytes --]

Dear zsh-workers,

First i'd like to tell you that I really like zsh. Best shell there is!
However, there is one small thing I like better about bash, and that's the
double-tab-press or what ever you'd want to call it. It's sort of like zsh
with AUTO_LIST set, but with the exception that you have to press tab
twice before the list is displayed.
Of course the other features of zsh outweighs that one advantage eith
bash, so I still use zsh as my loginshell, as well as favourite
shellscript-interpreter.

I've made an ugly patch that fixes it the way I like it, but it only
hardcodes it into the shell. I'm attaching it to this mail, just to
explain more exactly what it is I'd like.
I suppose the correct way of doing is would be to have a variable that
controls how many times you need to press tab before the list shows, and
the turn the feature on or off with the AUTO_LIST option.
I had plans to fix it this way myself, and send you that patch instead,
but I havn't got around to doing it yet, and I'm not sure I ever will...

Anyway, I hope you'll include something like this in future releases of
zsh.
Cheers!

/Rasmus Tengblad
http://www.lysator.liu.se/~marvin


PS. If this doesn't make any sense to you, don't hesitate to ask.

[-- Attachment #2: Type: TEXT/PLAIN, Size: 1647 bytes --]

diff -r -X skiplist -U 3 zsh/Src/zle.h /home/marvin/src/zsh/Src/zle.h
--- zsh/Src/zle.h	Wed Jul 22 13:26:22 1998
+++ /home/marvin/src/zsh/Src/zle.h	Fri Jul 24 12:27:28 1998
@@ -36,6 +36,12 @@
 #endif
 
 #ifdef ZLE
+
+/* Number of tabs in a sequence needed to show completionlist */
+#define TABS_REQUIRED 2
+
+/* Number of tabs pressed in sequence */
+ZLEXTERN int tabcount;
 
 /* size of line buffer */
 ZLEXTERN int linesz;
diff -r -X skiplist -U 3 zsh/Src/zle_main.c /home/marvin/src/zsh/Src/zle_main.c
--- zsh/Src/zle_main.c	Wed Jul 22 13:26:23 1998
+++ /home/marvin/src/zsh/Src/zle_main.c	Fri Jul 24 12:27:28 1998
@@ -360,6 +360,7 @@
     tv.tv_sec = 0;
 #endif
 
+    tabcount = 0;
     keytimeout = getiparam("KEYTIMEOUT");
     if (!shout) {
 	if (SHTTY != -1)
diff -r -X skiplist -U 3 zsh/Src/zle_tricky.c /home/marvin/src/zsh/Src/zle_tricky.c
--- zsh/Src/zle_tricky.c	Wed Jul 22 13:26:23 1998
+++ /home/marvin/src/zsh/Src/zle_tricky.c	Fri Jul 24 12:27:29 1998
@@ -2994,6 +2994,8 @@
 {
     if(showinglist == -2)
 	listmatches();
+    else
+       tabcount = 0;
     if(validlist) {
 	freearray(amatches);
 	zsfree(rpre);
@@ -3177,9 +3179,10 @@
     }
     /* At this point, we might want a completion listing.  Show the listing *
      * if it is needed.                                                     */
-    if (isset(LISTBEEP))
+    if (isset(LISTBEEP) && tabcount==0)
 	feep();
-    if (isset(AUTOLIST) && !amenu && !showinglist)
+    if ( (isset(AUTOLIST) || (tabcount++ == TABS_REQUIRED-1))
+	 && !amenu && !showinglist)
 	showinglist = -2;
     if(inv)
 	invalidatelist();

             reply	other threads:[~1998-09-19 15:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-09-19 15:36 Rasmus Tengblad [this message]
1999-01-28 16:33 ` Bart Schaefer
1999-01-28 16:49 Sven Wischnowsky
1999-01-29  8:31 Sven Wischnowsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.GSO.4.02.9809191718590.10063-200000@sally.lysator.liu.se \
    --to=marvin@lysator.liu.se \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).