Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Implement printtime hook function
On Wed, 26 Jun 2013 02:19:49 -0400
Phil Pennock <zsh-workers+phil.pennock@xxxxxxxxxxxx> wrote:
> I'm tempted to make this $REPORTTIME only, by amending printtime() to
> take a new bool parameter and renaming the hook to reporttime().
I think that would be preferable, since there are other reasons for
printing time information which are triggered in other ways.
> Another issue is that reporttime() (shell-level function) becomes a new
> magic function additionally called, and we don't have namespaces for
> functions, but I think our normal approach is to accept that it _might_
> conflict with scripts, right?
I'd be tempted to call it zsh_reporttime. I've been putting zsh_
prefixes in front of new hooks and similar for a while.
> What do people think? Is this generally useful enough, and should I
> amend printtime? How best to pass the various values or make them
> available?
It seems like it might be useful. It's probably limited by the current
implementation to jobs at the command line, though.
If it's restricted to triggers by REPORTTIME I don't think inefficiency
about passing arguments is too much of a worry. The current method is
probably OK: the set of numbers in the time information has been stable
for a long time.
--
Peter Stephenson <p.stephenson@xxxxxxxxxxx> Principal Software
Engineer Tel: +44 (0)1223 434724 Samsung Cambridge
Solution Centre St John's House, St John's Innovation Park,
Cowley Road, Cambridge, CB4 0DS, UK
Messages sorted by:
Reverse Date,
Date,
Thread,
Author