I put tentatively the F prefix because it is easy to understand that is an abbreviation for Function and because I have not tested/exploredf the possibility of pure numerical labels.
Anyway if we keep the F+2 numbers we have 100 functions available, (00 to 99) in a single .lll and if the limit for a .lll (which is a differently named .g4b) remains at 2000 lines, that is 20 lines per function (including labels and comments) on average, I doubt that a "same topic" .lll will actually be ever filled with more than 100 functions.
But nothing prevents us (apart a single byte "wasted") to have F000 to F999, one whole thousand possible functions in a .lll.
'F' as prefix sounds logical (although I didn't make the association). Given max 128 labels higher numbers will be not possible.
I still found it a bit early to 'set' a format for numbered functions already. Also your format 'if %@retval%>=4 set /A skip=0x0%1-5-6 > nul' is 'one size fits all'.
I played a bit with SHOWFUNC.G4B to see if it can be made a little bit less restrictive, without losing functionality.
The two remark-types: '#-#+' and '#-#' are very powerful search indexes, together with a space before the searched phrase. I believe they are 'high potentials', together with your loops for ':more_lines/ :do_lines'.
Only the six reserved chars before a function-name are not necessary in my opinion. Enough is if search is 'near' with a range of six chars.
I tried this with following lines in call :do_single (lines original, or changed in my last post in Italic Bold):
(...)
if %skip%<=0 && set /A skip=0 > nul
set skip1=
cat --skip=%skip% --locate=\x23\x2D\x23\x2B --length=10 %target% > nul &; set /A skip1=%?% > nul
if exist skip1 && set skip=%skip1%
cat --skip=%skip% %target% | set thisline=
if not exist skip1 && set thisline=
if %thisline:~0,4%==#-#+ && echo $[0x0F]%thisline:~4%
#if %thisline:~0,3%==#-# &; if %thisline:~3,1%==+ && echo $[0x0F]%thisline:~4% ! echo -e \x20\x20\x20%thisline:~3%
(...)
With these changes it's possible to have more variety, see for instance this 'print-screen' (converted with Tesseract from a 640x480 Vbox print-screen):
grub> showfunZ GETLEAP.LLL +
GETLEAP LLL v0.5 (20210822), by deomsh.
FO1 - GetLeapYear <yyyy>
GetLeapSecond <yyyy> [<mm>1
002 Alias of: GetLeapSecond - Arguments: <yyyy> [<mm>1
3 GetLeapSecondCum <yyyy>
grub>
grub> showfund GETLEAP.LLL GETLEAP.LLL
GETLEAP.LLL v0.5 (20210822), by deomsh.
Exports: GetLeapYear GetLeapSecond GetLeapSecondCum
Import:
Mandatory Arguments: year in yyyy-format
grub> showfunZ GETLEAP.LLL GetLeapYear
FO1 - GetLeapYear <yyyy>
Remarks: Leap-years corrected for centuries and millenniums
grub> showfun2 GETLEAP.LLL FO1
FO1 - GetLeapYear <yyyy>
Remarks: Leap-years corrected for centuries and millenniums
grub> showfunZ GETLEAP.LLL GetLeapSecond
GetLeapSecond <yyyy> [<mm>1
Alias: 002
Optional Arguments: <mm> only with GetLeapSecond (some years from July
Remarks: Leap-seconds: in database known until juli 2021
grub> showfunZ GETLEAP.LLL 002
002 Alias of: GetLeapSecond - Arguments: <yyyy> [<mm>1
Optional Arguments: <mm> only with GetLeapSecond (some years from July
Remarks: Leap-seconds: in database known until juli 2021
grub> showfun2 GETLEAP.LLL GetLeapSecondCum
grub> showfunZ GETLEAP.LLL 3
3 GetLeapSecondCum <yyyy>
Remarks: Leap-seconds: in database known until juli 2021
yrub>
BTW Intentionally I made no corrections, except removing empty lines added by Tesseract.
the #3):
3) Functions which names are an extension of an earlier (shorter) function-name are listed too, if the shorter name is given (maybe what you wanted?)
is a side effect (originally unintentional) but it is IMHO a good thing, as one may remember vaguely the function name and this way also similarly named ones are shown.
I agree, only I found that call :more_lines came only after the last function found, so lines with '#-#' after a function-name/ number/ F-abbreviation are not showed.
This I tackled in following way: just set the call earlier (with some minor changes)
set locatemo=\x23\x2D\x23\x20
if %thisline:~0,4%==#-#+ && set /a cnt=1 > nul && cat --skip=%skip% --locate=%locatemo% %target% | call :more_lines
shift
if not %1.==. goto :do_single
#set locate=\x23\x2D\x23
#cat --skip=%skip% --locate=%locate% %target% | call :more_lines
Output for instance this 'print-screen' (converted with https://image2text.site also from a 640x480 Vbox print-screen):
grub> showfun2 GETLEAP.LLL GetLeap all
GETLEAP. LLL vO.5 (20210822), by deomsh.
Exports: GetLeapYear GetLeapSecond GetLeapSecondCum
Imports:
Mandatory Arguments: year in yyyy-format
F01 - GetLeapYear <yyyy>
Remarks: Leap-years corrected for centuries and millenniums
GetLeapSecond <yyyy> [<mm>]
Alias: 002
Optional Arguments: <mm> only with GetLeapSecond (some years from July, 1)
Remarks: Leap-seconds: in database known until juli 2021
3 GetLeapSecondCum <yyyy>
Remarks: Leap-seconds: in database known until juli 2021
grub> showfun2 GETLEAP.LLL GetLeapSecond find
GetLeapSecond <yyyy> [<mm>]
Alias: 002
Optional Arguments: <mm> only with GetLeapSecond (some years from July, 1)
Remarks: Leap-seconds: in database known until juli 2021
3 GetLeapSecondCum <yyyy>
Remarks: Leap-seconds: in database known until juli 2021
grub> showfun2 GETLEAP.LLL GetLeapSecondC search
3 GetLeapSecondCum <yyyy>
Remarks: Leap-seconds: in database known until juli 2021
grub>
BTW Intentionally I made no corrections ('O' vs '0' / to many spaces)
BTW2 still no time to try Wonko´s tip: using the serial console of grub4dos in Virtualbox via Putty
BTW3 For single function-search I added a space AFTER variable %locate% too (so max 14 real chars left). To search with first part of function-name I added a switch (for the forget-full: three phrases possible).
if not /i %3==all if not /i %3==find if not /i %3==search && if not %ordinal%==Y && set locate=%locate%\x20
Oeps, no '--' or '/' before, I like '/' most (fastest for me).