zsh-workers
 help / color / mirror / code / Atom feed
From: Stephane Chazelas <stephane@chazelas.org>
To: Oliver Kiddle <opk@zsh.org>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: info completion doesn't offer index entries any longer
Date: Sun, 8 Aug 2021 16:58:04 +0100	[thread overview]
Message-ID: <20210808155804.v7di4mpoyyis7h4k@chazelas.org> (raw)
In-Reply-To: <26560-1628150003.918228@jgeh.uisY.RfGy>

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


  reply	other threads:[~2021-08-08 15:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-01 16:05 Stephane Chazelas
2021-08-01 16:24 ` Stephane Chazelas
2021-08-05  7:53   ` Oliver Kiddle
2021-08-08 15:58     ` Stephane Chazelas [this message]
2021-08-09 13:36       ` Oliver Kiddle

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=20210808155804.v7di4mpoyyis7h4k@chazelas.org \
    --to=stephane@chazelas.org \
    --cc=opk@zsh.org \
    --cc=zsh-workers@zsh.org \
    /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).