Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: info completion doesn't offer index entries any longer



2021-08-05 09:53:23 +0200, Oliver Kiddle:
[...]
> > > $ info -k '' | wc
> > > 47919  267467 2341131
> 
> You clearly have vastly more on your system than I have. I would guess
> that among that extra output is an entry or entries that need additional
> quoting or something and are breaking _describe - colons perhaps.

Most of those are from a dozen of info manuals:

$ info -k '' | grep -Po '^"\(\K[^)]*' | uniq -c | sort -rn | pr -t3
   4979 gcc                 650 kpathsea            179 diffutils
   4820 libc                501 flex                177 gawkinet
   4143 gcal                500 nettle              158 datamash
   3641 gdb                 479 bash                150 rcs
   2740 zsh                 463 autogen             105 find
   2682 gawk                409 info-stnd           103 grub
   2679 coreutils           372 tlbuild              86 stabs
   2500 groff               355 m4                   51 libffi
   2437 gnulib              353 sed                  51 history
   1975 texinfo             336 readline             51 gperf
   1356 recode              325 screen               15 cpio
   1316 gettext             271 texi2html             8 time
   1157 automake-1          269 ssed                  8 texinfo
    843 tar                 268 grep                  8 gzip
    809 gnupg               247 mtools                5 ssip
    806 web2c               231 wget                  1 grub-dev
    792 cvs                 192 gawkworkflow          1 gawk
    680 dvips               186 speech-dispatch

(not sure why there should be only one entry for gawk for
instance though).

[...]
> I think that method only retrieves the menu for the top level of the
> manual. It makes more difference with some documentation than others.

You're right, I was too quick to jump to conclusions.

> There is no actual attempt to complete anything for --index-search=
> What do you think we should do there?

Well, I was hoping zsh would give me similar completion as
info's i would.

$ info -k '' | grep -iPo '^"\Q(zsh)\E.*" -- \Kread' | sort -u
read
READ

That's not the same as what info i completion gives me on "read" though:

8 completions:
read                         read-from-minibuffer         READNULLCMD                  READNULLCMD, ignoring <1>
read-command                 reading a line               READNULLCMD, ignoring        READNULLCMD, use of

I must have misunderstood what info -k does.

Doing the same as i's completion may require parsing the contents of the info
file directly.


> > Evidence of that is that fixing that "info -k" to intended "info
> > -k ''" doesn't seem to change much if at all the behaviour (but
> > makes the completion significantly slower).
> >
> > Also, caching doesn't seem to work properly as "info -k ''"
> > seems to be invoked every time.
> 
> It does appear to work in my testing. Does the cache variable get set in
> your case? Again, I suspect something peculiar to the longer info -k ''
> output on your system is causing issues for the basic nested parameter
> expansion that parses the output.
[...]

What I mean is that I'd expect info -k '' would only need to be
run once within a single interactive zsh session. When I
instrument it with

info() { echo info called>/dev/tty; command info "$@";}

I can see info being called each time I complete info zsh something<Tab> for
instance.

-- 
Stephane




Messages sorted by: Reverse Date, Date, Thread, Author