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

Re: PATCH: configurability of pattern characters, part 1



On Jun 1, 12:29am, Peter Stephenson wrote:
}
} The second step, to follow: now we have the "zpc_special" array, it will
} be possible (and fairly straightforward) to introduce a special variable
} to indicate pattern characters that should be turned off

Possible alternative idea -- use the enable/disable builtins?

    disable -p '^' '(' '+('

(Choose another switch if you don't like -p for pattern.)

I suppose that's harder to set/restore on within/without a local scope.
On the other hand I've frequently wished that some internal tables were
scope-able; e.g., making the $functions special variable a local has
subtle undesirable side-effects on autoloaded functions, but if the
underlying table itself could be localized, those would go away.

} We'll need to set the new shell variable(s) locally to empty for
} completion.

Hmm, that's another problem with the enable/disable idea ... or is it?
"emulate -R zsh -c 'autoload _main_complete'" should do the trick ...?

} I think also "emulate" should clear them (locally for "emulate -L") to
} present a pristine pattern environment for emulation.

I agree ... which for me is an argument *against* using variables for
this.  I know emulation modes already play with the special-ness of
things like HISTCHARS and MANPATH, but it doesn't actually go so far
as creating empty locals for them.

Speaking of HISTCHARS, do we agree that it'd be a bad idea to be able
to swap around which characters have what glob semantics?  E.g., it's
OK if * means only "*", but you can't make % mean "match any number of
any character".

-- 
Barton E. Schaefer



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