Title [PATCH] zrcautoload() improved and ZSHified
Priority bug Status chatting
Superseder Nosy List Xk2c, ft
Assigned To ft Topics

Created on 2016-05-08.13:26:32 by Xk2c, last changed 2017-01-27.14:14:10 by mika.

File name Uploaded Type Edit Remove
0001-PATCH-zrcautoload-improved-and-ZSHified.patch Xk2c, 2016-05-08.13:26:31 text/x-diff
msg5860 (view) Author: Xk2c Date: 2016-05-08.17:24:26
Thilo Six schrieb/wrote:

>        * ZSHified, i.e. use globbing instead of looping

just wanted to correct myself here. As i have learned now that is not called
globbing it is brace expansion.
Non the less it is cool. 

also i noticed in my patch i use the term:

ffound=($(print ${^fpath}/${ffile}(N:p)))

that would be better written as:


Let me know if you think that could make its way into mainline. Then i produce a
proper updated patch.

kind regards,

msg5859 (view) Author: Xk2c Date: 2016-05-08.13:26:31
Hello hopefully-not-so-grml-today folks,   ;)

i was looking at zrcautoload() and the various cases where it would be used.
When i came down to where run-help is initialised i thought it would be better
to not hardcode functions names and was looking for a general solution for that.
After having found that in the fine manual (actually several hours later....) it
occured that zrcautoload() itself could be improved.
And so here you go:

* MOD: zrcautoload()
       * make it multi argument aware
         returns 0 when all PARAMETERS had been autoloaded
         returns 1 when at least one PARAMETER could not be found for autoloading
         returns 2 when autoload itself had some problem
       * ZSHified, i.e. use globbing instead of looping
* MOD: with the modified zrcautoload() from above a few use cases could be optimized
* FIX: zrcautozle() drop superflous variable 'fnc'
* FIX: run-help, do not hardcode function names, there were allready some missing
       instead use what is avail on system

As usual i tried hard not to introduce regressions.
Actually i left some debuiing echos in the code.
This should make it easier for you to review and in case to trace down a problem.

kind regards,

Date User Action Args
2017-01-27 14:14:10mikasetassignedto: ft
nosy: + ft
2016-05-08 17:24:26Xk2csetstatus: unread -> chatting
messages: + msg5860
2016-05-08 13:26:32Xk2ccreate