TeX-Live / texdoc

Find and view documentation in TeX Live
https://tug.org/texdoc/
GNU General Public License v3.0
47 stars 8 forks source link

Prompt when there are too many results #97

Closed wtsnjp closed 9 months ago

wtsnjp commented 1 year ago

Currently, in list mode, when there are more results than max_lines, only a prompt asking if the entire list should be displayed, is shown.

$ texdoc -l plain
96 results. Display them all? (y/N)

To minimize the number of user interactions, I think it would be better to show the top max_lines results from the beginning and change to a prompt asking if more should be shown.

$ texdoc -l plain
96 results. Only the top 20 are shown below.
 1 /usr/local/texlive/2023/texmf-dist/doc/plain/font-change/font-change.pdf
   = Package documentation
 2 /usr/local/texlive/2023/texmf-dist/doc/plain/fontch/fontch.pdf
   = Package documentation
 3 /usr/local/texlive/2023/texmf-dist/doc/plain/gentle/gentle.pdf
   = The document itself
...
20 /usr/local/texlive/2023/texmf-dist/doc/plain/impatient-fr/fbook.pdf
   = [fr] A copy of the book (French translation)
Enter number of file to view, the Return key to view 1, S to show all results, or any other key to exit: 
kberry commented 1 year ago
To minimize the number of user interactions, I think it would be better
to show the top max_lines results from the beginning and change to a
prompt asking if more should be shown.

Good idea, IMHO.

Only the top 20 are shown below.

Or maybe 10? Not sure. I feel like usually the one I want is in the top

  1. --thanks, karl.
wtsnjp commented 1 year ago

20 is the current default value for max_lines. I can lower that default to 10 to accommodate this change.