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


Stephane Chazelas <Stephane_Chazelas@xxxxxxxx> wrote:
> functions[preexec]+='
>   get_saved_dirstack'
> functions[chpwd]+='
>   save_dirstack'

This is even further away from the original subject, but I've often felt
that functions like preexec and chpwd are getting a bit overloaded and
are unnecessarily hard to maintain automatically.  It would be easy to
add an array which could contain names of functions to be executed,
similar to Emacs hooks.  Of course you can implement such an array
within the existing functions, but the advantage of having a fixed
mechanism is that it's easy to add to and be sure it's working without
getting in anyone else's way.  You still have namespace problems, of
course, but if you have functions called get_saved_dirstack and
save_dirstack that clash your real problem is almost certainly more
basic than naming.

However, I'm not sure if it's really needed.

Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070

To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php

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