zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@candle.brasslantern.com>
To: zsh-workers@sunsite.auc.dk
Subject: zstyle question: enter menu selection on lots of ambiguity
Date: Thu, 27 Jul 2000 09:51:18 +0000	[thread overview]
Message-ID: <1000727095119.ZM32543@candle.brasslantern.com> (raw)

So even after all Sven's hard work, I'm still not satisfied with the way
the menu style and long-list work together.

What I want is:

- automenu (first tab lists, second tab menu completes), except
- when the list won't fit on the screen, the first tab should
  enter menu selection immediately, but
- simply asking for a listing with C-d should never do menu-selection,
  no matter how long the list is

If I use 'select=long-list' I get menu-selection on the second tab.

If I use 'yes=long-list' I get menu completion started when I type C-d
(and some other pretty odd behavior besides, I might add).

If I use both, I get menu-selection on the second tab and on C-d, and
sometimes more of the strange behavior (the same match inserted on the
line multiple times and stuff like that -- I think it happens if you hit
C-d repeatedly after completion or selection has started when the match
on the line (highlighted, in selection) is NOT a directory).

So I hit upon this scheme:

zstyle -e ':completion:*' menu \
  '[[ $compstate[list] == ambiguous ]] && \
     compstate[list]="$compstate[list] list" reply=(select=long-list)'

This *almost* works -- if the list doesn't fill the screen, then I get a
list on the first tab and menu completion on the second, and if the list
does fill the screen then I get menu-selection on the first tab.  Yay!
BUT:  As soon as menu selection has started once this way, it starts for
ALL menu completions -- on the second tab for short lists, on the first
tab for long ones.  I don't want it to start on the second tab for short
lists.  (Actually, I want it to start on the second tab for lists longer
than 12 items, but I thought I'd work on that separately.)

I also worry about appending "list" to the value of compstate[list]; it
produces values like "ambiguous list" which doesn't *appear* to break any
other code, but ...

So what's the right way to accomplish all of this?

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

Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net   


             reply	other threads:[~2000-07-27  9:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-07-27  9:51 Bart Schaefer [this message]
2000-07-27 10:58 Sven Wischnowsky
2000-07-27 17:19 ` Bart Schaefer
2000-07-28  7:00 Sven Wischnowsky
2000-07-30  4:34 ` Bart Schaefer

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=1000727095119.ZM32543@candle.brasslantern.com \
    --to=schaefer@candle.brasslantern.com \
    --cc=zsh-workers@sunsite.auc.dk \
    /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).