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

Re: Better Help Docs Searching?



Zach Riggle wrote on Sun, Aug 01, 2021 at 05:44:52 -0500:
> A good example is the builtin 'read'.  Even knowing it's a builtin,
> and searching the docs [1] / man pages for builtins, it's still not
> very straightforward to find the docs on 'read'.  (There are 91
> matches for "read" on the online docs and 82 in zshbuiltins).
> 
> I checked out the Zsh source, and can trivially find e.g.
> 
> $ git grep 'findex(read)'
> Doc/Zsh/builtins.yo:1492:findex(read)
> 
> Which is neat, but not quite useful since reading the raw YODL text is
> cumbersome.

We have a Vim syntax highlighting for yodl files which may help
(Util/zyodl.vim).

It should even be possible to create tags for both texinode() and
cindex()/findex()/kindex()/pindex()/tindex()/vindex() instances, using
ctags(1) with a few regexes on the command-line, and then use the usual
tag-jumping commands (:h -t, :h Q_ta).

> YODL itself seems to be end-of-life / deprecated, so I
> don't expect this situation to change, and it would be an immense
> undertaking to rewrite Zsh docs in a different way.
> 
> All of that said, is there any way to easily find keywords / flags in
> either the online docs OR the man pages -- rather than having way too
> many matches for other things that mention the same word (e.g. "read"
> as mentioned above).
> 

You could grep the yodl sources for «(read» _including_ the parentheses.
That would find references to the builtin without finding uses of the
ordinary English word "read".  If your $EDITOR doesn't have yodl syntax
highlighting configured, you could then open the same part of the manual
in ${PREFERRED_VIEWING_FORMAT}.

Cheers,

Daniel


> [1]: https://zsh.sourceforge.io/Doc/Release/Shell-Builtin-Commands.html
> 
> Thanks for your time,
> Zach Riggle
> 




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