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

Re: Compctl completion tweaking

On Jun 29, 10:40am, Sven Wischnowsky wrote:
} Subject: Re: Compctl completion tweaking
} Bart Schaefer wrote:
} > So this brought me to the observation that an inclusive-or is missing.
} But all flags written directly after one another (without `+') are
} or'ed inclusively. The mechanism for xor'ed completion is for the case 
} when one doesn't want all of them.

Yes, I understand.  As I suggested before, it's probably partly a doc
issue, though in this case I don't immediately have a suggestion for
improving it.

} Only for control flags there is no simple solution.

I wouldn't call it "simple" to have to repeat overlapping patterns in an
extended completion.  But I agree that only for control flags is there
really no usable solution at all.

} So, we are in search of a way to specify multiple argument/control
} options (or'ed inclusively) together with a way to specify the order
} in which options are listed/inserted, right?
} For that I would use some new compctl-syntax (like the one I proposed
} in one of my previous mails, only applying always), unless enough
} people say that they don't want to retain the current meaning of `+'

I do not advocate changing the current meaning of `+'.  I don't think
we should use a shell option.  I'm not very excited about `++' as the
choice for inclusive-or, though; the compctl syntax is already too
cryptic (which I suppose might be an argument for not worrying about
making it more so, but ...).

It'd be nice to choose something that currently produces an error, so
as not to co-opt anything from any existing working compctl.  (`++' is
now taken as a command name.)

} Btw: when implementing this, we also could cleanup the code a bit by
} storing more than just the string to insert for each match, e.g.:
} - some kind of prefix/suffix and the whole string
}   (this would allow us to make the `-/' flag accept multiple directories)

I'm confused.  You mean make the -W flag accept multiple directories?

} - a weight (for sorting the matches as the user wishes, see above)

Hrm.  I'd rather just list the matches in the order they're specified
in the compctl command, without re-sorting.  And similarly, don't sort
the value of $reply.  Just one control flag to say "don't sort" would
be sufficient, I think.

} - a flag saying if this is a file name or not, so that mixing `-f' or
}   `-g' with other options still uses LIST_TYPES on the files

I've no opinion on this, as I never use LIST_TYPES.

Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com

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