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

Re: setopt localoptions noautoremoveslash



Wayne Davison wrote:

> I would like an auto-added slash to be inserted into the buffer as a
> special meta character (call it meta-/ for now) that has special
> properties.  I imagine this character displaying itself in reverse
> video _only_ if it is going to be removed when I press return (it is
> not removed before that unless you type a '/' right next to it).
> The command-line display routine would check the character to the
> right of the meta-/ to determine how to draw the character.

What would you do with `-qSfoo'? I.e. you would have to allow every
possible character to have an auto-removable counterpart. Also, you
would have to store information about which sequences of characters
have to be removed together. And then there is `compadd -r', so you
would have to store information about the characters that will remove
the suffix. And there is `-R', so you may have to call a function to
find out if something is to be removed (and currently these functions
can be sure to be called after the completion that inserted the
suffix, if called only on a return, this isn't true any more).

So, a complete solution would be hard (or impossible without changing
the definition of the context in which remove-functions are to be
called -- which is probably still possible because we haven't said
that in the docs, although I think its convenient to be able to
access, e.g. `_lastcomp' from within such remove-functions). That
would leave the possibility to do this only for some (simple)
auto-remove things but that might irritate the users if some suffixes
behave this way and other behave differently.

And then there is the (small) problem that the line editor can't just
use, e.g. standout mode, to highlight such auto-removed things because 
users are free to start any terminal mode they want in `PS1' and unset 
it in `POSTEDIT' or whatever (the solution would obviously be to make
this configurable by adding a special parameter (or two of them) whose 
value(s) are printed before/after such a highlighted region).

Hm.

Bye
 Sven


--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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