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

Re: How to complete backquote, etc. using compsys?



Bart Schaefer wrote:
>The question in this case (and in other cases of multiple suffix layers)
>is exactly when you remove them.  E.g. with a file suffix like '/', it
>gets removed if you immediately press enter, but in the above case it
>should not get removed.

The rule we've used so far is to remove as little as was reasonable
to give a special character its customary special meaning.  So, for
example, after auto-adding "}/" after a parameter name, ":" or "}"
would result in removing both characters, "/" or " " would remove just
"/", and alphabetic characters wouldn't remove anything.

>should not get removed.  Also with $(...) or `...`, pressing space after
>the autoremovable suffix is ambiguous -- more arguments to the command,
>or the next thing after it?

This is indeed ambiguous.  It raises the question of why we're auto-adding
the ")" or "`".  To be consistent with our previous practice for removable
suffixes, we shouldn't be adding the suffix if it leads to such ambiguity.
However, once we've got the suffix there, " " shouldn't be removing it
-- it is perfectly reasonable to insert a real space immediately after
a closing "`" or ")".  We should only be removing the closing character
if the next character typed is one that only makes sense as an addition
to the command inside the substitution.

-zefram



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