Re: [PATCH] Fix WATCH/watch tying
Bart Schaefer <[email protected]>
| Newsgroups | gmane.comp.shells.zsh.devel |
|---|---|
| Message-ID | <CAH+w=7Y7UzYo3ev5orV7vaM+b7e3FTj71KbGdGyxBrGPYU4FQg@mail.gmail.com> |
On Fri, May 1, 2026 at 6:38 PM Oliver Kiddle <[email protected]> wrote: > > An environment variable doesn't have a type associated with it so it'd > be a case of limiting this to scalars. From a quick scan, WATCH is about > the only scalar autoloaded parameter. Otherwise, there's only SRANDOM > which is readonly. Without loading the module, the shell only knows the > parameter's name and not the type. Maybe some additional marker can be > added. Presuming you mean adding something to watch.mdd autofeatures? The standard features are builtins, conditions, parameters and math functions; these are indicated by the prefix 'b:', 'c:' ('C:' for an infix condition), 'p:' and 'f:', respectively, followed by the name that the corresponding feature would have in the shell. So you're thinking something like 'i:' for imported or 'e:' for environment, or possibly 'P:' for "special parameter"? And the effect is to cause the module to autoload at initialization when the environment variable is (about to be) imported? I don't think there's any way for this to be entirely handled by the module unless the WATCH environment is ignored until the module loads ... which would probably be OK, actually; why would you expect the search to work if you never loaded the module? Backward compatibility?