zsh-workers
 help / color / mirror / code / Atom feed
* REC_EXACT and AUTO_MENU, and compctl -U too
@ 1998-06-19 18:14 Bart Schaefer
  1998-06-19 18:53 ` Zefram
  0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 1998-06-19 18:14 UTC (permalink / raw)
  To: zsh-workers

One thing that's annoyed me for a very long time is the interaction of
recexact with automenu.  Suppose I have both options set.

zsh% /usr/li

The possible completions at this point are /usr/lib and /usr/libexec.  I
press TAB (which is bound to expand-or-complete).

zsh% /usr/lib

This is not a completion; it's the unique prefix of a menu completion, or
it would be in most circumstances.  With recexact, though, when I press
TAB again expecting to menucomplete to libexec, I instead get /usr/lib/
and now I can only complete within that directory.

What I'd like is to have recexact behavior when I type the entire prefix
and automenu behavior when zsh supplies the prefix.

While I'm on the subject of mildly stupid completion behavior, automenu
in conjunction with compctl -U could do with a bit of work.  It'd be a
lot more useful if menu completion kicked in immediately when compctl -U
returns multiple matches and automenu is set.  Otherwise you lose both
the set of completions and the nonunique suffix as soon as the first TAB
is pressed.

I haven't dug around in the code for either of these yet; any conflicting
opinions on whether this is worthwhile?  Any remarks on how difficult they
are to pull off?

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


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

* Re: REC_EXACT and AUTO_MENU, and compctl -U too
  1998-06-19 18:14 REC_EXACT and AUTO_MENU, and compctl -U too Bart Schaefer
@ 1998-06-19 18:53 ` Zefram
  1998-06-19 19:28   ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Zefram @ 1998-06-19 18:53 UTC (permalink / raw)
  To: Bart Schaefer; +Cc: zsh-workers

Bart Schaefer wrote:
>What I'd like is to have recexact behavior when I type the entire prefix
>and automenu behavior when zsh supplies the prefix.

Interesting.  At the moment, zle makes absolutely no distinction
between text inserted by the user and text inserted by completion.
It also does not consider itself to be in the middle of a completion
immediately after completion inserts text (other than in menu completion).
I suppose an extra state flag, to disable REC_EXACT would be reasonable.
Set the flag when completion inserts text, and clear it when any other
editing action occurs.  Would this give the semantics you want?

>While I'm on the subject of mildly stupid completion behavior, automenu
>in conjunction with compctl -U could do with a bit of work.  It'd be a
>lot more useful if menu completion kicked in immediately when compctl -U
>returns multiple matches and automenu is set.  Otherwise you lose both
>the set of completions and the nonunique suffix as soon as the first TAB
>is pressed.

I see what you mean.  I think common prefix recognition should be
disabled when using a -U compctl.  The effect of -U is to disable the
use of existing prefixes, so trying to take advantage of the usual prefix
semantics under such circumstances is pretty stupid.

>                                         Any remarks on how difficult they
>are to pull off?

Neither of them seems particularly difficult to implement, but they
won't exactly make zle_tricky any less _tricky.  Testing will be tedious.

-zefram


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

* Re: REC_EXACT and AUTO_MENU, and compctl -U too
  1998-06-19 18:53 ` Zefram
@ 1998-06-19 19:28   ` Bart Schaefer
  0 siblings, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 1998-06-19 19:28 UTC (permalink / raw)
  To: Zefram, zsh-workers

On Jun 19,  7:53pm, Zefram wrote:
} Subject: Re: REC_EXACT and AUTO_MENU, and compctl -U too
}
} I suppose an extra state flag, to disable REC_EXACT would be reasonable.
} Set the flag when completion inserts text, and clear it when any other
} editing action occurs.  Would this give the semantics you want?

Yes, but it's probably more general than necessary.  The only time the
semantics I want are interesting is when automenu is in effect, and
there is already a state flag for that (or was the last time I looked,
which was admittedly quite a while ago).  It'd probably be sufficient
to disable recexact when the automenu state flag is set.

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


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

end of thread, other threads:[~1998-06-19 19:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-06-19 18:14 REC_EXACT and AUTO_MENU, and compctl -U too Bart Schaefer
1998-06-19 18:53 ` Zefram
1998-06-19 19:28   ` 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).