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

Re: alias -x?



(This is a rather late reply, but I've finally found fifteen
redefinable minutes).

Julio Garcia wrote:
> Our environment requires that I "dot" some scripts that
> export aliases (as in ksh alias -x).
> 
>   If I had to, where could I change the zsh source that I have to make
>   it ignore the -x flag?

The same problem happens with tracked aliases (-t).  I produced a
patch some time ago to make zsh ignore a few ksh options, including
`set -o emacs' etc., which is, as noted, very useful when running ksh
initialisation scripts.  However, it didn't make it.

You have to alter the appropriate line in the builtins table in
hashtable.h, adding "tx" to the options "Lgmr".  Next, decide what you
are going to do when these are set (ignore the x, presumably, but with
t it's harder:  the easiest thing is to ignore the whole statement,
but a better solution would probably be to treat this 'alias -t' the
same as hash) and add the code to bin_alias() in builtin.c.  As you
will see, ops['t'] and ops['x'] tell you whether these have been set.

If there was any chance of including this in the distributions I would
have a go myself.  (Maybe Zefram could handle code to deal with
options like `emacs', `nolog', `vi', `viraw' and `trackall' quite
easily with the rewritten option code.)

-- 
Peter Stephenson <pws@xxxxxx>       Tel: +49 33762 77366
WWW:  http://www.ifh.de/~pws/       Fax: +49 33762 77413
Deutches Electronen-Synchrotron --- Institut fuer Hochenergiephysik Zeuthen
DESY-IfH, 15735 Zeuthen, Germany.



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