Actually currently the paths are searched as follows (for [declare -path] paths):
- searchpaths declared locally in the abstraction applied to the topmost patch's directory
- searchpaths declared in the containing abstraction applied to the topmost patch's directory
- searchpaths declared in the grandparent abstraction applied to the topmost patch's directory
- ...
I've proposed a patch that would search:
- searchpaths declared locally in the abstraction
applied to the abstraction's directory then to the topmost patch's directory
- searchpaths declared in the containing abstraction
applied to the containing abstraction's directory then to the topmost patch's directory
- searchpaths declared in the grandparent abstraction
applied to the grandparent abstraction's directory then to the topmost patch's directory
- ...
This would allow to harmlessly turn a top-level patch into an abstraction (e.g located in another directory than caller's one), even if it uses [declare]s.