zsh-workers
 help / color / mirror / code / Atom feed
* Once more: "Do you wish to see all xxx possibilities?"
@ 1999-11-03 17:07 Andrej Borsenkow
  0 siblings, 0 replies; 2+ messages in thread
From: Andrej Borsenkow @ 1999-11-03 17:07 UTC (permalink / raw)
  To: ZSH workers mailing list

I still do not understand, when it is printed. Looking in Zle/compresult.c:

    /* Maybe we have to ask if the user wants to see the list. */
    if ((!minfo.cur || !minfo.asked) &&
	((complistmax && listdat.nlist > complistmax) ||
	 (!complistmax && listdat.nlines >= lines))) {

It means, that it should ask if either complistmax is set (value of
$compconfig[list_max]?) or number of lines exceeds $LINES. It seems, that Zsh
sometimes gets incorrect count in listdat.nlines. Consider:

zsh -f
itsrm2% autoload -U compinit; compinit -D
itsrm2% SELECTMIN=0
itsrm2% zmodload complist
itsrm2% bindkey -e
itsrm2% for i in {01..30}
do
touch
${i}xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
done

(the above may be wrapped)
itsrm2% echo $LINES
24
itsrm2% ls <TAB>
01xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
02xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
03xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
04xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
05xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
06xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
07xxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
21xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
22xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
23xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
24xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
25xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
26xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
27xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
28xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
29xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
30xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
itsrm2% ls

That is, Zsh spits out the whole list even when it does not fit to screen. The
$LINES is correct.
itsrm2% stty -a
speed 9600 baud;
rows = 24; columns = 80; ypixels = 370; xpixels = 730;
...

/andrej


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

* Re: Once more: "Do you wish to see all xxx possibilities?"
@ 1999-11-04  9:47 Sven Wischnowsky
  0 siblings, 0 replies; 2+ messages in thread
From: Sven Wischnowsky @ 1999-11-04  9:47 UTC (permalink / raw)
  To: zsh-workers


Andrej Borsenkow wrote:

> I still do not understand, when it is printed. Looking in Zle/compresult.c:
> 
>     /* Maybe we have to ask if the user wants to see the list. */
>     if ((!minfo.cur || !minfo.asked) &&
> 	((complistmax && listdat.nlist > complistmax) ||
> 	 (!complistmax && listdat.nlines >= lines))) {
> 
> It means, that it should ask if either complistmax is set (value of
> $compconfig[list_max]?) or number of lines exceeds $LINES. It seems, that Zsh
> sometimes gets incorrect count in listdat.nlines. Consider:

Many years ago, documentation was invented:

  LISTMAX
     In the line editor, the number of filenames to list without asking
     first.  If set to zero, the shell asks only if the top of the
     listing would scroll off the screen.

Even though `filenames' is definitely the wrong word here, I think it
should be clear enough.

And that's what the test you quoted above does. `complistmax' is the
atoi() of the value of `$compconfig[list_max]'. So, we ask if either
that is non-zero and the number of matches is larger than that value
or if the value is zero and the number of lines needed for the list is 
larger that the screen height.

In other words: if you only want the list if it fits on the screen,
set `LISTMAX=0'.

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


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

end of thread, other threads:[~1999-11-04  9:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-11-03 17:07 Once more: "Do you wish to see all xxx possibilities?" Andrej Borsenkow
1999-11-04  9:47 Sven Wischnowsky

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