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

Re: WORDCHARS, etc.



Sven Wischnowsky wrote:
> I've prepared a patch for this argument-passing thing, too. I haven't
> tried, but I'm sure this will clash with Peter's patch. So I'll just
> explain what it does and append it below if some of you want to try
> it. Those parts that are considered good things can then be merged
> with Peter's.

I'd better leave both of these out of pws-22 and we can decide later.  No
doubt Bart will have impartial views.

> - The zle functions (the C-functions) have been changed to get an
>   `char **args' argument and to return an integer. The return value is 
>   currently only used to signal some kind of error condition. Of
>   course, it is also returned when invokiing widgets via `zle'.

This is more far-reaching than mine.

> - I've taken {vi-,}history-search-{for,back}ward as examples that use
>   the arguments -- they all accept one string which is then searched.

I just made it put the string given in the buffer, but your idea is
probably more useful, since mine doesn't lend itself to subsequent
programming.

> - The read builtin uses `getkey()' when called from a zle widget and
>   when reading from stdin.

is that when (called from a zle widget && reading from stdin)? in which
case that's a good idea.

> - Another option for `zle': -R makes the command line be re-displayed.
>   It gets an optional argument: a string to display in the status
>   line.

This is useful

> - Finally, my suggestion for enhancing aliases. I've used a different
>   option character for this and because I couldn't think of a good
>   one, I've just taken `X':
> 
>     zle -X new-name old-name numeric args...

I'm not sure we need both this and zle -A.  And having this the other way
round from zls -A is just creating more confusion, even if the -A choice
was non-optimal (though it is in the UNIX tradition of things like mv and
ln; if -L hadn't been used it would have been more obvious).

There was some opposition to enhancing aliases anyway, since you can
always define a function widget.  One reason why I like them is it raises
the possibility of having builtin widgets implemented as aliases at shell
startup, which is a non-starter if you need a function.

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy



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